Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Wed, 8 Feb 2017 15:31:50 +0000 (16:31 +0100)
committerwoltlab.com <woltlab@woltlab.com>
Wed, 8 Feb 2017 15:31:50 +0000 (16:31 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/combined.min.js
wcfsetup/install/files/js/WCF.Combined.min.js
wcfsetup/install/files/js/WoltLabSuite.Core.min.js

index 7a2d4dc3a26e203a9d2bc92864eba73fd8313bd1..93d7ff4bc762ddba3e2c30d7304adea8f6c5bec6 100644 (file)
@@ -13,7 +13,7 @@ $.Redactor.prototype.WoltLabAutosave=function(){"use strict";return{init:functio
 // WoltLabBlock.js
 $.Redactor.prototype.WoltLabBlock=function(){"use strict";return{init:function(){this.block.tags=["p","blockquote","pre","h1","h2","h3","h4","h5","h6","div","figure"],this.block.format=function(t,e,o,i){return t="quote"===t?"blockquote":t,-1!==$.inArray(t,this.block.tags)?("p"===t&&"undefined"==typeof e&&(e="class"),this.placeholder.hide(),this.buffer.set(),this.utils.isCollapsed()?this.block.formatCollapsed(t,e,o,i):this.block.formatUncollapsed(t,e,o,i)):void 0}.bind(this);var t=this.block.formatCollapsed;this.block.formatCollapsed=function(e,o,i,s){var l=this.selection.block();if(!l||"LI"!==l.nodeName&&"TD"!==l.nodeName){if(this.detect.isFirefox()){var h=this.core.editor()[0];document.activeElement!==h&&(this.selection.restore(),document.activeElement!==h&&h.focus()),this.selection.block()===!1&&this.focus.end()}for(var a=t.call(this,e,o,i,s),r=0,c=a.length;c>r;r++)this.WoltLabBlock._paragraphize(a[r]);return this.caret.end(a),a}}.bind(this);var e=this.block.formatUncollapsed;this.block.formatUncollapsed=function(t,o,i,s){for(var l,h=e.call(this,t,o,i,s),a=null,r=0,c=h.length;c>r;r++)if(l=h[r][0],this.WoltLabBlock._paragraphize(l),0===r)a=l;else{for(;l.childNodes.length;)a.appendChild(l.childNodes[0]);elRemove(l)}return $(a)}.bind(this)},register:function(t,e){-1===this.block.tags.indexOf(t)&&(this.block.tags.push(t),this.opts.paragraphizeBlocks.push(t),-1===this.opts.blockTags.indexOf(t)&&(this.opts.blockTags.push(t),this.reIsBlock=new RegExp("^("+this.opts.blockTags.join("|").toUpperCase()+")$","i")),e&&this.WoltLabKeydown.register(t))},_paragraphize:function(t){if(-1===["p","pre","h1","h2","h3","h4","h5","h6","div","figure"].indexOf(t.nodeName.toLowerCase())){for(var e=elCreate("p");t.childNodes.length;)e.appendChild(t.childNodes[0]);t.appendChild(e)}}}};
 // WoltLabButton.js
-$.Redactor.prototype.WoltLabButton=function(){"use strict";var t;return{init:function(){var t,e,o,n;for(o=0,n=this.opts.woltlab.customButtons.length;n>o;o++)e=this.opts.woltlab.customButtons[o],t=this.button.add(e,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var s,i,a;for(o=0,n=this.opts.buttons.length;n>o;o++)if(e=this.opts.buttons[o],"wcfSeparator"!==e){if(!this.opts.woltlab.buttons.hasOwnProperty(e))throw new Error("Missing button definition for '"+e+"'.");switch(s=this.opts.woltlab.buttons[e],"underline"===e&&(this.opts.activeButtonsStates.u="underline"),e){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.setEvent(t,e,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===e?"sub":"sup"]=e;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.addCallback(t,this.buffer[e]);break;default:t=this.button.get(e)}if(i=s.icon,a=!1,!i.match(/^fa-/)&&i.match(/\.(gif|jpe?g|png|svg)$/)&&(a=!0),this.button.setIcon(t,'<span class="icon icon16 '+(a?"redactorButtonImage":i)+'"'+(a?" style=\"background-image: url('"+WCF_PATH+"icon/"+i+"')\"":"")+"></span>"),!t[0])throw new Error("Missing button element for '"+e+"'.");if(elAttr(t[0],"title",s.title),t[0].classList.add("jsTooltip"),"lists"==e){var r=t.data("dropdown");elBySel(".redactor-dropdown-outdent span",r[0]).textContent=WCF.Language.get("wcf.editor.list.outdent"),elBySel(".redactor-dropdown-indent span",r[0]).textContent=WCF.Language.get("wcf.editor.list.indent")}}for(var l,c={},d=[],u=this.core.toolbar()[0];u.childElementCount;)l=u.removeChild(u.children[0]),e=elAttr(l.children[0],"rel"),c[e]=l,d.push(e);var h=!1;for(o=0,n=this.opts.buttons.length;n>o;o++)e=this.opts.buttons[o],"wcfSeparator"!==e?(l=c[e],u.appendChild(l),d.splice(d.indexOf(e),1),h&&(l.classList.add("redactor-toolbar-separator"),h=!1)):h=!0;for(o=0,n=u.childElementCount;n>o;o++)l=u.children[o],t=l.children[0],elData(l,"show-on-mobile",-1!==this.opts.woltlab.buttonMobile.indexOf(t.rel));d.forEach(function(t){u.appendChild(c[t])}),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(t){t.on("screen-xs",{match:this.WoltLabButton._enableToggleButton.bind(this),unmatch:this.WoltLabButton._disableToggleButton.bind(this),setup:this.WoltLabButton._setupToggleButton.bind(this)})}.bind(this))},_handleCustomButton:function(t){var e={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,e),e.cancel!==!0){this.buffer.set();var o="["+t+"]"+this.selection.html()+(this.selection.is()?"":this.marker.html())+"[/"+t+"]";this.insert.html(o),this.selection.restore()}window.setTimeout(function(){document.activeElement!==this.$editor[0]&&this.$editor[0].focus()}.bind(this),10)},_enableToggleButton:function(){null===t.parentNode&&this.$toolbar[0].appendChild(t)},_disableToggleButton:function(){null!==t.parentNode&&this.$toolbar[0].removeChild(t)},_setupToggleButton:function(){t=elCreate("li"),t.className="redactorToolbarToggle",t.innerHTML='<a href="#"><span class="icon icon16 fa-caret-down"></span></a>',elData(t,"show-on-mobile",!0);var e=t.children[0].children[0],o=function(t){t instanceof Event&&t.preventDefault(),this.$toolbar[0].classList.toggle("redactorToolbarOverride")&&document.activeElement&&document.activeElement!==this.$editor[0]&&document.activeElement.blur(),e.classList.toggle("fa-caret-down"),e.classList.toggle("fa-caret-up")}.bind(this);t.children[0].addEventListener("mousedown",o),this.$toolbar[0].appendChild(t),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+this.$element[0].id,function(){this.$toolbar[0].classList.contains("redactorToolbarOverride")&&o()}.bind(this))}}};
+$.Redactor.prototype.WoltLabButton=function(){"use strict";var t;return{init:function(){this.button.buildButtonTooltip=function(){};var t,e,o,n;for(o=0,n=this.opts.woltlab.customButtons.length;n>o;o++)e=this.opts.woltlab.customButtons[o],t=this.button.add(e,""),this.button.addCallback(t,this.WoltLabButton._handleCustomButton);var i,s,a;for(o=0,n=this.opts.buttons.length;n>o;o++)if(e=this.opts.buttons[o],"wcfSeparator"!==e){if(!this.opts.woltlab.buttons.hasOwnProperty(e))throw new Error("Missing button definition for '"+e+"'.");switch(i=this.opts.woltlab.buttons[e],"underline"===e&&(this.opts.activeButtonsStates.u="underline"),e){case"subscript":case"superscript":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.setEvent(t,e,{func:"inline.format"}),this.opts.activeButtonsStates["subscript"===e?"sub":"sup"]=e;break;case"redo":case"undo":t=this.button.addAfter(this.opts.buttons[o-1],e,""),this.button.addCallback(t,this.buffer[e]);break;default:t=this.button.get(e)}if(s=i.icon,a=!1,!s.match(/^fa-/)&&s.match(/\.(gif|jpe?g|png|svg)$/)&&(a=!0),this.button.setIcon(t,'<span class="icon icon16 '+(a?"redactorButtonImage":s)+'"'+(a?" style=\"background-image: url('"+WCF_PATH+"icon/"+s+"')\"":"")+"></span>"),!t[0])throw new Error("Missing button element for '"+e+"'.");if(elAttr(t[0],"title",i.title),t[0].classList.add("jsTooltip"),"lists"==e){var r=t.data("dropdown");elBySel(".redactor-dropdown-outdent span",r[0]).textContent=WCF.Language.get("wcf.editor.list.outdent"),elBySel(".redactor-dropdown-indent span",r[0]).textContent=WCF.Language.get("wcf.editor.list.indent")}}for(var l,c={},d=[],u=this.core.toolbar()[0];u.childElementCount;)l=u.removeChild(u.children[0]),e=elAttr(l.children[0],"rel"),c[e]=l,d.push(e);var h=!1;for(o=0,n=this.opts.buttons.length;n>o;o++)e=this.opts.buttons[o],"wcfSeparator"!==e?(l=c[e],u.appendChild(l),d.splice(d.indexOf(e),1),h&&(l.classList.add("redactor-toolbar-separator"),h=!1)):h=!0;for(o=0,n=u.childElementCount;n>o;o++)l=u.children[o],t=l.children[0],elData(l,"show-on-mobile",-1!==this.opts.woltlab.buttonMobile.indexOf(t.rel));d.forEach(function(t){u.appendChild(c[t])}),WCF.DOMNodeInsertedHandler.execute(),require(["Ui/Screen"],function(t){t.on("screen-xs",{match:this.WoltLabButton._enableToggleButton.bind(this),unmatch:this.WoltLabButton._disableToggleButton.bind(this),setup:this.WoltLabButton._setupToggleButton.bind(this)})}.bind(this))},_handleCustomButton:function(t){var e={cancel:!1};if(WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","bbcode_"+t+"_"+this.$element[0].id,e),e.cancel!==!0){this.buffer.set();var o="["+t+"]"+this.selection.html()+(this.selection.is()?"":this.marker.html())+"[/"+t+"]";this.insert.html(o),this.selection.restore()}window.setTimeout(function(){document.activeElement!==this.$editor[0]&&this.$editor[0].focus()}.bind(this),10)},_enableToggleButton:function(){null===t.parentNode&&this.$toolbar[0].appendChild(t)},_disableToggleButton:function(){null!==t.parentNode&&this.$toolbar[0].removeChild(t)},_setupToggleButton:function(){t=elCreate("li"),t.className="redactorToolbarToggle",t.innerHTML='<a href="#"><span class="icon icon16 fa-caret-down"></span></a>',elData(t,"show-on-mobile",!0);var e=t.children[0].children[0],o=function(t){t instanceof Event&&t.preventDefault(),this.$toolbar[0].classList.toggle("redactorToolbarOverride")&&document.activeElement&&document.activeElement!==this.$editor[0]&&document.activeElement.blur(),e.classList.toggle("fa-caret-down"),e.classList.toggle("fa-caret-up")}.bind(this);t.children[0].addEventListener("mousedown",o),this.$toolbar[0].appendChild(t),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+this.$element[0].id,function(){this.$toolbar[0].classList.contains("redactorToolbarOverride")&&o()}.bind(this))}}};
 // WoltLabCaret.js
 $.Redactor.prototype.WoltLabCaret=function(){"use strict";return{init:function(){var e=this.caret.after;this.caret.after=function(t){t=this.caret.prepare(t),this.utils.isBlockTag(t.tagName)&&this.WoltLabCaret._addParagraphAfterBlock(t),e.call(this,t)}.bind(this);var t=this.caret.end;this.caret.end=function(e){if(e=this.caret.prepare(e),e.nodeType===Node.ELEMENT_NODE&&e.lastChild&&"P"===e.lastChild.nodeName){var n=window.getSelection(),i=document.createRange();return i.selectNodeContents(e.lastChild),i.collapse(!1),n.removeAllRanges(),void n.addRange(i)}return t.call(this,e)}.bind(this),this.$editor[0].addEventListener(WCF_CLICK_EVENT,this.WoltLabCaret._handleEditorClick.bind(this)),this.WoltLabCaret._initInternalRange()},paragraphAfterBlock:function(e){var t=e.nextElementSibling;t&&"P"!==t.nodeName&&(t=elCreate("p"),t.textContent="​",e.parentNode.insertBefore(t,e.nextSibling)),this.caret.after(e)},endOfEditor:function(){var e=this.core.editor()[0];document.activeElement!==e&&e.focus();var t=e.lastElementChild;"P"===t.nodeName?this.caret.end(t):this.caret.after(t)},_initInternalRange:function(){var e=this.core.editor()[0],t=null,n=window.getSelection(),i=function(){t=n.rangeCount?n.getRangeAt(0).cloneRange():null},r=function(){if(null!==t){if(document.activeElement===e){var i=n.getRangeAt(0);if(0!==i.startOffset)return;for(var r=i.startContainer;r;){if(r.parentNode===e){if(r.previousSibling)return;break}if(r.previousSibling)return;r=r.parentNode}if(!r)return}e.focus(),n.removeAllRanges(),n.addRange(t),t=null}};e.addEventListener("keyup",i),e.addEventListener("mouseup",function(){n.rangeCount&&i()});var a=this.selection.save;this.selection.save=function(){t=null,a.call(this)}.bind(this);var o=this.selection.restore;this.selection.restore=function(){t&&null===elBySel(".redactor-selection-marker",this.$editor[0])&&(r(),n.rangeCount&&this.utils.isRedactorParent(n.getRangeAt(0).commonAncestorContainer))||o.call(this)}.bind(this);var s=this.buffer.set;this.buffer.set=function(t){if(document.activeElement!==e){var n=window.getSelection();n.rangeCount&&this.utils.isRedactorParent(n.anchorNode)!==!1?e.focus():r()}s.call(this,t),i()}.bind(this);var l=this.insert.html;this.insert.html=function(e,t){var n=elBySel(".redactor-selection-marker",this.$editor[0]);l.call(this,e,t),(n||null===elBySel(".redactor-selection-marker",this.$editor[0]))&&i()}.bind(this),require(["Environment"],function(t){"ios"===t.platform()&&(e.addEventListener("focus",function(){document.addEventListener("selectionchange",i)}),e.addEventListener("blur",function(){document.removeEventListener("selectionchange",i)}))}.bind(this))},_handleEditorClick:function(e){if(this.selection.get().isCollapsed){var t=this.selection.block();if(t===!1){if(this.selection.current()===this.$editor[0]){var n=this.$editor[0].childNodes[this.selection.get().anchorOffset];n.nodeType===Node.ELEMENT_NODE&&"TABLE"===n.nodeName&&(t=n)}if(t===!1)return}for(var i=e.target;i&&!this.utils.isBlockTag(i.nodeName);)i=i.parentNode;if(i&&i!==t&&("P"!==t.nodeName||(t=t.parentNode,t!==this.$editor[0]&&this.utils.isBlockTag(t.nodeName)))){if("TD"===t.nodeName)for(;"TABLE"!==t.nodeName;)t=t.parentNode;if(!t.nodeName.match(/^H\d$/)&&!$(t).closest("ol, ul",this.$editor[0]).length){for(var r,a,o=t;o;){if(a=o.getBoundingClientRect(),e.clientY<a.top)r=!0,t=o;else{if(!(e.clientY>a.bottom))break;r=!1,t=o}if(!o.parentNode||o.parentNode===this.$editor[0])break;o=o.parentNode}var s=t[(r?"previous":"next")+"ElementSibling"];if(s&&"P"===s.nodeName)return void this.caret.end(s);this.buffer.set();var l=elCreate("p");l.textContent="​",t.parentNode.insertBefore(l,r?t:t.nextSibling),this.caret.end(l)}}}},_addParagraphAfterBlock:function(e){var t=e.nextElementSibling;(!t||"P"!==t.nodeName&&!this.utils.isBlockTag(t.nodeName))&&(t=elCreate("p"),t.textContent="​",e.parentNode.insertBefore(t,e.nextSibling))}}};
 // WoltLabClean.js
index 06d66b00abca9142882df2383164e88f167da3aa..687c57d65dc0bebded0ebc83b28c76de93a34304 100755 (executable)
@@ -93,7 +93,7 @@ this._className){var l=this._container.find(".formSubmit");if(!l.length&&(l=this
 (function (window, undefined) {"use strict";WCF.Location={},WCF.Location.Util={getLocation:function(t,e){var o=WCF.Location.GoogleMaps.Settings.get("accessUserLocation");navigator.geolocation&&null!==o&&o?navigator.geolocation.getCurrentPosition(function(e){t(e.coords.latitude,e.coords.longitude)},function(){t(void 0,void 0)},{timeout:e||5e3}):t(void 0,void 0)}},WCF.Location.GoogleMaps={},WCF.Location.GoogleMaps.Settings={_settings:{},get:function(t){return void 0===t?this._settings:void 0!==this._settings[t]?this._settings[t]:null},set:function(t,e){if($.isPlainObject(t))for(var o in t)this._settings[o]=t[o];else this._settings[t]=e}},WCF.Location.GoogleMaps.Map=Class.extend({_map:null,_markers:[],init:function(t,e){this._mapContainer=$("#"+t),this._mapOptions=$.extend(!0,this._getDefaultMapOptions(),e),this._map=new google.maps.Map(this._mapContainer[0],this._mapOptions),this._markers=[],this._mapContainer.parents(".sidebar").length&&enquire.register("(max-width: 767px)",{setup:$.proxy(this._addSidebarMapListener,this),deferSetup:!0}),this.refresh()},_addInfoWindowEventListener:function(t,e){google.maps.event.addListener(t,"click",$.proxy(function(){e.open(this._map,t)},this))},_addSidebarMapListener:function(){$(".content > .mobileSidebarToggleButton").click($.proxy(this.refresh,this))},_getDefaultMapOptions:function(){var t={};switch(t.center=new google.maps.LatLng(WCF.Location.GoogleMaps.Settings.get("defaultLatitude"),WCF.Location.GoogleMaps.Settings.get("defaultLongitude")),t.disableDoubleClickZoom=WCF.Location.GoogleMaps.Settings.get("disableDoubleClickZoom"),t.draggable=WCF.Location.GoogleMaps.Settings.get("draggable"),WCF.Location.GoogleMaps.Settings.get("mapType")){case"map":t.mapTypeId=google.maps.MapTypeId.ROADMAP;break;case"satellite":t.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"physical":t.mapTypeId=google.maps.MapTypeId.TERRAIN;break;case"hybrid":default:t.mapTypeId=google.maps.MapTypeId.HYBRID}if(t.mapTypeControl="off"!=WCF.Location.GoogleMaps.Settings.get("mapTypeControl"),t.mapTypeControl)switch(WCF.Location.GoogleMaps.Settings.get("mapTypeControl")){case"dropdown":t.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DROPDOWN_MENU};break;case"horizontalBar":t.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR};break;default:t.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DEFAULT}}return t.scaleControl=WCF.Location.GoogleMaps.Settings.get("scaleControl"),t.scrollwheel=WCF.Location.GoogleMaps.Settings.get("scrollwheel"),t.zoom=WCF.Location.GoogleMaps.Settings.get("zoom"),t},addDraggableMarker:function(t,e){var o=new google.maps.Marker({clickable:!1,draggable:!0,map:this._map,position:new google.maps.LatLng(t,e),zIndex:1});return this._markers.push(o),o},addMarker:function(t,e,o,s,i){var a=new google.maps.Marker({map:this._map,position:new google.maps.LatLng(t,e),title:o});if(s&&a.setIcon(s),i){var n=new google.maps.InfoWindow({content:i});this._addInfoWindowEventListener(a,n),a.infoWindow=n}return this._markers.push(a),a},getMarkers:function(){return this._markers},getMap:function(){return this._map},refresh:function(){var t=this._map.getCenter();google.maps.event.trigger(this._map,"resize"),this._map.setCenter(t)},refreshBounds:function(){var t=null,e=null,o=null,s=null;for(var i in this._markers){var a=this._markers[i],n=a.getPosition().lat(),r=a.getPosition().lng();null===t?(t=e=n,o=s=r):(t>n?t=n:n>e&&(e=n),o>n?o=n:r>s&&(s=r))}this._map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(t,o),new google.maps.LatLng(e,s)))},removeMarkers:function(){for(var t in this._markers)this._markers[t].setMap(null);this._markers=[]},setBounds:function(t,e){this._map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(e.latitude,e.longitude),new google.maps.LatLng(t.latitude,t.longitude)))},setCenter:function(t,e){this._map.setCenter(new google.maps.LatLng(t,e))}}),WCF.Location.GoogleMaps.LargeMap=WCF.Location.GoogleMaps.Map.extend({_actionClassName:null,_additionalParameters:{},_locationSearch:null,_locationSearchInputSelector:null,_markerClusterer:null,_objectIDs:[],_previousNorthEast:null,_previousSouthWest:null,init:function(t,e,o,s,i){this._super(t,e),this._actionClassName=o,this._locationSearchInputSelector=s||"",this._additionalParameters=i||{},this._objectIDs=[],this._locationSearchInputSelector&&(this._locationSearch=new WCF.Location.GoogleMaps.LocationSearch(s,$.proxy(this._centerMap,this))),this._markerClusterer=new MarkerClusterer(this._map,this._markers,{maxZoom:17,imagePath:WCF.Location.GoogleMaps.Settings.get("markerClustererImagePath")+"m"}),this._markerSpiderfier=new OverlappingMarkerSpiderfier(this._map,{keepSpiderfied:!0,markersWontHide:!0,markersWontMove:!0}),this._markerSpiderfier.addListener("click",$.proxy(function(t){t.infoWindow&&t.infoWindow.open(this._map,t)},this)),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._previousNorthEast=null,this._previousSouthWest=null,google.maps.event.addListener(this._map,"idle",$.proxy(this._loadMarkers,this))},_addInfoWindowEventListener:function(){},_centerMap:function(t){this.setCenter(t.location.lat(),t.location.lng()),$(this._locationSearchInputSelector).val(t.label)},_loadMarkers:function(){var t=this._map.getBounds().getNorthEast(),e=this._map.getBounds().getSouthWest();return this._previousNorthEast&&this._previousNorthEast.lat()>=t.lat()&&this._previousNorthEast.lng()>=t.lng()&&this._previousSouthWest.lat()<=e.lat()&&this._previousSouthWest.lng()<=e.lng()?!1:(this._previousNorthEast=t,this._previousSouthWest=e,this._proxy.setOption("data",{actionName:"getMapMarkers",className:this._actionClassName,parameters:$.extend(this._additionalParameters,{excludedObjectIDs:this._objectIDs,eastLongitude:t.lng(),northLatitude:t.lat(),southLatitude:e.lat(),westLongitude:e.lng()})}),this._proxy.sendRequest(),!0)},_success:function(t){if(t.returnValues&&t.returnValues.markers)for(var e in t.returnValues.markers){var o=t.returnValues.markers[e];this.addMarker(o.latitude,o.longitude,o.title,null,o.infoWindow),o.objectID?this._objectIDs.push(o.objectID):o.objectIDs&&(this._objectIDs=this._objectIDs.concat(o.objectIDs))}},addMarker:function(t,e,o,s,i){var a=this._super(t,e,o,s,i);return this._markerClusterer.addMarker(a),this._markerSpiderfier.addMarker(a),a}}),WCF.Location.GoogleMaps.SuggestionMap=WCF.Location.GoogleMaps.LargeMap.extend({_locationSuggestionsButton:null,_suggestionSelectionCallback:null,init:function(t,e,o,s,i){this._super(t,e,o,s,i);var a=$('<div class="gmnoprint googleMapsCustomControlContainer"><div class="gm-style-mtc"><div class="googleMapsCustomControl">'+WCF.Language.get("wcf.map.showLocationSuggestions")+"</div></div></div>");this._locationSuggestionsButton=a.find(".googleMapsCustomControl").click($.proxy(this._toggleLocationSuggestions,this)),this._map.controls[google.maps.ControlPosition.TOP_RIGHT].push(a.get(0))},_loadMarkers:function(){this._locationSuggestionsButton.hasClass("active")&&(this._super()||(this._loadSuggestions=!1))},_success:function(t,e,o){var s=this._markers.length;this._super(t,e,o),this._loadSuggestions&&s==this._markers.length&&(this._loadSuggestions=!1,new WCF.System.Notification(WCF.Language.get("wcf.map.noLocationSuggestions"),"info").show())},_toggleLocationSuggestions:function(){var t=!this._locationSuggestionsButton.hasClass("active");t&&(this._loadSuggestions=!0),this.showSuggestions(t)},addMarker:function(t,e,o,s,i){var a=$(i),n=$('<a class="googleMapsUseLocationSuggestionLink" />').text(WCF.Language.get("wcf.map.useLocationSuggestion")).click(this._suggestionSelectionCallback);a.append($("<p />").append(n));var r=this._super(t,e,o,"//mt.google.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png",a.get(0));return n.data("marker",r),r},setSuggestionSelectionCallback:function(t){this._suggestionSelectionCallback=t},showSuggestions:function(t){void 0===t&&(t=!0),this._locationSuggestionsButton.toggleClass("active",t);for(var e=[],o=0,s=this._markers.length;s>o;o++){var i=this._markers[o];i.draggable||(i.setVisible(t),t&&e.push(i))}this._markerClusterer.clearMarkers(),t&&this._markerClusterer.addMarkers(e),this._loadMarkers()}}),WCF.Location.GoogleMaps.LocationSearch=WCF.Search.Base.extend({_geocoder:null,init:function(t,e,o,s,i){this._super(t,e,o,s,i),this.setDelay(500),this._geocoder=new google.maps.Geocoder},_createListItem:function(t){var e=$("<li><span>"+WCF.String.escapeHTML(t.formatted_address)+"</span></li>").appendTo(this._list);return e.data("location",t.geometry.location).data("label",t.formatted_address).click($.proxy(this._executeCallback,this)),this._itemCount++,e},_keyUp:function(t){switch(t.which){case $.ui.keyCode.LEFT:case $.ui.keyCode.RIGHT:return;case $.ui.keyCode.UP:return void this._selectPreviousItem();case $.ui.keyCode.DOWN:return void this._selectNextItem();case $.ui.keyCode.ENTER:return this._selectElement(t)}var e=this._getSearchString(t);""===e?this._clearList(!0):e.length>=this._triggerLength?this._delay?(null!==this._timer&&this._timer.stop(),this._timer=new WCF.PeriodicalExecuter($.proxy(function(){this._geocoder.geocode({address:e},$.proxy(this._success,this)),this._timer.stop(),this._timer=null},this),this._delay)):this._geocoder.geocode({address:e},$.proxy(this._success,this)):this._clearList(!1)},_success:function(t,e){if(this._clearList(!1),e==google.maps.GeocoderStatus.OK){if($.getLength(t)){var o=0;for(var s in t)if(this._createListItem(t[s]),10==++o)break}else if(!this._handleEmptyResult())return;WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var i=this._searchInput.parents(".dropdown").wcfIdentify();WCF.Dropdown.getDropdownMenu(i).hasClass("dropdownOpen")||WCF.Dropdown.toggleDropdown(i),this._itemIndex=-1,WCF.Dropdown.getDropdown(i).data("disableAutoFocus")||this._selectNextItem()}}}),WCF.Location.GoogleMaps.LocationInput=Class.extend({_locationSearch:null,_map:null,_marker:null,init:function(t,e,o,s,i,a){this._searchInput=o,a?(this._map=new WCF.Location.GoogleMaps.SuggestionMap(t,e,a),this._map.setSuggestionSelectionCallback($.proxy(this._useSuggestion,this))):this._map=new WCF.Location.GoogleMaps.Map(t,e),this._locationSearch=new WCF.Location.GoogleMaps.LocationSearch(o,$.proxy(this._setMarkerByLocation,this)),s&&i?this._marker=this._map.addDraggableMarker(s,i):(this._marker=this._map.addDraggableMarker(WCF.Location.GoogleMaps.Settings.get("defaultLatitude"),WCF.Location.GoogleMaps.Settings.get("defaultLongitude")),WCF.Location.Util.getLocation($.proxy(function(t,e){void 0!==t&&void 0!==e&&(WCF.Location.GoogleMaps.Util.moveMarker(this._marker,t,e),WCF.Location.GoogleMaps.Util.focusMarker(this._marker))},this))),this._marker.addListener("dragend",$.proxy(this._updateLocation,this))},_useSuggestion:function(t){var e=$(t.currentTarget).data("marker");this._marker.setPosition(e.getPosition()),this._updateLocation(),this._map.showSuggestions(!1)},_updateLocation:function(){WCF.Location.GoogleMaps.Util.reverseGeocoding($.proxy(function(t){null!==t&&$(this._searchInput).val(t)},this),this._marker)},_setMarkerByLocation:function(t){this._marker.setPosition(t.location),WCF.Location.GoogleMaps.Util.focusMarker(this._marker),$(this._searchInput).val(t.label)},getMap:function(){return this._map},getMarker:function(){return this._marker}}),WCF.Location.GoogleMaps.Util={_geocoder:null,focusMarker:function(t){t.getMap().setCenter(t.getPosition())},getMarkerPosition:function(t){return{latitude:t.getPosition().lat(),longitude:t.getPosition().lng()}},moveMarker:function(t,e,o,s){t.setPosition(new google.maps.LatLng(e,o)),s&&google.maps.event.trigger(t,"dragend")},reverseGeocoding:function(t,e,o,s,i){e&&(o=e.getPosition().lat(),s=e.getPosition().lng()),null===this._geocoder&&(this._geocoder=new google.maps.Geocoder);var a=new google.maps.LatLng(o,s);this._geocoder.geocode({latLng:a},function(e,o){t(o==google.maps.GeocoderStatus.OK?i?e:e[0].formatted_address:null)})}}; })(this);
 
 // WCF.Message.js
-(function (window, undefined) {"use strict";WCF.Message={},WCF.Message.BBCode={},WCF.Message.BBCode.CodeViewer=Class.extend({_dialog:null,init:function(){this._dialog=null,this._initCodeBoxes(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.BBCode.CodeViewer",$.proxy(this._initCodeBoxes,this)),WCF.DOMNodeInsertedHandler.execute()},_initCodeBoxes:function(){$(".codeBox:not(.jsCodeViewer)").each($.proxy(function(e,t){var i=$(t).addClass("jsCodeViewer");$('<span class="codeBoxPlainSource icon icon24 fa-files-o pointer jsTooltip" title="'+WCF.Language.get("wcf.message.bbcode.code.copy")+'" />').appendTo(i.find(".codeBoxHeader")).click($.proxy(this._click,this))},this))},_click:function(e){var t="";$(e.currentTarget).parents("div").next("ol").children("li").each(function(e,i){t&&(t+="\n"),t+=$(i).text().replace(/\n+$/,"")}),null===this._dialog?(this._dialog=$('<div><textarea cols="60" rows="12" readonly></textarea></div>').hide().appendTo(document.body),this._dialog.children("textarea").val(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.bbcode.code.copy")})):(this._dialog.children("textarea").val(t),this._dialog.wcfDialog("open"));var i=this._dialog.children("textarea")[0],s=function(){i.selectionStart=0,i.selectionEnd=i.value.length};i.addEventListener("mouseup",s),window.setTimeout(s,10)}}),WCF.Message.EditHistory=Class.extend({_oldIDInputs:null,_newIDInputs:null,_containerSelector:"",_buttonSelector:".jsRevertButton",init:function(e,t,i,s){this._oldIDInputs=e,this._newIDInputs=t,this._containerSelector=i,this._buttonSelector=s?s:".jsRevertButton",this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initInputs(),this._initElements()},_initInputs:function(){var e=this;this._newIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._oldIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),e>=t?$(this).disable():$(this).enable()})}),this._oldIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._newIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),t>=e?$(this).disable():$(this).enable()})}),this._oldIDInputs.filter(":checked").change(),this._newIDInputs.filter(":checked").change()},_initElements:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i);s.find(e._buttonSelector).click($.proxy(e._click,e))})},_click:function(e){var t=$(e.currentTarget);if(e.preventDefault(),t.data("confirmMessage")){var i=this;WCF.System.Confirmation.show(t.data("confirmMessage"),function(e){"cancel"!==e&&i._sendRequest(t)},void 0,void 0,!0)}else this._sendRequest(t)},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"revert",className:"wcf\\data\\edit\\history\\entry\\EditHistoryEntryAction",objectIDs:[$(e).data("objectID")]}),this.proxy.sendRequest()},_success:function(){window.location.reload(!0)}}),WCF.Message.FormGuard=Class.extend({init:function(){var e=$("form.jsFormGuard").removeClass("jsFormGuard").submit(function(){$(this).find(".formSubmit input[type=submit]").disable()});$(window).on("unload",function(){e.find(".formSubmit input[type=submit]").enable()})}}),WCF.Message.Preview=Class.extend({_className:"",_messageFieldID:"",_messageField:null,_proxy:null,_previewButton:null,_previewButtonLabel:"",init:function(e,t,i){return this._className=e,this._messageFieldID=$.wcfEscapeID(t),this._textarea=$("#"+this._messageFieldID),this._textarea.length?(i=$.wcfEscapeID(i),this._previewButton=$("#"+i),this._previewButton.length?(this._previewButton.click($.proxy(this._click,this)),void(this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}))):void console.debug("[WCF.Message.Preview] Unable to find preview button identified by '"+i+"'")):void console.debug("[WCF.Message.Preview] Unable to find message field identified by '"+this._messageFieldID+"'")},_click:function(e){var t=this._getMessage();return null===t?void console.debug("[WCF.Message.Preview] Unable to access Redactor instance of '"+this._messageFieldID+"'"):(this._proxy.setOption("data",{actionName:"getMessagePreview",className:this._className,parameters:this._getParameters(t)}),this._proxy.sendRequest(),this._previewButtonLabel=this._previewButton.html(),this._previewButton.html(WCF.Language.get("wcf.global.loading")).disable(),e.stopPropagation(),!1)},_getParameters:function(e){var t={};return $("#settings_"+this._messageFieldID).find("input[type=checkbox]").each(function(e,i){var s=$(i);s.is(":checked")&&(t[s.prop("name")]=s.prop("value"))}),{data:{message:e},options:t}},_getMessage:function(){return this._textarea.redactor("code.get")},_success:function(e){this._previewButton.html(this._previewButtonLabel).enable(),this._textarea.parent().children("small.innerError").remove(),this._handleResponse(e)},_handleResponse:function(){},_failure:function(e){if(null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;this._previewButton.html(this._previewButtonLabel).enable();var t=this._textarea.parent().children("small.innerError").empty();return t.length||(t=$('<small class="innerError" />').appendTo(this._textarea.parent())),t.html("empty"===e.returnValues.errorType?WCF.Language.get("wcf.global.form.error.empty"):e.returnValues.errorMessage),!1}}),WCF.Message.DefaultPreview=WCF.Message.Preview.extend({_dialog:null,_options:{},init:function(e){if(arguments.length>1&&"string"==typeof e)throw new Error("Outdated API call, please update your implementation.");if(this._options=$.extend({disallowedBBCodesPermission:"user.message.disallowedBBCodes",messageFieldID:"",previewButtonID:"",messageObjectType:"",messageObjectID:0},e),!this._options.messageObjectType)throw new Error("Field 'messageObjectType' cannot be empty.");this._super("wcf\\data\\bbcode\\MessagePreviewAction",this._options.messageFieldID,this._options.previewButtonID)},_handleResponse:function(e){require(["WoltLabSuite/Core/Ui/Dialog"],function(t){t.open(this,'<div class="htmlContent">'+e.returnValues.message+"</div>")}.bind(this))},_getParameters:function(e){var t=this._super(e);for(var i in this._options)this._options.hasOwnProperty(i)&&"messageFieldID"!==i&&"previewButtonID"!==i&&(t[i]=this._options[i]);return t},_dialogSetup:function(){return{id:"messagePreview",options:{title:WCF.Language.get("wcf.global.preview")},source:null}}}),WCF.Message.Multilingualism=Class.extend({_availableLanguages:{},_languageID:0,_languageInput:null,init:function(e,t,i){if(this._availableLanguages=t,this._languageID=e||0,this._languageInput=$("#languageID"),this._updateLabel(),this._languageInput.find(".dropdownMenu > li").click($.proxy(this._click,this)),!i){var s=this._languageInput.find(".dropdownMenu");$('<li class="dropdownDivider" />').appendTo(s),$('<li><span><span class="badge">'+this._availableLanguages[0]+"</span></span></li>").click($.proxy(this._disable,this)).appendTo(s)}this._languageInput.parents("form").submit($.proxy(this._submit,this))},_click:function(e){this._languageID=$(e.currentTarget).data("languageID"),this._updateLabel()},_disable:function(){this._languageID=0,this._updateLabel()},_updateLabel:function(){this._languageInput.find(".dropdownToggle > span").text(this._availableLanguages[this._languageID])},_submit:function(){this._languageInput.next("input[name=languageID]").prop("value",this._languageID)}}),WCF.Message.SmileyCategories=Class.extend({_cache:[],_proxy:null,_wysiwygSelector:"",init:function(e){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._wysiwygSelector=e,$("#smilies-"+this._wysiwygSelector).on("messagetabmenushow",$.proxy(this._click,this))},_click:function(e,t){e.preventDefault();var i=parseInt(t.activeTab.tab.data("smileyCategoryID"));if(i&&!t.activeTab.container.children("ul.smileyList").length){if(void 0!==this._cache[i])return void t.activeTab.container.html(this._cache[i]);this._proxy.setOption("data",{actionName:"getSmilies",className:"wcf\\data\\smiley\\category\\SmileyCategoryAction",objectIDs:[i]}),this._proxy.sendRequest()}},_success:function(e){var t=parseInt(e.returnValues.smileyCategoryID);this._cache[t]=e.returnValues.template,$("#smilies-"+this._wysiwygSelector+"-"+t).html(e.returnValues.template)}}),WCF.Message.Smilies=Class.extend({_editorId:"",init:function(e){this._editorId=e,$(".messageTabMenu[data-wysiwyg-container-id="+this._editorId+"]").on("mousedown",".jsSmiley",this._smileyClick.bind(this))},_smileyClick:function(e){e.preventDefault(),require(["EventHandler"],function(t){t.fire("com.woltlab.wcf.redactor2","insertSmiley_"+this._editorId,{img:e.currentTarget.children[0]})}.bind(this))}}),WCF.Message.InlineEditor=Class.extend({_container:{},_containerID:0,_dropdowns:{},_messageContainerSelector:".jsMessage",_messageEditorIDPrefix:"messageEditor",init:function(e){require(["WoltLabSuite/Core/Ui/Message/InlineEditor"],function(t){new t({className:this._getClassName(),containerId:e,editorPrefix:this._messageEditorIDPrefix,messageSelector:this._messageContainerSelector,callbackDropdownInit:this._callbackDropdownInit.bind(this)})}.bind(this))},_click:function(e,t){t=null===e?~~t:~~elData(e.currentTarget,"container-id"),require(["WoltLabSuite/Core/Ui/Message/InlineEditor"],function(e){e.legacyEdit(t)}.bind(this)),e&&e.preventDefault()},_initDropdownMenu:function(){},_callbackDropdownInit:function(e,t){return this._initDropdownMenu($(e).wcfIdentify(),$(t)),null},_getClassName:function(){return""}}),WCF.Message.Submit={_buttons:{},registerButton:function(e,t){WCF.Browser.isChrome()&&(this._buttons[e]=$(t))},execute:function(e){this._buttons[e]&&this._buttons[e].trigger("click")}},WCF.Message.Quote={},WCF.Message.Quote.Handler=Class.extend({_activeContainerID:"",_className:"",_containers:{},_containerSelector:"",_copyQuote:null,_message:"",_messageBodySelector:"",_objectID:0,_objectType:"",_proxy:null,_quoteManager:null,init:function(e,t,i,s,a,n,o){return this._className=t,""==this._className?void console.debug("[WCF.Message.QuoteManager] Empty class name given, aborting."):(this._objectType=i,""==this._objectType?void console.debug("[WCF.Message.QuoteManager] Empty object type name given, aborting."):(this._containerSelector=s,this._message="",this._messageBodySelector=a,this._messageContentSelector=n,this._objectID=0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initContainers(),o=o&&e.supportPaste()?!0:!1,this._initCopyQuote(o),$(document).mouseup($.proxy(this._mouseUp,this)),this._quoteManager=e,this._quoteManager.register(this._objectType,this),void WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Quote.Handler"+i.hashCode(),$.proxy(this._initContainers,this))))},_initContainers:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i),a=s.wcfIdentify();if(!e._containers[a]){if(e._containers[a]=s,s.hasClass("jsInvalidQuoteTarget"))return!0;e._messageBodySelector&&s.data("body",s.find(e._messageBodySelector).data("containerID",a)),s.mousedown($.proxy(e._mouseDown,e)),e._containers[a].find(".jsQuoteMessage").click($.proxy(e._saveFullQuote,e))}})},_mouseDown:function(e){this._copyQuote.removeClass("active"),this._activeContainerID=e.currentTarget.classList.contains("jsInvalidQuoteTarget")?"":e.currentTarget.id},_getNodeText:function(e){var t=function(e){switch(e.tagName){case"BLOCKQUOTE":case"IMG":case"SCRIPT":return NodeFilter.FILTER_REJECT;default:return NodeFilter.FILTER_ACCEPT}};t.acceptNode=t;for(var i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,t,!0),s="";i.nextNode();){var a=i.currentNode;if(a.nodeType===Node.ELEMENT_NODE)switch(a.tagName){case"BR":case"LI":case"UL":s+="\n";break;case"TD":$.browser.msie||(s+="\n");break;case"P":s+="\n\n"}else s+=a.nodeValue.replace(/\n/g,"")}return s},_mouseUp:function(){if(""===this._activeContainerID)return void this._copyQuote.removeClass("active");var e=window.getSelection();if(1!==e.rangeCount||e.isCollapsed)return void this._copyQuote.removeClass("active");var t=this._containers[this._activeContainerID],i=t.data("objectID");t=t.data("body")||t;for(var s=e.anchorNode;s&&s!==t[0];)s=s.parentNode;if(s!==t[0])return void this._copyQuote.removeClass("active");var a=this._getSelectedText(),n=$.trim(a);if(""==n)return void this._copyQuote.removeClass("active");var o=e.getRangeAt(0),r=o.startContainer.nodeType===Node.TEXT_NODE?o.startContainer.parentNode:o.startContainer,l=o.endContainer.nodeType===Node.TEXT_NODE?o.endContainer.parentNode:o.endContainer;if(r.closest("blockquote")||l.closest("blockquote"))return void this._copyQuote.removeClass("active");var c=this._getNodeText(t[0]);if(-1!==this._normalize(c).indexOf(this._normalize(n))){this._copyQuote.addClass("active");var u=this._getBoundingRectangle(t,window.getSelection()),d=this._copyQuote.getDimensions("outer"),h=(u.right-u.left)/2-d.width/2+u.left;this._copyQuote.css({top:u.top-d.height-7+"px",left:h+"px"}),this._copyQuote.removeClass("active"),this._activeContainerID="";var _=this;window.setTimeout(function(){var e=$.trim(_._getSelectedText());""!=e&&(_._copyQuote.addClass("active"),_._message=e,_._objectID=i)},10)}},_normalize:function(e){return e.replace(/\r?\n|\r/g,"\n").replace(/\s/g," ").replace(/\s{2,}/g," ")},_getBoundingRectangle:function(e,t){var i=null;if(t.rangeCount>0){var s=t.getRangeAt(0).getBoundingClientRect();i={left:s.left,right:s.right,top:s.top+$(document).scrollTop()}}return i},_initCopyQuote:function(e){if(this._copyQuote=$("#quoteManagerCopy"),!this._copyQuote.length){this._copyQuote=$('<div id="quoteManagerCopy" class="balloonTooltip interactive"><span class="jsQuoteManagerStore">'+WCF.Language.get("wcf.message.quote.quoteSelected")+"</span></div>").appendTo(document.body);var t=this._copyQuote.children("span.jsQuoteManagerStore").click($.proxy(this._saveQuote,this));e&&$('<span class="jsQuoteManagerQuoteAndInsert">'+WCF.Language.get("wcf.message.quote.quoteAndReply")+"</span>").click($.proxy(this._saveAndInsertQuote,this)).insertAfter(t)}},_getSelectedText:function(){var e=window.getSelection();return e.rangeCount?this._getNodeText(e.getRangeAt(0).cloneContents()):""},_saveFullQuote:function(e){e.preventDefault();var t=$(e.currentTarget);this._proxy.setOption("data",{actionName:"saveFullQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[t.data("objectID")]}),this._proxy.sendRequest(),t.data("isQuoted")?t.data("isQuoted",!1).children("a").removeClass("active"):t.data("isQuoted",!0).children("a").addClass("active");var i=t.parents(".buttonGroupNavigation");i.hasClass("jsMobileButtonGroupNavigation")&&i.children(".dropdownLabel").trigger("click")},_saveQuote:function(e){this._proxy.setOption("data",{actionName:"saveQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[this._objectID],parameters:{message:this._message,renderQuote:e===!0}}),this._proxy.sendRequest()},_saveAndInsertQuote:function(){this._saveQuote(!0)},_success:function(e){if(void 0!==e.returnValues.count){void 0!==e.returnValues.fullQuoteMessageIDs&&(e.returnValues.fullQuoteObjectIDs=e.returnValues.fullQuoteMessageIDs);var t=void 0!==e.returnValues.fullQuoteObjectIDs?e.returnValues.fullQuoteObjectIDs:{};this._quoteManager.updateCount(e.returnValues.count,t)}switch(e.actionName){case"saveQuote":case"saveFullQuote":e.returnValues.renderedQuote&&WCF.System.Event.fireEvent("com.woltlab.wcf.message.quote","insert",{forceInsert:"saveQuote"===e.actionName,quote:e.returnValues.renderedQuote})}},updateFullQuoteObjectIDs:function(e){for(var t in this._containers)this._containers[t].find(".jsQuoteMessage").each(function(t,i){var s=$(i).data("isQuoted",0);s.children("a").removeClass("active"),WCF.inArray(s.data("objectID"),e)&&s.data("isQuoted",1).children("a").addClass("active")})}}),WCF.Message.Quote.Manager=Class.extend({_buttons:{},_count:0,_dialog:null,_editorId:"",_editorIdAlternative:"",_form:null,_handlers:{},_hasTemplate:!1,_insertQuotes:!0,_proxy:null,_removeOnSubmit:[],_supportPaste:!1,init:function(e,t,i,s){if(this._buttons={insert:null,remove:null},this._count=parseInt(e)||0,this._dialog=null,this._editorId="",this._editorIdAlternative="",this._form=null,this._handlers={},this._hasTemplate=!1,this._insertQuotes=!0,this._removeOnSubmit=[],this._supportPaste=!1,t){var a=$("#"+t);a.length&&(this._editorId=t,this._supportPaste=!0,this._form=a.parents("form:eq(0)"),this._form.length?(this._form.submit(this._submit.bind(this)),this._removeOnSubmit=s||[]):(this._form=null,this._supportPaste=i===!0))}this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this),url:"index.php?message-quote/&t="+SECURITY_TOKEN}),this._toggleShowQuotes(),WCF.System.Event.addListener("com.woltlab.wcf.quote","reload",this.countQuotes.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.message.quote","insert",function(e){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","insertQuote_"+(this._editorIdAlternative?this._editorIdAlternative:this._editorId),{author:e.quote.username,content:e.quote.text,isText:!e.quote.isFullQuote,link:e.quote.link})}.bind(this))},setAlternativeEditor:function(e){"object"==typeof e&&(e=e[0].id),this._editorIdAlternative=e},clearAlternativeEditor:function(){this._editorIdAlternative=""},register:function(e,t){this._handlers[e]=t},updateCount:function(e,t){this._count=parseInt(e)||0,this._toggleShowQuotes();for(var i in this._handlers)if(this._handlers.hasOwnProperty(i)){var s=t[i]||[];this._handlers[i].updateFullQuoteObjectIDs(s)}},insertQuotes:function(e,t,i){return this._insertQuotes?void new WCF.Action.Proxy({autoSend:!0,data:{actionName:"getRenderedQuotes",className:e,interfaceName:"wcf\\data\\IMessageQuoteAction",parameters:{parentObjectID:t}},success:i}):void(this._insertQuotes=!0)},_toggleShowQuotes:function(){require(["WoltLabSuite/Core/Ui/Page/Action"],function(e){var t="showQuotes";if(this._count){var i=e.get(t);void 0===i&&(i=elCreate("a"),i.addEventListener("mousedown",this._click.bind(this)),e.add(t,i)),i.textContent=WCF.Language.get("wcf.message.quote.showQuotes").replace(/#count#/,this._count),e.show(t)}else e.hide(t);this._hasTemplate=!1}.bind(this))},_click:function(){var e=document.activeElement;e.classList.contains("redactor-editor")&&$("#"+elData(e,"element-id")).redactor("selection.save"),this._hasTemplate?this._dialog.wcfDialog("open"):(this._proxy.showLoadingOverlayOnce(),this._proxy.setOption("data",{actionName:"getQuotes",supportPaste:this._supportPaste}),this._proxy.sendRequest())},renderDialog:function(e){null===this._dialog&&(this._dialog=$("#messageQuoteList"),this._dialog.length||(this._dialog=$('<div id="messageQuoteList" />').hide().appendTo(document.body))),this._dialog.html(e);var t=$('<div class="formSubmit" />').appendTo(this._dialog);this._supportPaste&&(this._buttons.insert=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.message.quote.insertAllQuotes")+"</button>").click($.proxy(this._insertSelected,this)).appendTo(t)),this._buttons.remove=$("<button>"+WCF.Language.get("wcf.message.quote.removeAllQuotes")+"</button>").click($.proxy(this._removeSelected,this)).appendTo(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.quote.manageQuotes")}),this._dialog.wcfDialog("render"),this._hasTemplate=!0;var i=this._dialog.find(".jsInsertQuote");if(this._supportPaste?i.click($.proxy(this._insertQuote,this)):i.hide(),this._dialog.find("input.jsCheckbox").change($.proxy(this._changeButtons,this)),this._removeOnSubmit.length){var s=this;this._dialog.find("input.jsRemoveQuote").each(function(e,t){var i=$(t).change($.proxy(this._change,this));WCF.inArray(i.parent("li").attr("data-quote-id"),s._removeOnSubmit)&&i.attr("checked","checked")})}},_changeButtons:function(){this._dialog.find("input.jsCheckbox:checked").length?(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertSelectedQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeSelectedQuotes"))):(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertAllQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeAllQuotes")))},_change:function(e){var t=$(e.currentTarget),i=t.parent("li").attr("data-quote-id");if(t.prop("checked"))this._removeOnSubmit.push(i);else{var s=this._removeOnSubmit.indexOf(i);-1!==s&&this._removeOnSubmit.splice(s,1)}},_insertSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked"),this._dialog.find("input.jsCheckbox:checked").each($.proxy(function(e,t){this._insertQuote(null,t)},this)),this._dialog.wcfDialog("close")},_insertQuote:function(e,t){var i=$(e?e.currentTarget:t).parents("li:eq(0)"),s=i.children(".jsFullQuote")[0].textContent.trim(),a=i.parents(".message:eq(0)"),n=a.data("username"),o=a.data("link"),r=!elDataBool(i[0],"is-full-quote");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","insertQuote_"+(this._editorIdAlternative?this._editorIdAlternative:this._editorId),{author:n,content:s,isText:r,link:o}),this._removeOnSubmit.push(i.data("quote-id")),null!==e&&this._dialog.wcfDialog("close")},_removeSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked");var e=[];if(this._dialog.find("input.jsCheckbox:checked").each(function(t,i){e.push($(i).parents("li").attr("data-quote-id"))}),e.length){var t=[];for(var i in this._handlers)this._handlers.hasOwnProperty(i)&&t.push(i);this._proxy.setOption("data",{actionName:"remove",getFullQuoteObjectIDs:this._handlers.length>0,objectTypes:t,quoteIDs:e}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}},_submit:function(){if(this._supportPaste&&this._removeOnSubmit.length>0)for(var e=this._form.find(".formSubmit"),t=0,i=this._removeOnSubmit.length;i>t;t++)$('<input type="hidden" name="__removeQuoteIDs[]" value="'+this._removeOnSubmit[t]+'" />').appendTo(e)},getQuotesMarkedForRemoval:function(){return this._removeOnSubmit},markQuotesForRemoval:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"markForRemoval",quoteIDs:this._removeOnSubmit}),this._proxy.suppressErrors(),this._proxy.sendRequest())},removeMarkedQuotes:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"removeMarkedQuotes",getFullQuoteObjectIDs:this._handlers.length>0}),this._proxy.sendRequest())},countQuotes:function(){var e=[];for(var t in this._handlers)this._handlers.hasOwnProperty(t)&&e.push(t);this._proxy.setOption("data",{actionName:"count",getFullQuoteObjectIDs:e.length>0,objectTypes:e}),this._proxy.sendRequest()},_success:function(e){if(null!==e){if(void 0!==e.count){var t=void 0!==e.fullQuoteObjectIDs?e.fullQuoteObjectIDs:{};this.updateCount(e.count,t)}void 0!==e.template&&(""==$.trim(e.template)?this.updateCount(0,{}):this.renderDialog(e.template))}},supportPaste:function(){return this._supportPaste}}),WCF.Message.Share={},WCF.Message.Share.Content=Class.extend({_cache:{},_dialog:null,init:function(){this._cache={},this._dialog=null,this._initLinks(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Share.Content",$.proxy(this._initLinks,this))},_initLinks:function(){$("a.jsButtonShare").removeClass("jsButtonShare").click($.proxy(this._click,this))},_click:function(e){e.preventDefault();var t=$(e.currentTarget),i=t.prop("href"),s=t.data("linkTitle")?t.data("linkTitle"):i,a=i.hashCode();if(void 0===this._cache[a]){var n=!1;null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),n=!0):this._dialog.empty();var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalink">'+WCF.Language.get("wcf.message.share.permalink")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalink" class="long" readonly />').attr("value",i).appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkBBCode">'+WCF.Language.get("wcf.message.share.permalink.bbcode")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkBBCode" class="long" readonly />').attr("value","[url='"+i+"']"+s+"[/url]").appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkHTML">'+WCF.Language.get("wcf.message.share.permalink.html")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkHTML" class="long" readonly />').attr("value",'<a href="'+i+'">'+WCF.String.escapeHTML(s)+"</a>").appendTo(o),this._cache[a]=this._dialog.html(),this._dialog.wcfDialog(n?{title:WCF.Language.get("wcf.message.share")}:"open")}else this._dialog.html(this._cache[a]).wcfDialog("open");this._enableSelection()},_enableSelection:function(){var e=this._dialog.find("input").click(function(){$(this).select()});navigator.userAgent.match(/iP(ad|hone|od)/)&&e.keydown(function(){return!1}).removeAttr("readonly").click(function(){this.setSelectionRange(0,9999)})}}),WCF.Message.Share.Page=Class.extend({init:function(){require(["WoltLabSuite/Core/Ui/Message/Share"],function(e){e.init()})}}),WCF.Message.UserMention=Class.extend({init:function(){throw new Error("Support for mentions in Redactor are now enabled by adding the attribute 'data-support-mention=\"true\"' to the textarea element.")}}),$.widget("wcf.messageTabMenu",{_tabs:[],_tabsByName:{},options:{collapsible:!0},_create:function(){var e=this.element.find("> nav"),t=e.find("> ul > li:not(.jsFlexibleMenuDropdown)"),i=this.element.find("> div, > fieldset");if(t.length!=i.length)return void console.debug("[wcf.messageTabMenu] Amount of tabs does not equal amount of tab containers, aborting.");var s=this.element.data("preselect");i.each(function(e,i){return null!==elBySel(".innerError",i)?(s=$(t[e]).data("name"),!1):void 0}),this._tabs=[],this._tabsByName={};for(var a=0;a<t.length;a++){var n=$(t[a]),o=$(i[a]),r=n.data("name");if(void 0===r){var l=n.children("a").prop("href");void 0!==l&&l.match(/#([a-zA-Z_-]+)$/)&&(r=RegExp.$1),void 0===r&&(r=n.wcfIdentify(),console.debug("[wcf.messageTabMenu] Missing name attribute, assuming generic ID '"+r+"'"))}this._tabs.push({container:o,name:r,tab:n}),this._tabsByName[r]=a;var c=n.children("a").data("index",a).click($.proxy(this._showTab,this));s==r&&c.trigger("click")}s===!0&&this._tabs.length&&!window.matchMedia("(max-width: 544px)").matches&&this._tabs[0].tab.children("a").trigger("click");var u=this.element.data("collapsible");void 0!==u&&(this.options.collapsible=u);var d=elData(this.element[0],"wysiwyg-container-id");d&&WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+d,function(){for(var e=0,t=this._tabs.length;t>e;e++)this._tabs[e].container.removeClass("active"),this._tabs[e].tab.removeClass("active")}.bind(this))},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments),this.element.remove()},_showTab:function(e,t,i){var s=null===e?t:$(e.currentTarget).data("index");i=!this.options.collapsible||i===!0;for(var a=null,n=0;n<this._tabs.length;n++){var o=this._tabs[n];if(n==s){if(!o.tab.hasClass("active")){o.tab.addClass("active"),o.container.addClass("active"),a=o;continue}if(i===!0)continue}o.tab.removeClass("active"),o.container.removeClass("active")}null!==e&&(e.preventDefault(),e.stopPropagation()),null!==a&&this._trigger("show",{},{activeTab:a}),$(window).trigger("resize")},showTab:function(e,t){return $.isNumeric(e)||void 0!==this._tabsByName[e]&&(e=this._tabsByName[e]),void 0===this._tabs[e]?void console.debug("[wcf.messageTabMenu] Cannot locate tab identified by '"+e+"'"):void this._showTab(null,e,t)},getTab:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].tab:null},getContainer:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].container:null}}); })(this);
+(function (window, undefined) {"use strict";WCF.Message={},WCF.Message.BBCode={},WCF.Message.BBCode.CodeViewer=Class.extend({_dialog:null,init:function(){this._dialog=null,this._initCodeBoxes(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.BBCode.CodeViewer",$.proxy(this._initCodeBoxes,this)),WCF.DOMNodeInsertedHandler.execute()},_initCodeBoxes:function(){$(".codeBox:not(.jsCodeViewer)").each($.proxy(function(e,t){var i=$(t).addClass("jsCodeViewer");$('<span class="codeBoxPlainSource icon icon24 fa-files-o pointer jsTooltip" title="'+WCF.Language.get("wcf.message.bbcode.code.copy")+'" />').appendTo(i.find(".codeBoxHeader")).click($.proxy(this._click,this))},this))},_click:function(e){var t="";$(e.currentTarget).parents("div").next("ol").children("li").each(function(e,i){t&&(t+="\n"),t+=$(i).text().replace(/\n+$/,"")}),null===this._dialog?(this._dialog=$('<div><textarea cols="60" rows="12" readonly></textarea></div>').hide().appendTo(document.body),this._dialog.children("textarea").val(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.bbcode.code.copy")})):(this._dialog.children("textarea").val(t),this._dialog.wcfDialog("open"));var i=this._dialog.children("textarea")[0],s=function(){i.selectionStart=0,i.selectionEnd=i.value.length};i.addEventListener("mouseup",s),window.setTimeout(s,10)}}),WCF.Message.EditHistory=Class.extend({_oldIDInputs:null,_newIDInputs:null,_containerSelector:"",_buttonSelector:".jsRevertButton",init:function(e,t,i,s){this._oldIDInputs=e,this._newIDInputs=t,this._containerSelector=i,this._buttonSelector=s?s:".jsRevertButton",this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initInputs(),this._initElements()},_initInputs:function(){var e=this;this._newIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._oldIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),e>=t?$(this).disable():$(this).enable()})}),this._oldIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._newIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),t>=e?$(this).disable():$(this).enable()})}),this._oldIDInputs.filter(":checked").change(),this._newIDInputs.filter(":checked").change()},_initElements:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i);s.find(e._buttonSelector).click($.proxy(e._click,e))})},_click:function(e){var t=$(e.currentTarget);if(e.preventDefault(),t.data("confirmMessage")){var i=this;WCF.System.Confirmation.show(t.data("confirmMessage"),function(e){"cancel"!==e&&i._sendRequest(t)},void 0,void 0,!0)}else this._sendRequest(t)},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"revert",className:"wcf\\data\\edit\\history\\entry\\EditHistoryEntryAction",objectIDs:[$(e).data("objectID")]}),this.proxy.sendRequest()},_success:function(){window.location.reload(!0)}}),WCF.Message.FormGuard=Class.extend({init:function(){var e=$("form.jsFormGuard").removeClass("jsFormGuard").submit(function(){$(this).find(".formSubmit input[type=submit]").disable()});$(window).on("unload",function(){e.find(".formSubmit input[type=submit]").enable()})}}),WCF.Message.Preview=Class.extend({_className:"",_messageFieldID:"",_messageField:null,_proxy:null,_previewButton:null,_previewButtonLabel:"",init:function(e,t,i){return this._className=e,this._messageFieldID=$.wcfEscapeID(t),this._textarea=$("#"+this._messageFieldID),this._textarea.length?(i=$.wcfEscapeID(i),this._previewButton=$("#"+i),this._previewButton.length?(this._previewButton.click($.proxy(this._click,this)),void(this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}))):void console.debug("[WCF.Message.Preview] Unable to find preview button identified by '"+i+"'")):void console.debug("[WCF.Message.Preview] Unable to find message field identified by '"+this._messageFieldID+"'")},_click:function(e){var t=this._getMessage();return null===t?void console.debug("[WCF.Message.Preview] Unable to access Redactor instance of '"+this._messageFieldID+"'"):(this._proxy.setOption("data",{actionName:"getMessagePreview",className:this._className,parameters:this._getParameters(t)}),this._proxy.sendRequest(),this._previewButtonLabel=this._previewButton.html(),this._previewButton.html(WCF.Language.get("wcf.global.loading")).disable(),e.stopPropagation(),!1)},_getParameters:function(e){var t={};return $("#settings_"+this._messageFieldID).find("input[type=checkbox]").each(function(e,i){var s=$(i);s.is(":checked")&&(t[s.prop("name")]=s.prop("value"))}),{data:{message:e},options:t}},_getMessage:function(){return this._textarea.redactor("code.get")},_success:function(e){this._previewButton.html(this._previewButtonLabel).enable(),this._textarea.parent().children("small.innerError").remove(),this._handleResponse(e)},_handleResponse:function(){},_failure:function(e){if(null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;this._previewButton.html(this._previewButtonLabel).enable();var t=this._textarea.parent().children("small.innerError").empty();return t.length||(t=$('<small class="innerError" />').appendTo(this._textarea.parent())),t.html("empty"===e.returnValues.errorType?WCF.Language.get("wcf.global.form.error.empty"):e.returnValues.errorMessage),!1}}),WCF.Message.DefaultPreview=WCF.Message.Preview.extend({_dialog:null,_options:{},init:function(e){if(arguments.length>1&&"string"==typeof e)throw new Error("Outdated API call, please update your implementation.");if(this._options=$.extend({disallowedBBCodesPermission:"user.message.disallowedBBCodes",messageFieldID:"",previewButtonID:"",messageObjectType:"",messageObjectID:0},e),!this._options.messageObjectType)throw new Error("Field 'messageObjectType' cannot be empty.");this._super("wcf\\data\\bbcode\\MessagePreviewAction",this._options.messageFieldID,this._options.previewButtonID)},_handleResponse:function(e){require(["WoltLabSuite/Core/Ui/Dialog"],function(t){t.open(this,'<div class="htmlContent">'+e.returnValues.message+"</div>")}.bind(this))},_getParameters:function(e){var t=this._super(e);for(var i in this._options)this._options.hasOwnProperty(i)&&"messageFieldID"!==i&&"previewButtonID"!==i&&(t[i]=this._options[i]);return t},_dialogSetup:function(){return{id:"messagePreview",options:{title:WCF.Language.get("wcf.global.preview")},source:null}}}),WCF.Message.Multilingualism=Class.extend({_availableLanguages:{},_languageID:0,_languageInput:null,init:function(e,t,i){if(this._availableLanguages=t,this._languageID=e||0,this._languageInput=$("#languageID"),this._updateLabel(),this._languageInput.find(".dropdownMenu > li").click($.proxy(this._click,this)),!i){var s=this._languageInput.find(".dropdownMenu");$('<li class="dropdownDivider" />').appendTo(s),$('<li><span><span class="badge">'+this._availableLanguages[0]+"</span></span></li>").click($.proxy(this._disable,this)).appendTo(s)}this._languageInput.parents("form").submit($.proxy(this._submit,this))},_click:function(e){this._languageID=$(e.currentTarget).data("languageID"),this._updateLabel()},_disable:function(){this._languageID=0,this._updateLabel()},_updateLabel:function(){this._languageInput.find(".dropdownToggle > span").text(this._availableLanguages[this._languageID])},_submit:function(){this._languageInput.next("input[name=languageID]").prop("value",this._languageID)}}),WCF.Message.SmileyCategories=Class.extend({_cache:[],_proxy:null,_wysiwygSelector:"",init:function(e){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._wysiwygSelector=e,$("#smilies-"+this._wysiwygSelector).on("messagetabmenushow",$.proxy(this._click,this))},_click:function(e,t){e.preventDefault();var i=parseInt(t.activeTab.tab.data("smileyCategoryID"));if(i&&!t.activeTab.container.children("ul.smileyList").length){if(void 0!==this._cache[i])return void t.activeTab.container.html(this._cache[i]);this._proxy.setOption("data",{actionName:"getSmilies",className:"wcf\\data\\smiley\\category\\SmileyCategoryAction",objectIDs:[i]}),this._proxy.sendRequest()}},_success:function(e){var t=parseInt(e.returnValues.smileyCategoryID);this._cache[t]=e.returnValues.template,$("#smilies-"+this._wysiwygSelector+"-"+t).html(e.returnValues.template)}}),WCF.Message.Smilies=Class.extend({_editorId:"",init:function(e){this._editorId=e,$(".messageTabMenu[data-wysiwyg-container-id="+this._editorId+"]").on("mousedown",".jsSmiley",this._smileyClick.bind(this))},_smileyClick:function(e){e.preventDefault(),require(["EventHandler"],function(t){t.fire("com.woltlab.wcf.redactor2","insertSmiley_"+this._editorId,{img:e.currentTarget.children[0]})}.bind(this))}}),WCF.Message.InlineEditor=Class.extend({_container:{},_containerID:0,_dropdowns:{},_messageContainerSelector:".jsMessage",_messageEditorIDPrefix:"messageEditor",init:function(e){require(["WoltLabSuite/Core/Ui/Message/InlineEditor"],function(t){new t({className:this._getClassName(),containerId:e,editorPrefix:this._messageEditorIDPrefix,messageSelector:this._messageContainerSelector,callbackDropdownInit:this._callbackDropdownInit.bind(this)})}.bind(this))},_click:function(e,t){t=null===e?~~t:~~elData(e.currentTarget,"container-id"),require(["WoltLabSuite/Core/Ui/Message/InlineEditor"],function(e){e.legacyEdit(t)}.bind(this)),e&&e.preventDefault()},_initDropdownMenu:function(){},_callbackDropdownInit:function(e,t){return this._initDropdownMenu($(e).wcfIdentify(),$(t)),null},_getClassName:function(){return""}}),WCF.Message.Submit={_buttons:{},registerButton:function(e,t){WCF.Browser.isChrome()&&(this._buttons[e]=$(t))},execute:function(e){this._buttons[e]&&this._buttons[e].trigger("click")}},WCF.Message.Quote={},WCF.Message.Quote.Handler=Class.extend({_activeContainerID:"",_className:"",_containers:{},_containerSelector:"",_copyQuote:null,_message:"",_messageBodySelector:"",_objectID:0,_objectType:"",_proxy:null,_quoteManager:null,init:function(e,t,i,s,a,n,o){return this._className=t,""==this._className?void console.debug("[WCF.Message.QuoteManager] Empty class name given, aborting."):(this._objectType=i,""==this._objectType?void console.debug("[WCF.Message.QuoteManager] Empty object type name given, aborting."):(this._containerSelector=s,this._message="",this._messageBodySelector=a,this._messageContentSelector=n,this._objectID=0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initContainers(),o=o&&e.supportPaste()?!0:!1,this._initCopyQuote(o),$(document).mouseup($.proxy(this._mouseUp,this)),this._quoteManager=e,this._quoteManager.register(this._objectType,this),void WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Quote.Handler"+i.hashCode(),$.proxy(this._initContainers,this))))},_initContainers:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i),a=s.wcfIdentify();if(!e._containers[a]){if(e._containers[a]=s,s.hasClass("jsInvalidQuoteTarget"))return!0;e._messageBodySelector&&s.data("body",s.find(e._messageBodySelector).data("containerID",a)),s.mousedown($.proxy(e._mouseDown,e)),e._containers[a].find(".jsQuoteMessage").click($.proxy(e._saveFullQuote,e))}})},_mouseDown:function(e){this._copyQuote.removeClass("active"),this._activeContainerID=e.currentTarget.classList.contains("jsInvalidQuoteTarget")?"":e.currentTarget.id},_getNodeText:function(e){var t=function(e){switch(e.tagName){case"BLOCKQUOTE":case"IMG":case"SCRIPT":return NodeFilter.FILTER_REJECT;default:return NodeFilter.FILTER_ACCEPT}};t.acceptNode=t;for(var i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,t,!0),s="";i.nextNode();){var a=i.currentNode;if(a.nodeType===Node.ELEMENT_NODE)switch(a.tagName){case"BR":case"LI":case"UL":s+="\n";break;case"TD":$.browser.msie||(s+="\n");break;case"P":s+="\n\n"}else s+=a.nodeValue.replace(/\n/g,"")}return s},_mouseUp:function(){if(""===this._activeContainerID)return void this._copyQuote.removeClass("active");var e=window.getSelection();if(1!==e.rangeCount||e.isCollapsed)return void this._copyQuote.removeClass("active");var t=this._containers[this._activeContainerID],i=t.data("objectID");t=t.data("body")||t;for(var s=e.anchorNode;s&&s!==t[0];)s=s.parentNode;if(s!==t[0])return void this._copyQuote.removeClass("active");var a=this._getSelectedText(),n=$.trim(a);if(""==n)return void this._copyQuote.removeClass("active");var o=e.getRangeAt(0),r=o.startContainer.nodeType===Node.TEXT_NODE?o.startContainer.parentNode:o.startContainer,l=o.endContainer.nodeType===Node.TEXT_NODE?o.endContainer.parentNode:o.endContainer;if(r.closest("blockquote")||l.closest("blockquote"))return void this._copyQuote.removeClass("active");var c=this._getNodeText(t[0]);if(-1!==this._normalize(c).indexOf(this._normalize(n))){this._copyQuote.addClass("active");var u=this._getBoundingRectangle(t,window.getSelection()),d=this._copyQuote.getDimensions("outer"),h=(u.right-u.left)/2-d.width/2+u.left;this._copyQuote.css({top:u.top-d.height-7+"px",left:h+"px"}),this._copyQuote.removeClass("active"),this._activeContainerID="";var _=this;window.setTimeout(function(){var e=$.trim(_._getSelectedText());""!=e&&(_._copyQuote.addClass("active"),_._message=e,_._objectID=i)},10)}},_normalize:function(e){return e.replace(/\r?\n|\r/g,"\n").replace(/\s/g," ").replace(/\s{2,}/g," ")},_getBoundingRectangle:function(e,t){var i=null;if(t.rangeCount>0){var s=t.getRangeAt(0).getBoundingClientRect();i={left:s.left,right:s.right,top:s.top+$(document).scrollTop()}}return i},_initCopyQuote:function(e){if(this._copyQuote=$("#quoteManagerCopy"),!this._copyQuote.length){this._copyQuote=$('<div id="quoteManagerCopy" class="balloonTooltip interactive"><span class="jsQuoteManagerStore">'+WCF.Language.get("wcf.message.quote.quoteSelected")+"</span></div>").appendTo(document.body);var t=this._copyQuote.children("span.jsQuoteManagerStore").click($.proxy(this._saveQuote,this));e&&$('<span class="jsQuoteManagerQuoteAndInsert">'+WCF.Language.get("wcf.message.quote.quoteAndReply")+"</span>").click($.proxy(this._saveAndInsertQuote,this)).insertAfter(t)}},_getSelectedText:function(){var e=window.getSelection();return e.rangeCount?this._getNodeText(e.getRangeAt(0).cloneContents()):""},_saveFullQuote:function(e){e.preventDefault();var t=$(e.currentTarget);this._proxy.setOption("data",{actionName:"saveFullQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[t.data("objectID")]}),this._proxy.sendRequest(),t.data("isQuoted")?t.data("isQuoted",!1).children("a").removeClass("active"):t.data("isQuoted",!0).children("a").addClass("active");var i=t.parents(".buttonGroupNavigation");i.hasClass("jsMobileButtonGroupNavigation")&&i.children(".dropdownLabel").trigger("click")},_saveQuote:function(e){this._proxy.setOption("data",{actionName:"saveQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[this._objectID],parameters:{message:this._message,renderQuote:e===!0}}),this._proxy.sendRequest()},_saveAndInsertQuote:function(){this._saveQuote(!0)},_success:function(e){if(void 0!==e.returnValues.count){void 0!==e.returnValues.fullQuoteMessageIDs&&(e.returnValues.fullQuoteObjectIDs=e.returnValues.fullQuoteMessageIDs);var t=void 0!==e.returnValues.fullQuoteObjectIDs?e.returnValues.fullQuoteObjectIDs:{};this._quoteManager.updateCount(e.returnValues.count,t)}switch(e.actionName){case"saveQuote":case"saveFullQuote":e.returnValues.renderedQuote&&WCF.System.Event.fireEvent("com.woltlab.wcf.message.quote","insert",{forceInsert:"saveQuote"===e.actionName,quote:e.returnValues.renderedQuote})}},updateFullQuoteObjectIDs:function(e){for(var t in this._containers)this._containers[t].find(".jsQuoteMessage").each(function(t,i){var s=$(i).data("isQuoted",0);s.children("a").removeClass("active"),WCF.inArray(s.data("objectID"),e)&&s.data("isQuoted",1).children("a").addClass("active")})}}),WCF.Message.Quote.Manager=Class.extend({_buttons:{},_count:0,_dialog:null,_editorId:"",_editorIdAlternative:"",_form:null,_handlers:{},_hasTemplate:!1,_insertQuotes:!0,_proxy:null,_removeOnSubmit:[],_supportPaste:!1,init:function(e,t,i,s){if(this._buttons={insert:null,remove:null},this._count=parseInt(e)||0,this._dialog=null,this._editorId="",this._editorIdAlternative="",this._form=null,this._handlers={},this._hasTemplate=!1,this._insertQuotes=!0,this._removeOnSubmit=[],this._supportPaste=!1,t){var a=$("#"+t);a.length&&(this._editorId=t,this._supportPaste=!0,this._form=a.parents("form:eq(0)"),this._form.length?(this._form.submit(this._submit.bind(this)),this._removeOnSubmit=s||[]):(this._form=null,this._supportPaste=i===!0))}this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this),url:"index.php?message-quote/&t="+SECURITY_TOKEN}),this._toggleShowQuotes(),WCF.System.Event.addListener("com.woltlab.wcf.quote","reload",this.countQuotes.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.message.quote","insert",function(e){WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","insertQuote_"+(this._editorIdAlternative?this._editorIdAlternative:this._editorId),{author:e.quote.username,content:e.quote.text,isText:!e.quote.isFullQuote,link:e.quote.link})}.bind(this))},setAlternativeEditor:function(e){"object"==typeof e&&(e=e[0].id),this._editorIdAlternative=e},clearAlternativeEditor:function(){this._editorIdAlternative=""},register:function(e,t){this._handlers[e]=t},updateCount:function(e,t){this._count=parseInt(e)||0,this._toggleShowQuotes();for(var i in this._handlers)if(this._handlers.hasOwnProperty(i)){var s=t[i]||[];this._handlers[i].updateFullQuoteObjectIDs(s)}},insertQuotes:function(e,t,i){return this._insertQuotes?void new WCF.Action.Proxy({autoSend:!0,data:{actionName:"getRenderedQuotes",className:e,interfaceName:"wcf\\data\\IMessageQuoteAction",parameters:{parentObjectID:t}},success:i}):void(this._insertQuotes=!0)},_toggleShowQuotes:function(){require(["WoltLabSuite/Core/Ui/Page/Action"],function(e){var t="showQuotes";if(this._count){var i=e.get(t);void 0===i&&(i=elCreate("a"),i.addEventListener("mousedown",this._click.bind(this)),e.add(t,i)),i.textContent=WCF.Language.get("wcf.message.quote.showQuotes").replace(/#count#/,this._count),e.show(t)}else e.hide(t);this._hasTemplate=!1}.bind(this))},_click:function(){var e=document.activeElement;e.classList.contains("redactor-layer")&&$("#"+elData(e,"element-id")).redactor("selection.save"),this._hasTemplate?this._dialog.wcfDialog("open"):(this._proxy.showLoadingOverlayOnce(),this._proxy.setOption("data",{actionName:"getQuotes",supportPaste:this._supportPaste}),this._proxy.sendRequest())},renderDialog:function(e){null===this._dialog&&(this._dialog=$("#messageQuoteList"),this._dialog.length||(this._dialog=$('<div id="messageQuoteList" />').hide().appendTo(document.body))),this._dialog.html(e);var t=$('<div class="formSubmit" />').appendTo(this._dialog);this._supportPaste&&(this._buttons.insert=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.message.quote.insertAllQuotes")+"</button>").click($.proxy(this._insertSelected,this)).appendTo(t)),this._buttons.remove=$("<button>"+WCF.Language.get("wcf.message.quote.removeAllQuotes")+"</button>").click($.proxy(this._removeSelected,this)).appendTo(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.quote.manageQuotes")}),this._dialog.wcfDialog("render"),this._hasTemplate=!0;var i=this._dialog.find(".jsInsertQuote");if(this._supportPaste?i.click($.proxy(this._insertQuote,this)):i.hide(),this._dialog.find("input.jsCheckbox").change($.proxy(this._changeButtons,this)),this._removeOnSubmit.length){var s=this;this._dialog.find("input.jsRemoveQuote").each(function(e,t){var i=$(t).change($.proxy(this._change,this));WCF.inArray(i.parent("li").attr("data-quote-id"),s._removeOnSubmit)&&i.attr("checked","checked")})}},_changeButtons:function(){this._dialog.find("input.jsCheckbox:checked").length?(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertSelectedQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeSelectedQuotes"))):(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertAllQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeAllQuotes")))},_change:function(e){var t=$(e.currentTarget),i=t.parent("li").attr("data-quote-id");if(t.prop("checked"))this._removeOnSubmit.push(i);else{var s=this._removeOnSubmit.indexOf(i);-1!==s&&this._removeOnSubmit.splice(s,1)}},_insertSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked"),this._dialog.find("input.jsCheckbox:checked").each($.proxy(function(e,t){this._insertQuote(null,t)},this)),this._dialog.wcfDialog("close")},_insertQuote:function(e,t){var i=$(e?e.currentTarget:t).parents("li:eq(0)"),s=i.children(".jsFullQuote")[0].textContent.trim(),a=i.parents(".message:eq(0)"),n=a.data("username"),o=a.data("link"),r=!elDataBool(i[0],"is-full-quote");WCF.System.Event.fireEvent("com.woltlab.wcf.redactor2","insertQuote_"+(this._editorIdAlternative?this._editorIdAlternative:this._editorId),{author:n,content:s,isText:r,link:o}),this._removeOnSubmit.push(i.data("quote-id")),null!==e&&this._dialog.wcfDialog("close")},_removeSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked");var e=[];if(this._dialog.find("input.jsCheckbox:checked").each(function(t,i){e.push($(i).parents("li").attr("data-quote-id"))}),e.length){var t=[];for(var i in this._handlers)this._handlers.hasOwnProperty(i)&&t.push(i);this._proxy.setOption("data",{actionName:"remove",getFullQuoteObjectIDs:this._handlers.length>0,objectTypes:t,quoteIDs:e}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}},_submit:function(){if(this._supportPaste&&this._removeOnSubmit.length>0)for(var e=this._form.find(".formSubmit"),t=0,i=this._removeOnSubmit.length;i>t;t++)$('<input type="hidden" name="__removeQuoteIDs[]" value="'+this._removeOnSubmit[t]+'" />').appendTo(e)},getQuotesMarkedForRemoval:function(){return this._removeOnSubmit},markQuotesForRemoval:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"markForRemoval",quoteIDs:this._removeOnSubmit}),this._proxy.suppressErrors(),this._proxy.sendRequest())},removeMarkedQuotes:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"removeMarkedQuotes",getFullQuoteObjectIDs:this._handlers.length>0}),this._proxy.sendRequest())},countQuotes:function(){var e=[];for(var t in this._handlers)this._handlers.hasOwnProperty(t)&&e.push(t);this._proxy.setOption("data",{actionName:"count",getFullQuoteObjectIDs:e.length>0,objectTypes:e}),this._proxy.sendRequest()},_success:function(e){if(null!==e){if(void 0!==e.count){var t=void 0!==e.fullQuoteObjectIDs?e.fullQuoteObjectIDs:{};this.updateCount(e.count,t)}void 0!==e.template&&(""==$.trim(e.template)?this.updateCount(0,{}):this.renderDialog(e.template))}},supportPaste:function(){return this._supportPaste}}),WCF.Message.Share={},WCF.Message.Share.Content=Class.extend({_cache:{},_dialog:null,init:function(){this._cache={},this._dialog=null,this._initLinks(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Share.Content",$.proxy(this._initLinks,this))},_initLinks:function(){$("a.jsButtonShare").removeClass("jsButtonShare").click($.proxy(this._click,this))},_click:function(e){e.preventDefault();var t=$(e.currentTarget),i=t.prop("href"),s=t.data("linkTitle")?t.data("linkTitle"):i,a=i.hashCode();if(void 0===this._cache[a]){var n=!1;null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),n=!0):this._dialog.empty();var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalink">'+WCF.Language.get("wcf.message.share.permalink")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalink" class="long" readonly />').attr("value",i).appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkBBCode">'+WCF.Language.get("wcf.message.share.permalink.bbcode")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkBBCode" class="long" readonly />').attr("value","[url='"+i+"']"+s+"[/url]").appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkHTML">'+WCF.Language.get("wcf.message.share.permalink.html")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkHTML" class="long" readonly />').attr("value",'<a href="'+i+'">'+WCF.String.escapeHTML(s)+"</a>").appendTo(o),this._cache[a]=this._dialog.html(),this._dialog.wcfDialog(n?{title:WCF.Language.get("wcf.message.share")}:"open")}else this._dialog.html(this._cache[a]).wcfDialog("open");this._enableSelection()},_enableSelection:function(){var e=this._dialog.find("input").click(function(){$(this).select()});navigator.userAgent.match(/iP(ad|hone|od)/)&&e.keydown(function(){return!1}).removeAttr("readonly").click(function(){this.setSelectionRange(0,9999)})}}),WCF.Message.Share.Page=Class.extend({init:function(){require(["WoltLabSuite/Core/Ui/Message/Share"],function(e){e.init()})}}),WCF.Message.UserMention=Class.extend({init:function(){throw new Error("Support for mentions in Redactor are now enabled by adding the attribute 'data-support-mention=\"true\"' to the textarea element.")}}),$.widget("wcf.messageTabMenu",{_tabs:[],_tabsByName:{},options:{collapsible:!0},_create:function(){var e=this.element.find("> nav"),t=e.find("> ul > li:not(.jsFlexibleMenuDropdown)"),i=this.element.find("> div, > fieldset");if(t.length!=i.length)return void console.debug("[wcf.messageTabMenu] Amount of tabs does not equal amount of tab containers, aborting.");var s=this.element.data("preselect");i.each(function(e,i){return null!==elBySel(".innerError",i)?(s=$(t[e]).data("name"),!1):void 0}),this._tabs=[],this._tabsByName={};for(var a=0;a<t.length;a++){var n=$(t[a]),o=$(i[a]),r=n.data("name");if(void 0===r){var l=n.children("a").prop("href");void 0!==l&&l.match(/#([a-zA-Z_-]+)$/)&&(r=RegExp.$1),void 0===r&&(r=n.wcfIdentify(),console.debug("[wcf.messageTabMenu] Missing name attribute, assuming generic ID '"+r+"'"))}this._tabs.push({container:o,name:r,tab:n}),this._tabsByName[r]=a;var c=n.children("a").data("index",a).click($.proxy(this._showTab,this));s==r&&c.trigger("click")}s===!0&&this._tabs.length&&!window.matchMedia("(max-width: 544px)").matches&&this._tabs[0].tab.children("a").trigger("click");var u=this.element.data("collapsible");void 0!==u&&(this.options.collapsible=u);var d=elData(this.element[0],"wysiwyg-container-id");d&&WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+d,function(){for(var e=0,t=this._tabs.length;t>e;e++)this._tabs[e].container.removeClass("active"),this._tabs[e].tab.removeClass("active")}.bind(this))},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments),this.element.remove()},_showTab:function(e,t,i){var s=null===e?t:$(e.currentTarget).data("index");i=!this.options.collapsible||i===!0;for(var a=null,n=0;n<this._tabs.length;n++){var o=this._tabs[n];if(n==s){if(!o.tab.hasClass("active")){o.tab.addClass("active"),o.container.addClass("active"),a=o;continue}if(i===!0)continue}o.tab.removeClass("active"),o.container.removeClass("active")}null!==e&&(e.preventDefault(),e.stopPropagation()),null!==a&&this._trigger("show",{},{activeTab:a}),$(window).trigger("resize")},showTab:function(e,t){return $.isNumeric(e)||void 0!==this._tabsByName[e]&&(e=this._tabsByName[e]),void 0===this._tabs[e]?void console.debug("[wcf.messageTabMenu] Cannot locate tab identified by '"+e+"'"):void this._showTab(null,e,t)},getTab:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].tab:null},getContainer:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].container:null}}); })(this);
 
 // WCF.Poll.js
 (function (window, undefined) {"use strict";WCF.Poll={},WCF.Poll.Management=Class.extend({_container:null,_count:0,_editorId:"",_maxOptions:0,init:function(t,e,i,n){return this._count=0,this._maxOptions=i||-1,this._container=$("#"+t).children("ol:eq(0)"),this._container.length?(e=e||[],this._createOptionList(e),n?(this._editorId=n,WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+n,this._reset.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","submit_"+n,this._submit.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","validate_"+n,this._validate.bind(this))):this._container.closest("form").submit($.proxy(this._submit,this)),void require(["WoltLabSuite/Core/Ui/Sortable/List"],function(e){new e({containerId:t,options:{toleranceElement:"> div"}})})):void console.debug("[WCF.Poll.Management] Invalid container id given, aborting.")},_createOptionList:function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._createOption(n.optionValue,n.optionID)}this._createOption()},_createOption:function(t,e,i){t=t||"",e=parseInt(e)||0,i=i||null;var n=$('<li class="sortableNode" />').data("optionID",e);null===i?n.appendTo(this._container):n.insertAfter(i);var o=$('<div class="pollOptionInput" />').appendTo(n);$('<span class="icon icon16 fa-arrows sortableNodeHandle" />').appendTo(o),$('<span class="icon icon16 fa-plus jsTooltip jsAddOption pointer" title="'+WCF.Language.get("wcf.poll.button.addOption")+'" />').click($.proxy(this._addOption,this)).appendTo(o),$('<span class="icon icon16 fa-times jsTooltip jsDeleteOption pointer" title="'+WCF.Language.get("wcf.poll.button.removeOption")+'" />').click($.proxy(this._removeOption,this)).appendTo(o);var s=$('<input type="text" value="'+t+'" maxlength="255" />').keydown($.proxy(this._keyDown,this)).appendTo(o);s.click(function(){document.activeElement!==this&&this.focus()}),null!==i&&s.focus(),WCF.DOMNodeInsertedHandler.execute(),this._count++,this._count===this._maxOptions&&this._container.find("span.jsAddOption").removeClass("pointer").addClass("disabled")},_keyDown:function(t){13===t.which&&($(t.currentTarget).parent().children(".jsAddOption").trigger("click"),t.preventDefault())},_addOption:function(t){if(this._count===this._maxOptions)return!1;var e=$(t.currentTarget).closest("li",this._container[0]);this._createOption(void 0,void 0,e)},_removeOption:function(t){$(t.currentTarget).closest("li",this._container[0]).remove(),this._count--,this._container.find("span.jsAddOption").addClass("pointer").removeClass("disabled"),0==this._container.children("li").length&&this._createOption()},_submit:function(t){var e=[];if(this._container.children("li").each(function(t,i){var n=$(i),o=$.trim(n.find("input").val());""!=o&&e.push(n.data("optionID")+"_"+o)}),"object"==typeof t.originalEvent&&t.originalEvent instanceof Event){if(e.length)for(var i=this._container.parents("form").find(".formSubmit"),n=0,o=e.length;o>n;n++)$('<input type="hidden" name="pollOptions['+n+']">').val(e[n]).appendTo(i)}else{t.poll={pollOptions:e};var s=this._container.parents(".messageTabMenuContent:eq(0)");s.find("input").each(function(e,i){i.name&&("checkbox"!==i.type||i.checked)&&(t.poll[i.name]=i.value)})}},_reset:function(){for(var t=this._container[0];t.childElementCount>1;)t.removeChild(t.children[1]);elBySel("input",t.children[0]).value="";var e=this._container.parents(".messageTabMenuContent:eq(0)");e.find("input").each(function(t,e){e.name&&("checkbox"===e.type?e.checked=!1:"text"===e.type?e.value="":"number"===e.type&&(e.value=e.min))}),require(["WoltLabSuite/Core/Date/Picker"],function(t){t.clear("pollEndTime_"+this._editorId)}.bind(this))},_validate:function(t){var e=elById("pollQuestion_"+this._editorId);if(""!==e.value.trim()){var i=0;if(elBySelAll('li input[type="text"]',this._container[0],function(t){""!==t.value.trim()&&i++}),0===i)t.api.throwError(this._container[0],WCF.Language.get("wcf.global.form.error.empty")),t.valid=!1;else{var n=elById("pollMaxVotes_"+this._editorId),o=~~n.value;o&&o>i&&(t.api.throwError(n,WCF.Language.get("wcf.poll.maxVotes.error.invalid")),t.valid=!1)}}}}),WCF.Poll.Manager=Class.extend({_cache:{},_canViewParticipants:{},_canViewResult:{},_canVote:{},_inputElements:{},_participants:{},_polls:{},_proxy:null,init:function(t){var e=$(t);if(!e.length)return void console.debug("[WCF.Poll.Manager] Given selector '"+t+"' does not match, aborting.");this._cache={},this._canViewParticipants={},this._canViewResult={},this._inputElements={},this._participants={},this._polls={},this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php?poll/&t="+SECURITY_TOKEN});var i=this;e.each(function(t,e){var n=$(e),o=n.data("pollID");void 0===i._polls[o]&&(i._cache[o]={result:"",vote:""},i._polls[o]=n,i._canViewParticipants[o]=n.data("canViewParticipants")?!0:!1,i._canViewResult[o]=n.data("canViewResult")?!0:!1,i._canVote[o]=n.data("canVote")?!0:!1,i._bindListeners(o),n.data("inVote")&&i._prepareVote(o),i._toggleButtons(o))})},_bindListeners:function(t){this._polls[t].find(".jsButtonPollShowParticipants").data("pollID",t).click($.proxy(this._showParticipants,this)),this._polls[t].find(".jsButtonPollShowResult").data("pollID",t).click($.proxy(this._showResult,this)),this._polls[t].find(".jsButtonPollShowVote").data("pollID",t).click($.proxy(this._showVote,this)),this._polls[t].find(".jsButtonPollVote").data("pollID",t).click($.proxy(this._vote,this))},_showResult:function(t,e){var i=null===t?e:$(t.currentTarget).data("pollID");this._canViewResult[i]&&this._polls[i].data("inVote")&&(this._cache[i].result?(this._polls[i].find(".pollInnerContainer").html(this._cache[i].result),this._polls[i].data("inVote",!1),this._toggleButtons(i)):(this._proxy.setOption("data",{actionName:"getResult",pollID:i}),this._proxy.sendRequest()))},_showParticipants:function(t){var e=$(t.currentTarget).data("pollID");this._participants[e]||(this._participants[e]=new WCF.User.List("wcf\\data\\poll\\PollAction",this._polls[e].data("question"),{pollID:e})),this._participants[e].open()},_showVote:function(t,e){var i=null===t?e:$(t.currentTarget).data("pollID");this._canVote[i]&&(this._polls[i].data("inVote")||(this._cache[i].vote?(this._polls[i].find(".pollInnerContainer").html(this._cache[i].vote),this._polls[i].data("inVote",!0),this._prepareVote(i),this._toggleButtons(i)):(this._proxy.setOption("data",{actionName:"getVote",pollID:i}),this._proxy.sendRequest())))},_success:function(t){if(t&&t.actionName){var e=t.pollID;switch(t.resultTemplate&&(this._cache[e].result=t.resultTemplate),t.voteTemplate&&(this._cache[e].vote=t.voteTemplate),t.actionName){case"getResult":this._showResult(null,e);break;case"getVote":this._showVote(null,e);break;case"vote":this._canViewResult[e]=!0,this._canVote[e]=t.canVote?!0:!1,this._showResult(null,e)}}},_prepareVote:function(t){this._polls[t].find(".jsButtonPollVote").disable();var e=this._polls[t].find(".pollInnerContainer > .jsPollVote"),i=this;this._inputElements[t]=e.find("input").change(function(){i._handleVoteButton(t)}),this._handleVoteButton(t);var n=e.data("maxVotes");this._inputElements[t].filter("[type=checkbox]").length&&(this._inputElements[t].change(function(){i._enforceMaxVotes(t,n)}),this._enforceMaxVotes(t,n))},_enforceMaxVotes:function(t,e){var i=this._inputElements[t];i.filter(":checked").length==e?i.filter(":not(:checked)").disable():i.enable()},_handleVoteButton:function(t){var e=this._inputElements[t],i=this._polls[t].find(".jsButtonPollVote");e.filter(":checked").length?i.enable():i.disable()},_toggleButtons:function(t){var e=this._polls[t].children(".formSubmit");e.find(".jsButtonPollShowParticipants, .jsButtonPollShowResult, .jsButtonPollShowVote, .jsButtonPollVote").hide();var i=!0;this._polls[t].data("inVote")?(i=!1,e.find(".jsButtonPollVote").show(),this._canViewResult[t]&&e.find(".jsButtonPollShowResult").show()):(this._canVote[t]&&(i=!1,e.find(".jsButtonPollShowVote").show()),this._canViewParticipants[t]&&(i=!1,e.find(".jsButtonPollShowParticipants").show())),i&&e.hide()},_vote:function(t){var e=$(t.currentTarget).data("pollID");if(this._canVote[e]){var i=[];this._inputElements[e].each(function(t,e){var n=$(e);n.is(":checked")&&i.push(n.data("optionID"))}),i.length&&(this._proxy.setOption("data",{actionName:"vote",optionIDs:i,pollID:e}),this._proxy.sendRequest())}}}); })(this);
index f8e5a783d90aad067f1066fddba21a3f858b5ab4..74a7ab055e6f83069085f758ffee333d0356e494 100644 (file)
@@ -6,6 +6,6 @@ var n=elBySel(".messageGroupList");n&&(_=elByClass("messageGroup",n)),l.on("scre
 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;if(null!==o.closest(".popover"))return void s.set(c,{content:null,state:w});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(WCF_CLICK_EVENT,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:w})}}},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+"').");var c=a.createFragmentFromHtml(i);if(c.childElementCount||(c=a.createFragmentFromHtml("<p>"+i+"</p>")),r.content=c,r.state=C,o){var d=l.get(o).element;elData(d,"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),L)}},_mouseLeave:function(){d=null,null===p&&(null===v&&(v=this._hide.bind(this)),null!==p&&window.clearTimeout(p),p=window.setTimeout(v,E))},_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")?o!==d&&(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===w&&(i.state=y,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{silent:!0}},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("WoltLabSuite/Core/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("WoltLabSuite/Core/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),window.getSelection().removeAllRanges()}}}),define("WoltLabSuite/Core/Ui/Page/Header/Menu",["Ui/Screen"],function(e){"use strict";var t,i,n,a,r=!1,o=0,s=[],l=[];return{init:function(){if(a=elBySel(".mainMenu .boxMenu"),n=a&&a.childElementCount?a.children[0]:null,null===n)throw new Error("Unable to find the menu.");e.on("screen-lg",{enable:this._enable.bind(this),disable:this._disable.bind(this),setup:this._setup.bind(this)})},_enable:function(){r=!0,this._rebuildVisibility(),window.setTimeout(this._rebuildVisibility.bind(this),1e3)},_disable:function(){r=!1},_showNext:function(e){if(e.preventDefault(),l.length){var n=l.slice(0,3).pop();this._setMarginLeft(a.clientWidth-(n.offsetLeft+n.clientWidth)),a.lastElementChild===n&&t.classList.remove("active"),i.classList.add("active")}},_showPrevious:function(e){if(e.preventDefault(),s.length){var n=s.slice(-3)[0];this._setMarginLeft(-1*n.offsetLeft),a.firstElementChild===n&&i.classList.remove("active"),t.classList.add("active")}},_setMarginLeft:function(e){o=Math.min(o+e,0),n.style.setProperty("margin-left",o+"px","")},_rebuildVisibility:function(){if(r){s=[],l=[];var e=a.clientWidth;if(a.scrollWidth>e||0>o)for(var n,c=0,d=a.childElementCount;d>c;c++){n=a.children[c];var u=n.offsetLeft;0>u?s.push(n):u+n.clientWidth>e&&l.push(n)}i.classList[s.length?"add":"remove"]("active"),t.classList[l.length?"add":"remove"]("active")}},_setup:function(){t=elCreate("a"),t.className="mainMenuShowNext",t.href="#",t.innerHTML='<span class="icon icon32 fa-angle-right"></span>',t.addEventListener(WCF_CLICK_EVENT,this._showNext.bind(this)),a.parentNode.appendChild(t),i=elCreate("a"),i.className="mainMenuShowPrevious",i.href="#",i.innerHTML='<span class="icon icon32 fa-angle-left"></span>',i.addEventListener(WCF_CLICK_EVENT,this._showPrevious.bind(this)),a.parentNode.insertBefore(i,a.parentNode.firstChild);var e=this._rebuildVisibility.bind(this);n.addEventListener("transitionend",e),window.addEventListener("resize",function(){n.style.setProperty("margin-left","0px",""),o=0,e()}),this._enable()}}}),define("WoltLabSuite/Core/BootstrapFrontend",["Ajax","WoltLabSuite/Core/Bootstrap","WoltLabSuite/Core/Controller/Style/Changer","WoltLabSuite/Core/Controller/Popover","WoltLabSuite/Core/Ui/User/Ignore","WoltLabSuite/Core/Ui/Page/Header/Menu"],function(e,t,i,n,a,r){"use strict";var o=0;return{setup:function(e){e.backgroundQueue.url=WSC_API_URL+e.backgroundQueue.url.substr(WCF_PATH.length),t.setup(),r.init(),e.styleChanger&&i.setup(),this._initUserPopover(),this._invokeBackgroundQueue(e.backgroundQueue.url,e.backgroundQueue.force),a.init()},_initUserPopover:function(){n.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("WoltLabSuite/Core/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("WoltLabSuite/Core/Permission",["Dictionary"],function(e){"use strict";var t=new e;return{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.add(t,e[t])},get:function(e){return t.has(e)?t.get(e):!1}}}),define("WoltLabSuite/Core/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?ajax-upload/&t="+SECURITY_TOKEN},n),this._options.url=t.convertLegacyUrl(this._options.url),0===this._options.url.indexOf("index.php")&&(this._options.url=WSC_API_URL+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.className="button 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,withCredentials:!0});return c.sendRequest(),n}},o}),define("WoltLabSuite/Core/User",[],function(){"use strict";var e=!1;return{init:function(t,i){if(e)throw new Error("User has already been initialized.");Object.defineProperty(this,"userId",{value:t,writable:!1}),Object.defineProperty(this,"username",{value:i,writable:!1}),e=!0}}}),define("WoltLabSuite/Core/Ajax/Jsonp",["Core"],function(e){"use strict";return{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,o="wcf_jsonp_"+e.getUuid().replace(/-/g,"").substr(0,8),s=window.setTimeout(function(){"function"==typeof n&&n(),window[o]=void 0,elRemove(r)},1e3*(~~a.timeout||10));window[o]=function(){window.clearTimeout(s),i.apply(null,arguments),window[o]=void 0,elRemove(r)},t+=-1===t.indexOf("?")?"?":"&",t+=a.parameterName+"="+o,r=elCreate("script"),r.async=!0,elAttr(r,"src",t),document.head.appendChild(r)}}}),define("WoltLabSuite/Core/Bbcode/Collapsible",[],function(){"use strict";var e=elByClass("jsCollapsibleBbcode");return{observe:function(){for(var t,i;e.length;)t=e[0],i=null,elBySelAll(".toggleButton:not(.jsToggleButtonEnabled)",t,function(e){e.closest(".jsCollapsibleBbcode")===t&&(i=e)}),i&&!function(e,t){var i=function(i){if(e.classList.toggle("collapsed")){if(t.textContent=elData(t,"title-expand"),i instanceof Event){var n=e.getBoundingClientRect().top;if(0>n){var a=window.pageYOffset+(n-100);0>a&&(a=0),window.scrollTo(window.pageXOffset,a)}}}else t.textContent=elData(t,"title-collapse")};t.classList.add("jsToggleButtonEnabled"),t.addEventListener(WCF_CLICK_EVENT,i),0!==e.scrollTop&&i()}(t,i),t.classList.remove("jsCollapsibleBbcode")}}}),define("WoltLabSuite/Core/Controller/Captcha",["Dictionary"],function(e){"use strict";var t=new e;return{add:function(e,i){if(t.has(e))throw new Error("Captcha with id '"+e+"' is already registered.");if("function"!=typeof i)throw new TypeError("Expected a valid callback for parameter 'callback'.");t.set(e,i)},"delete":function(e){if(!t.has(e))throw new Error("Unknown captcha with id '"+e+"'.");t["delete"](e)()},has:function(e){return t.has(e)},getData:function(e){if(!t.has(e))throw new Error("Unknown captcha with id '"+e+"'.");return t.get(e)()}}}),define("WoltLabSuite/Core/Controller/Clipboard",["Ajax","Core","Dictionary","EventHandler","Language","List","ObjectMap","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/Confirmation","Ui/SimpleDropdown","WoltLabSuite/Core/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,_={},w=null,y=null,C=null,E=!1;return{setup:function(e){if(!e.pageClassName)throw new Error("Expected a non-empty string for parameter 'pageClassName'.");if(null===w)w=this._mark.bind(this),y=this._executeAction.bind(this),C=this._unmarkAll.bind(this),_=t.extend({hasMarkedItems:!1,pageClassNames:[e.pageClassName],pageObjectId:0},e),delete _.pageClassName;else{if(e.pageObjectId)throw new Error("Cannot load secondary clipboard with page object id set.");_.pageClassNames.push(e.pageClassName)}this._initContainers(),_.hasMarkedItems&&g.length&&this._loadMarkedItems(),s.add("WoltLabSuite/Core/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(WCF_CLICK_EVENT,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),function(e){var t=e.closest("a");null===t?e.addEventListener(WCF_CLICK_EVENT,w):e.addEventListener(WCF_CLICK_EVENT,function(t){t.preventDefault(),window.setTimeout(function(){e.checked=!e.checked,w(null,e)},10)})}(d),b.add(d))}}},_loadMarkedItems:function(){e.api(this,{actionName:"getMarkedItems",parameters:{pageClassNames:_.pageClassNames,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,t){t=e instanceof Event?e.currentTarget:t;var 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:{pageClassNames:_.pageClassNames,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)i.internalData.parameters.hasOwnProperty(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&&e.returnValues.markedItems.hasOwnProperty(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)e.returnValues.items.hasOwnProperty(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,_,w,E;for(t in e.returnValues.items)if(e.returnValues.items.hasOwnProperty(t)){c=e.returnValues.items[t],r=!1,l=f.get(t),s=m.get(t),void 0===l?(r=!0,l=elCreate("a"),l.className="dropdownToggle",l.textContent=c.label,f.set(t,l),s=elCreate("ol"),s.className="dropdownMenu",m.set(t,s)):(l.textContent=c.label,s.innerHTML="");for(_ in c.items)c.items.hasOwnProperty(_)&&(b=c.items[_],g=elCreate("li"),w=elCreate("span"),w.textContent=b.label,g.appendChild(w),s.appendChild(g),elData(g,"type",t),g.addEventListener(WCF_CLICK_EVENT,y),v.set(g,b));d=elCreate("li"),d.classList.add("dropdownDivider"),s.appendChild(d),E=elCreate("li"),elData(E,"type",t),w=elCreate("span"),w.textContent=a.get("wcf.clipboard.item.unmarkAll"),E.appendChild(w),E.addEventListener(WCF_CLICK_EVENT,C),s.appendChild(E),-1!==i.indexOf(t)&&(n="wcfClipboard-"+t,h.has(n)?h.show(n):h.add(n,l)),r&&(l.parentNode.classList.add("dropdown"),l.parentNode.appendChild(s),u.init(l))}}},_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")}if(null!==e.markAll){e.markAll.checked=i;for(var c=e.markAll;c=c.parentNode;)if(c instanceof Element&&c.classList.contains("columnMark")){c=c.parentNode;break}c&&c.classList[i?"add":"remove"]("jsMarked")}},hideEditor:function(e){h.remove("wcfClipboard-"+e),E&&(E=!1,document.documentElement.classList.add("pageOverlayActive"))},showEditor:function(){this._loadMarkedItems(),document.documentElement.classList.contains("pageOverlayActive")&&(document.documentElement.classList.remove("pageOverlayActive"),E=!0)},unmark:function(e,t){this._saveState(e,t,!1)}}}),define("WoltLabSuite/Core/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)},Comma:function(t){return e(t,",",44)},Enter:function(t){return e(t,"Enter",13)},Escape:function(t){return e(t,"Escape",27)},Tab:function(t){return e(t,"Tab",9)}}}),define("WoltLabSuite/Core/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 dropdownIndicator 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,_=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(s.hasOwnProperty(w)){var y=s[w];v=elCreate("li"),v.className="boxFlag",v.addEventListener(WCF_CLICK_EVENT,_),elData(v,"language-id",w),void 0!==y.languageCode&&elData(v,"language-code",y.languageCode),f.appendChild(v),m=elCreate("a"),m.className="box24",v.appendChild(m),g=elCreate("img"),elAttr(g,"src",y.iconPath),elAttr(g,"alt",""),g.className="iconFlag",m.appendChild(g),b=elCreate("span"),b.textContent=y.languageName,m.appendChild(b),w==a&&(p.innerHTML=v.firstChild.innerHTML)}if(u)v=elCreate("li"),v.className="dropdownDivider",f.appendChild(v),v=elCreate("li"),elData(v,"language-id",0),v.addEventListener(WCF_CLICK_EVENT,_),f.appendChild(v),m=elCreate("a"),m.textContent=t.get("wcf.global.language.noSelection"),v.appendChild(m),0===a&&(p.innerHTML=v.firstChild.innerHTML),v.addEventListener(WCF_CLICK_EVENT,_);else if(0===a){p.innerHTML=null;var C=elCreate("div");p.appendChild(C),b=elCreate("span"),b.className="icon icon24 fa-question",C.appendChild(b),b=elCreate("span"),b.textContent=t.get("wcf.global.language.noSelection"),C.appendChild(b)}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 L=l.get(E);void 0===L&&(L=[],l.set(E,L)),L.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},removeChooser:function(e){o.has(e)&&o["delete"](e)},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("WoltLabSuite/Core/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;return{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)i.hasOwnProperty(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,b=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 _ in a)a.hasOwnProperty(_)&&(v=elCreate("li"),elData(v,"language-id",_),m=elCreate("span"),m.textContent=a[_],v.appendChild(m),v.addEventListener(WCF_CLICK_EVENT,b),g.appendChild(v));c!==!0&&(v=elCreate("li"),v.className="dropdownDivider",g.appendChild(v),v=elCreate("li"),elData(v,"language-id",0),m=elCreate("span"),m.textContent=i.get("wcf.global.button.disabledI18n"),v.appendChild(m),v.addEventListener(WCF_CLICK_EVENT,b),g.appendChild(v));var w=null;if(c===!0||n.size)for(var y=0,C=g.childElementCount;C>y;y++)if(~~elData(g.children[y],"language-id")===LANGUAGE_ID){w=g.children[y];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 E=r.parentByTag(t,"FORM");if(null!==E){E.addEventListener("submit",p);var L=d.get(E);void 0===L&&(L=[],d.set(E,L)),L.push(e)}null!==w&&b({currentTarget:w},!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}n||(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=l.get(r),c=u.get(r),d=0,h=a.childElementCount;h>d;d++)if(i=a.children[d],n=~~elData(i,"language-id")){var p=!1;o.languageId&&(p=n===o.languageId?""===o.element.value.trim():!c.get(n)),i.classList[p?"add":"remove"]("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}}}),define("WoltLabSuite/Core/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(WCF_CLICK_EVENT,o),a.appendChild(n),document.body.appendChild(a))},_hide:function(){clearTimeout(r),a.classList.remove("active"),null!==i&&i(),t=!1}};return s}),define("WoltLabSuite/Core/Media/Editor",["Ajax","Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Language","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Language/Chooser","WoltLabSuite/Core/Language/Input","EventKey"],function(e,t,i,n,a,r,o,s,l,c,d){"use strict";function u(e){if(this._callbackObject=e||{},this._callbackObject._editorClose&&"function"!=typeof this._callbackObject._editorClose)throw new TypeError("Callback object has no function '_editorClose'.");if(this._callbackObject._editorSuccess&&"function"!=typeof this._callbackObject._editorSuccess)throw new TypeError("Callback object has no function '_editorSuccess'.");this._media=null,
 this._availableLanguageCount=1,this._dialogs=new i}return u.prototype={_ajaxSetup:function(){return{data:{actionName:"update",className:"wcf\\data\\media\\MediaAction"}}},_ajaxSuccess:function(e){s.show(),this._callbackObject._editorSuccess&&this._callbackObject._editorSuccess(this._media),o.close("mediaEditor_"+this._media.mediaID),this._media=null},_close:function(){this._media=null,this._callbackObject._editorClose&&this._callbackObject._editorClose()},_keyPress:function(e){d.Enter(e)&&(e.preventDefault(),this._saveData())},_saveData:function(){var t=o.getDialog("mediaEditor_"+this._media.mediaID).content,i=elBySel("input[name=altText]",t),n=elBySel("textarea[name=caption]",t),s=elBySel("input[name=title]",t),d=!1,u=i?a.childByClass(i.parentNode.parentNode,"innerError"):!1,h=n?a.childByClass(n.parentNode.parentNode,"innerError"):!1,p=a.childByClass(s.parentNode.parentNode,"innerError");if(this._availableLanguageCount>1?(this._media.isMultilingual=~~elBySel("input[name=isMultilingual]",t).checked,this._media.languageID=this._media.isMultilingual?null:l.getLanguageId("languageID")):this._media.languageID=LANGUAGE_ID,this._media.altText={},this._media.caption={},this._media.title={},this._availableLanguageCount>1&&this._media.isMultilingual){if(elById("altText_"+this._media.mediaID)&&!c.validate("altText_"+this._media.mediaID,!0)&&(d=!0,!u)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),i.parentNode.parentNode.appendChild(f)}if(elById("caption_"+this._media.mediaID)&&!c.validate("caption_"+this._media.mediaID,!0)&&(d=!0,!h)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),n.parentNode.parentNode.appendChild(f)}if(!c.validate("title_"+this._media.mediaID,!0)&&(d=!0,!p)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),s.parentNode.parentNode.appendChild(f)}this._media.altText=elById("altText_"+this._media.mediaID)?c.getValues("altText_"+this._media.mediaID).toObject():"",this._media.caption=elById("caption_"+this._media.mediaID)?c.getValues("caption_"+this._media.mediaID).toObject():"",this._media.title=c.getValues("title_"+this._media.mediaID).toObject()}else this._media.altText[this._media.languageID]=i?i.value:"",this._media.caption[this._media.languageID]=n?n.value:"",this._media.title[this._media.languageID]=s.value;for(var m={allowAll:~~elById("mediaEditor_"+this._media.mediaID+"_aclAllowAll").checked,group:[],user:[]},g=elBySelAll('input[name="aclValues[group][]"]',t),v=0,b=g.length;b>v;v++)m.group.push(~~g[v].value);for(var _=elBySelAll('input[name="aclValues[user][]"]',t),v=0,b=_.length;b>v;v++)m.user.push(~~_[v].value);d||(u&&elRemove(u),h&&elRemove(h),p&&elRemove(p),e.api(this,{actionName:"update",objectIDs:[this._media.mediaID],parameters:{aclValues:m,altText:this._media.altText,caption:this._media.caption,data:{isMultilingual:this._media.isMultilingual,languageID:this._media.languageID},title:this._media.title}}))},_updateLanguageFields:function(e,t){e&&(t=e.currentTarget);var i=elById("mediaEditor_"+this._media.mediaID+"_languageIDContainer").parentNode;t.checked?(c.enable("title_"+this._media.mediaID),elById("caption_"+this._media.mediaID)&&c.enable("caption_"+this._media.mediaID),elById("altText_"+this._media.mediaID)&&c.enable("altText_"+this._media.mediaID),elHide(i)):(c.disable("title_"+this._media.mediaID),elById("caption_"+this._media.mediaID)&&c.disable("caption_"+this._media.mediaID),elById("altText_"+this._media.mediaID)&&c.disable("altText_"+this._media.mediaID),elShow(i))},edit:function(e){if("object"!=typeof e&&(e={mediaID:~~e}),null!==this._media)throw new Error("Cannot edit media with id '"+e.mediaID+"' while editing media with id '"+this._media.mediaID+"'");this._media=e,this._dialogs.has("mediaEditor_"+e.mediaID)||this._dialogs.set("mediaEditor_"+e.mediaID,{_dialogSetup:function(){return{id:"mediaEditor_"+e.mediaID,options:{backdropCloseOnClick:!1,onClose:this._close.bind(this),title:r.get("wcf.media.edit")},source:{after:function(e,t){this._availableLanguageCount=~~t.returnValues.availableLanguageCount;var a=!1;t.returnValues.mediaData&&(this._media=t.returnValues.mediaData,a=!0),setTimeout(function(){this._availableLanguageCount>1&&l.setLanguageId("languageID",this._media.languageID||LANGUAGE_ID);var t=elBySel("input[name=title]",e),a=elBySel("input[name=altText]",e),r=elBySel("textarea[name=caption]",e);if(this._availableLanguageCount>1&&this._media.isMultilingual?(elById("altText_"+this._media.mediaID)&&c.setValues("altText_"+this._media.mediaID,i.fromObject(this._media.altText||{})),elById("caption_"+this._media.mediaID)&&c.setValues("caption_"+this._media.mediaID,i.fromObject(this._media.caption||{})),c.setValues("title_"+this._media.mediaID,i.fromObject(this._media.title||{}))):(t.value=this._media.title?this._media.title[LANGUAGE_ID]:"",a&&(a.value=this._media.altText?this._media.altText[LANGUAGE_ID]:""),r&&(r.value=this._media.caption?this._media.caption[LANGUAGE_ID]:"")),this._availableLanguageCount>1){var o=elBySel("input[name=isMultilingual]",e);o.addEventListener("change",this._updateLanguageFields.bind(this)),this._updateLanguageFields(null,o)}var s=this._keyPress.bind(this);a&&a.addEventListener("keypress",s),t.addEventListener("keypress",s),elBySel("button[data-type=submit]",e).addEventListener(WCF_CLICK_EVENT,this._saveData.bind(this)),document.activeElement.blur(),elById("mediaEditor_"+this._media.mediaID).parentNode.scrollTop=0,n.trigger()}.bind(this),0)}.bind(this),data:{actionName:"getEditorDialog",className:"wcf\\data\\media\\MediaAction",objectIDs:[e.mediaID]}}}}.bind(this)}),o.open(this._dialogs.get("mediaEditor_"+e.mediaID))}},u}),define("WoltLabSuite/Core/Media/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","Permission","Upload"],function(e,t,i,n,a,r,o,s){"use strict";function l(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(l,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(l._super.prototype._getParameters.call(this),{imagesOnly:this._mediaManager.getOption("imagesOnly")}):l._super.prototype._getParameters.call(this)},_success:function(e,n){for(var o=this._fileElements[e],s=0,l=o.length;l>s;s++){var c=o[s],d=elData(c,"internal-file-id"),u=n.returnValues.media[d];if(elRemove(i.childByTag(i.childByClass(c,"mediaInformation"),"PROGRESS")),u){var h=i.childByTag(i.childByClass(c,"mediaThumbnail"),"SPAN");if(u.tinyThumbnailType){var p=h.parentNode;elRemove(h);var f=elCreate("img");elAttr(f,"src",u.tinyThumbnailLink),elAttr(f,"alt",""),f.style.setProperty("width","144px"),f.style.setProperty("height","144px"),p.appendChild(f)}else h.classList.remove("fa-spinner"),h.classList.add("fa-file-o");c.className="jsClipboardObject mediaFile",elData(c,"object-id",u.mediaID),this._mediaManager&&(this._mediaManager.setupMediaElement(u,c),this._mediaManager.addMedia(u,c))}else{var m=n.returnValues.errors[d];m||(m={errorType:"uploadFailed",filename:elData(c,"filename")});var h=i.childByTag(i.childByClass(c,"mediaThumbnail"),"SPAN");h.classList.remove("fa-spinner"),h.classList.add("fa-remove"),h.classList.add("pointer"),c.classList.add("uploadFailed"),c.addEventListener(WCF_CLICK_EVENT,function(){elRemove(this)});var g=i.childByClass(i.childByClass(c,"mediaInformation"),"mediaTitle");g.innerText=r.get("wcf.media.upload.error."+m.errorType,{filename:m.filename})}t.trigger()}a.fire("com.woltlab.wcf.media.upload","success",{files:o,media:n.returnValues.media,upload:this})},_uploadFiles:function(e,t){return this._mediaManager&&this._mediaManager.resetMedia(),l._super.prototype._uploadFiles.call(this,e,t)}}),l}),define("WoltLabSuite/Core/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:[],threshold:3},i),"function"!=typeof this._options.callbackSelect)throw new Error("Expected a valid callback for option 'callbackSelect'.");this._element.addEventListener(WCF_CLICK_EVENT,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.threshold)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(WCF_CLICK_EVENT,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("WoltLabSuite/Core/Ui/ItemList",["Core","Dictionary","Language","Dom/Traverse","EventKey","WoltLabSuite/Core/Ui/Suggestion","Ui/SimpleDropdown"],function(e,t,i,n,a,r,o){"use strict";var s="",l=new t,c=!1,d=null,u=null,h=null,p=null;return{init:function(t,i,a){var s=elById(t);if(null===s)throw new Error("Expected a valid element id, '"+t+"' is invalid.");if(l.has(t)){var c=l.get(t);for(var d in c)if(c.hasOwnProperty(d)){var u=c[d];u instanceof Element&&u.parentNode&&elRemove(u)}o.destroy(t),l["delete"](t)}a=e.extend({ajax:{actionName:"getSearchResultList",className:"",data:{}},excludedSearchValues:[],maxItems:-1,maxLength:-1,restricted:!1,isCSV:!1,callbackChange:null,callbackSubmit:null,submitFieldName:""},a);var h=n.parentByTag(s,"FORM");if(null!==h&&a.isCSV===!1){if(!a.submitFieldName.length&&"function"!=typeof a.callbackSubmit)throw new Error("Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'.");h.addEventListener("submit",function(){var e=this.getValues(t);if(a.submitFieldName.length)for(var i,n=0,r=e.length;r>n;n++)i=elCreate("input"),i.type="hidden",i.name=a.submitFieldName.replace(/{$objectId}/,e[n].objectId),i.value=e[n].value,h.appendChild(i);else a.callbackSubmit(h,e)}.bind(this))}this._setup();var p=this._createUI(s,a),f=new r(t,{ajax:a.ajax,callbackSelect:this._addItem.bind(this),excludedSearchValues:a.excludedSearchValues});if(l.set(t,{dropdownMenu:null,element:p.element,list:p.list,listItem:p.element.parentNode,options:a,shadow:p.shadow,suggestion:f}),i=p.values.length?p.values:i,Array.isArray(i))for(var m,g=0,v=i.length;v>g;g++)m=i[g],"string"==typeof m&&(m={objectId:0,value:m}),this._addItem(t,m)},getValues:function(e){if(!l.has(e))throw new Error("Element id '"+e+"' is unknown.");for(var t,i,a=l.get(e),r=n.childrenByClass(a.list,"item"),o=[],s=0,c=r.length;c>s;s++)i=r[s],t={objectId:elData(i,"object-id"),value:n.childByTag(i,"SPAN").textContent},o.push(t);return o},setValues:function(e,t){if(!l.has(e))throw new Error("Element id '"+e+"' is unknown.");var i,a,r=l.get(e),o=n.childrenByClass(r.list,"item");for(i=0,a=o.length;a>i;i++)this._removeItem(null,o[i],!0);for(i=0,a=t.length;a>i;i++)this._addItem(e,t[i])},_setup:function(){c||(c=!0,d=this._keyDown.bind(this),u=this._keyPress.bind(this),h=this._keyUp.bind(this),p=this._removeItem.bind(this))},_createUI:function(e,t){var i=elCreate("ol");i.className="inputItemList",elData(i,"element-id",e.id),i.addEventListener(WCF_CLICK_EVENT,function(t){t.target===i&&e.focus()});var n=elCreate("li");n.className="input",i.appendChild(n),e.addEventListener("keydown",d),e.addEventListener("keypress",u),e.addEventListener("keyup",h),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);for(var o,s=e.value.split(","),l=0,c=s.length;c>l;l++)o=s[l].trim(),o.length&&r.push(o);if("TEXTAREA"===e.nodeName){var p=elCreate("input");p.type="text",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=l.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;s=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(a.Enter(e)||a.Comma(e)){if(e.preventDefault(),l.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=l.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(WCF_CLICK_EVENT,p),n.appendChild(a),n.appendChild(r),i.list.insertBefore(n,i.listItem),i.suggestion.addExcludedValue(t.value),i.element.value="",this._handleLimit(e);var o=this._syncShadow(i);"function"==typeof i.options.callbackChange&&(null===o&&(o=this.getValues(e)),i.options.callbackChange(e,o))},_removeItem:function(e,t,i){t=null===e?t:e.currentTarget.parentNode;var n=t.parentNode,a=elData(n,"element-id"),r=l.get(a);r.suggestion.removeExcludedValue(t.children[0].textContent),n.removeChild(t),i||r.element.focus(),this._handleLimit(a);var o=this._syncShadow(r);"function"==typeof r.options.callbackChange&&(null===o&&(o=this.getValues(a)),r.options.callbackChange(a,o))},_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}}}),define("WoltLabSuite/Core/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'.");o.has(e)||elBySelAll(".jumpTo",e,function(i){i.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,e)),o.set(e,{callback:t})}.bind(this))},_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),s.select(),r.textContent=e.get("wcf.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.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(WCF_CLICK_EVENT,this._submit.bind(this))}.bind(this),title:e.get("wcf.global.page.pagination")},source:t}}};return l}),define("WoltLabSuite/Core/Ui/Pagination",["Core","Language","ObjectMap","StringUtil","WoltLabSuite/Core/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._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 icon24 fa-chevron-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(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage-1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),n.appendChild(this._createLink(1));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.page.jumpTo")+'">&hellip;</a>';u>1&&(2>u-1?n.appendChild(this._createLink(2)):(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));h<this._options.maxPage&&(this._options.maxPage-h<2?n.appendChild(this._createLink(this._options.maxPage-1)):(r=elCreate("li"),r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0)),n.appendChild(this._createLink(this._options.maxPage)),r=elCreate("li"),r.className="skip",n.appendChild(r),o="icon icon24 fa-chevron-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(WCF_CLICK_EVENT,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(WCF_CLICK_EVENT,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("WoltLabSuite/Core/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("WoltLabSuite/Core/Media/List/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Dom/Util","Language","Ui/Confirmation","Ui/Notification","../Upload"],function(e,t,i,n,a,r,o,s){"use strict";function l(e,t,i){i=i||{},i.multiple=!1,s.call(this,e,t,i)}return e.inherit(l,s,{_createButton:function(){this._fileUpload=elCreate("input"),elAttr(this._fileUpload,"type","file"),elAttr(this._fileUpload,"name",this._options.name),this._fileUpload.addEventListener("change",this._upload.bind(this)),this._button=elCreate("p"),this._button.className="button uploadButton",this._button.innerHTML='<span class="icon icon16 fa-upload"></span> <span>'+a.get("wcf.global.button.upload")+"</span>",n.prepend(this._fileUpload,this._button),this._insertButton(),t.trigger()},_success:function(e,t){var n=i.childByClass(this._button,"icon");n.classList.remove("fa-spinner"),n.classList.add("fa-upload");var s=this._fileElements[e][0],l=elData(s,"internal-file-id"),c=t.returnValues.media[l];if(c)o.show(a.get("wcf.media.upload.success"),function(){window.location.reload()});else{var d=t.returnValues.errors[l];d||(d={errorType:"uploadFailed",filename:elData(s,"filename")}),r.show({confirm:function(){},message:a.get("wcf.media.upload.error."+d.errorType,{filename:d.filename})})}},_upload:function(e,t,n){var a=l._super.prototype._upload.call(this,e,t,n),r=i.childByClass(this._button,"icon");return window.setTimeout(function(){r.classList.remove("fa-upload"),r.classList.add("fa-spinner")},500),a}}),l}),define("WoltLabSuite/Core/Controller/Media/List",["EventHandler","WoltLabSuite/Core/Controller/Clipboard","WoltLabSuite/Core/Media/Editor","WoltLabSuite/Core/Media/List/Upload"],function(e,t,i,n){"use strict";var a;return{init:function(r){r=r||{},new n("uploadButton","mediaFile"),t.setup({hasMarkedItems:r.hasMarkedItems||!1,pageClassName:"wcf\\acp\\page\\MediaListPage"}),e.add("com.woltlab.wcf.clipboard","com.woltlab.wcf.media",this._clipboardAction.bind(this));var o=new WCF.Action.Delete("wcf\\data\\media\\MediaAction",".jsMediaRow");o.setCallback(t.reload.bind(t)),a=new i;for(var s=elByClass("jsMediaEditButton"),l=0,c=s.length;c>l;l++)s[l].addEventListener(WCF_CLICK_EVENT,this._edit.bind(this))},_clipboardAction:function(e){if(null!==e.responseData&&"com.woltlab.wcf.media.delete"===e.data.actionName){for(var t=e.responseData.objectIDs,i=elByClass("jsMediaRow"),n=0;n<i.length;n++){var a=i[n],r=~~elData(elByClass("jsClipboardItem",a)[0],"object-id");-1!==t.indexOf(r)&&(elRemove(a),n--)}i.length||window.location.reload()}},_edit:function(e){a.edit(elData(e.currentTarget,"object-id"))}}}),define("WoltLabSuite/Core/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(WCF_CLICK_EVENT,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(){elRemove(i.parentNode)}})}};return t}),define("WoltLabSuite/Core/Media/Manager/Search",["Ajax","Core","Dom/Traverse","Dom/Util","EventKey","Language","Ui/SimpleDropdown"],function(e,t,i,n,a,r,o){"use strict";function s(e){this._mediaManager=e,this._searchMode=!1,this._searchContainer=elByClass("mediaManagerSearch",e.getDialog())[0],this._input=elByClass("mediaManagerSearchField",e.getDialog())[0],this._input.addEventListener("keypress",this._keyPress.bind(this)),this._cancelButton=elByClass("mediaManagerSearchCancelButton",e.getDialog())[0],this._cancelButton.addEventListener(WCF_CLICK_EVENT,this._cancelSearch.bind(this))}return s.prototype={_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())},_keyPress:function(e){if(a.Enter(e)){e.preventDefault();var t=i.childByClass(this._input.parentNode.parentNode,"innerInfo");this._input.value.length>=this._mediaManager.getOption("minSearchLength")?(t&&elHide(t),this._search()):t?elShow(t):(t=elCreate("p"),t.className="innerInfo",t.textContent=r.get("wcf.media.search.info.searchStringThreshold"),n.insertAfter(t,this._input.parentNode))}},_search:function(){this._searchMode=!0,e.api(this,{parameters:{imagesOnly:this._mediaManager.getOption("imagesOnly"),mode:this._mediaManager.getMode(),searchString:this._input.value}})},hideSearch:function(){elHide(this._searchContainer)},resetSearch:function(){this._input.value=""},showSearch:function(){elShow(this._searchContainer)}},s}),define("WoltLabSuite/Core/Media/Manager/Base",["Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","List","Permission","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Controller/Clipboard","WoltLabSuite/Core/Media/Editor","WoltLabSuite/Core/Media/Upload","WoltLabSuite/Core/Media/Manager/Search","StringUtil"],function(e,t,i,n,a,r,o,s,l,c,d,u,h,p,f,m){"use strict";function g(n){this._options=e.extend({dialogTitle:o.get("wcf.media.manager"),imagesOnly:!1,minSearchLength:3},n),this._id="mediaManager"+v++,this._listItems=new t,this._media=new t,this._mediaCache=null,this._mediaManagerMediaList=null,this._search=null,this._forceClipboard=!1,this._hadInitiallyMarkedItems=!1,l.get("admin.content.cms.canManageMedia")&&(this._mediaEditor=new h(this)),i.add("WoltLabSuite/Core/Media/Manager",this._addButtonEventListeners.bind(this))}var v=0;return g.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("jsMediaEditButton",a)[0];r&&(r.classList.remove("jsMediaEditButton"),r.addEventListener(WCF_CLICK_EVENT,this._editMedia.bind(this)))}}},_click:function(e){e.preventDefault(),c.open(this)},_clipboardAction:function(e){if("com.woltlab.wcf.media.delete"===e.data.actionName&&null!==e.responseData){for(var t=e.responseData.objectIDs,i=0,n=t.length;n>i;i++)this.removeMedia(~~t[i],!0);d.show()}},_dialogClose:function(){(l.get("admin.content.cms.canManageMedia")||this._forceClipboard)&&u.hideEditor("com.woltlab.wcf.media")},_dialogInit:function(e,t){var i=t.returnValues.media||{};for(var n in i)objOwns(i,n)&&this._media.set(~~n,i[n]);this._hadInitiallyMarkedItems=t.returnValues.hasMarkedItems},_dialogSetup:function(){return{id:this._id,options:{onClose:this._dialogClose.bind(this),onShow:this._dialogShow.bind(this),title:this._options.dialogTitle},source:{after:this._dialogInit.bind(this),data:{actionName:"getManagementDialog",className:"wcf\\data\\media\\MediaAction",parameters:{mode:this.getMode(),imagesOnly:this._options.imagesOnly}}}}},_dialogShow:function(){if(!this._mediaManagerMediaList){this._mediaManagerMediaList=elByClass("mediaManagerMediaList",c.getDialog(this).dialog)[0];for(var e=n.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,i=e.length;i>t;t++){var o=e[t];this._listItems.set(~~elData(o,"object-id"),o)}if(l.get("admin.content.cms.canManageMedia")){var s=elByClass("mediaManagerMediaUploadButton",c.getDialog(this).dialog)[0];new p(a.identify(s),a.identify(this._mediaManagerMediaList),{mediaManager:this});var d=new WCF.Action.Delete("wcf\\data\\media\\MediaAction",".mediaFile");d._didTriggerEffect=function(e){this.removeMedia(elData(e[0],"object-id"),!0)}.bind(this)}l.get("admin.content.cms.canManageMedia")||this._forceClipboard?(r.add("com.woltlab.wcf.clipboard","com.woltlab.wcf.media",this._clipboardAction.bind(this)),u.setup({hasMarkedItems:this._hadInitiallyMarkedItems?!0:!1,pageClassName:"menuManagerDialog-"+this.getMode()})):this._removeClipboardCheckboxes(),this._search=new f(this),e.length||this._search.hideSearch()}(l.get("admin.content.cms.canManageMedia")||this._forceClipboard)&&u.showEditor("com.woltlab.wcf.media")},_editMedia:function(e){if(!l.get("admin.content.cms.canManageMedia"))throw new Error("You are not allowed to edit media files.");c.close(this),this._mediaEditor.edit(this._media.get(~~elData(e.currentTarget,"object-id")))},_editorClose:function(){c.open(this)},_editorSuccess:function(e){c.open(this),this._media.set(~~e.mediaID,e);var t=this._listItems.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},_removeClipboardCheckboxes:function(){for(var e=elByClass("mediaCheckbox",this._mediaManagerMediaList);e.length;)elRemove(e[0])},_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 c=n.childrenByTag(this._mediaManagerMediaList,"LI"),d=0,h=c.length;h>d;d++){var p=c[d];this._media.has(elData(p,"object-id"))?elShow(p):elHide(p)}i.trigger(),l.get("admin.content.cms.canManageMedia")||this._forceClipboard?u.reload():this._removeClipboardCheckboxes()},addMedia:function(e,t){e.languageID||(e.isMultilingual=1),
 this._media.set(~~e.mediaID,e),this._listItems.set(~~e.mediaID,t),1===this._listItems.size&&this._search.showSearch()},getDialog:function(){return c.getDialog(this).dialog},getMode:function(){return""},getOption:function(e){return this._options[e]?this._options[e]:null},removeMedia:function(e,t){if(this._listItems.has(e)){try{elRemove(this._listItems.get(e))}catch(i){}this._listItems["delete"](e),this._media["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._listItems.has(~~elData(c,"object-id"))||(this._listItems.set(elData(c,"object-id"),c),this._mediaManagerMediaList.appendChild(c))}}this._setMedia(e)},setupMediaElement:function(t,i){var a=n.childByClass(i,"mediaInformation"),r=elCreate("nav");r.className="jsMobileNavigation buttonGroupNavigation",a.parentNode.appendChild(r);var s=elCreate("ul");s.className="buttonList iconList",r.appendChild(s);var c=elCreate("li");c.className="mediaCheckbox",s.appendChild(c);var d=elCreate("a");c.appendChild(d);var u=elCreate("label");d.appendChild(u);var h=elCreate("input");if(h.className="jsClipboardItem",elAttr(h,"type","checkbox"),elData(h,"object-id",t.mediaID),u.appendChild(h),l.get("admin.content.cms.canManageMedia")){c=elCreate("li"),c.className="jsMediaEditButton",elData(c,"object-id",t.mediaID),s.appendChild(c),c.innerHTML='<a><span class="icon icon16 fa-pencil jsTooltip" title="'+o.get("wcf.global.button.edit")+'"></span> <span class="invisible">'+o.get("wcf.global.button.edit")+"</span></a>",c=elCreate("li"),c.className="jsDeleteButton",elData(c,"object-id",t.mediaID);var p=e.getUuid();elData(c,"confirm-message-html",m.unescapeHTML(o.get("wcf.media.delete.confirmMessage",{title:p})).replace(p,m.escapeHTML(t.filename))),s.appendChild(c),c.innerHTML='<a><span class="icon icon16 fa-times jsTooltip" title="'+o.get("wcf.global.button.delete")+'"></span> <span class="invisible">'+o.get("wcf.global.button.delete")+"</span></a>"}}},g}),define("WoltLabSuite/Core/Media/Manager/Editor",["Core","Dictionary","Dom/Traverse","Language","Ui/Dialog","WoltLabSuite/Core/Controller/Clipboard","WoltLabSuite/Core/Media/Manager/Base"],function(e,t,i,n,a,r,o){"use strict";function s(i){i=e.extend({callbackInsert:null},i),o.call(this,i),this._forceClipboard=!0,this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaEditorButton",this._options.editor.core.toolbar()[0]);for(var n=0,a=this._buttons.length;a>n;n++)this._buttons[n].addEventListener(WCF_CLICK_EVENT,this._click.bind(this));this._mediaToInsert=new t,this._mediaToInsertByClipboard=!1}return e.inherit(s,o,{_addButtonEventListeners:function(){if(s._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=i.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,n=e.length;n>t;t++){var a=e[t],r=elByClass("jsMediaInsertButton",a)[0];r&&(r.classList.remove("jsMediaInsertButton"),r.addEventListener(WCF_CLICK_EVENT,this._openInsertDialog.bind(this)))}},_buildInsertDialog:function(){for(var e="",t=this._getThumbnailSizes(),i=0,r=t.length;r>i;i++)e+='<option value="'+t[i]+'">'+n.get("wcf.media.insert.imageSize."+t[i])+"</option>";e+='<option value="original">'+n.get("wcf.media.insert.imageSize.original")+"</option>";var o='<div class="section"><dl class="thumbnailSizeSelection"><dt>'+n.get("wcf.media.insert.imageSize")+'</dt><dd><select name="thumbnailSize">'+e+'</select></dd></dl></div><div class="formSubmit"><button class="buttonPrimary">'+n.get("wcf.global.button.insert")+"</button></div>";a.open({_dialogSetup:function(){return{id:this._getInsertDialogId(),options:{onClose:this._editorClose.bind(this),onSetup:function(e){elByClass("buttonPrimary",e)[0].addEventListener(WCF_CLICK_EVENT,this._insertMedia.bind(this));var t=elBySel(".thumbnailSizeSelection",e);elShow(t)}.bind(this),title:n.get("wcf.media.insert")},source:o}}.bind(this)})},_click:function(e){this._activeButton=e.currentTarget,s._super.prototype._click.call(this,e)},_clipboardAction:function(e){s._super.prototype._clipboardAction.call(this,e),"com.woltlab.wcf.media.insert"===e.data.actionName&&this.insertMedia(e.data.parameters.objectIDs,!0)},_getInsertDialogId:function(){var e="mediaInsert";return this._mediaToInsert.forEach(function(t,i){e+="-"+i}),e},_getThumbnailSizes:function(){for(var e,t,i=[],n=["small","medium","large"],a=0,r=n.length;r>a;a++)e=n[a],t=!0,this._mediaToInsert.forEach(function(i){i[e+"ThumbnailType"]||(t=!1)}),t&&i.push(e);return i},_insertMedia:function(e,i){var n="separate";if(e){a.close(this._getInsertDialogId());var o=e.currentTarget.closest(".dialogContent");i=elBySel("select[name=thumbnailSize]",o).value}if(null!==this._options.callbackInsert?this._options.callbackInsert(this._mediaToInsert,n,i):"separate"===n?(this._options.editor.buffer.set(),this._mediaToInsert.forEach(this._insertMediaItem.bind(this,i))):this._insertMediaGallery(),this._mediaToInsertByClipboard){var s=[];this._mediaToInsert.forEach(function(e){s.push(e.mediaID)}),r.unmark("com.woltlab.wcf.media",s)}this._mediaToInsert=new t,this._mediaToInsertByClipboard=!1,a.close(this)},_insertMediaGallery:function(){var e=[];this._mediaToInsert.forEach(function(t){e.push(t.mediaID)}),this._options.editor.buffer.set(),this._options.editor.insert.text("[wsmg='"+e.join(",")+"'][/wsmg]")},_insertMediaItem:function(e,t){if(t.isImage){for(var i,n=["small","medium","large","original"],a="",r=0;4>r&&(i=n[r],0==t[i+"ThumbnailHeight"]||(a=i,e!=i));r++);e=a,e||(e="original");var o=t.link;"original"!==e&&(o=t[e+"ThumbnailLink"]),this._options.editor.insert.html('<img src="'+o+'" class="woltlabSuiteMedia" data-media-id="'+t.mediaID+'" data-media-size="'+e+'">')}else this._options.editor.insert.text("[wsm='"+t.mediaID+"'][/wsm]")},_openInsertDialog:function(e){this.insertMedia([~~elData(e.currentTarget,"object-id")])},insertMedia:function(e,i){this._mediaToInsert=new t,this._mediaToInsertByClipboard=i||!1;for(var n,r=!0,o=0,s=e.length;s>o;o++)n=this._media.get(e[o]),this._mediaToInsert.set(n.mediaID,n),n.isImage||(r=!1);if(r){var l=this._getThumbnailSizes();if(l.length){a.close(this);var c=this._getInsertDialogId();a.getDialog(c)?a.openStatic(c):this._buildInsertDialog()}else this._insertMedia(void 0,"original")}else this._insertMedia()},getMode:function(){return"editor"},setupMediaElement:function(e,t){s._super.prototype.setupMediaElement.call(this,e,t);var i=elBySel("nav.buttonGroupNavigation > ul",t),a=elCreate("li");i.appendChild(a),a.innerHTML='<a><span class="icon icon16 fa-plus jsTooltip jsMediaInsertButton" data-object-id="'+e.mediaID+'" title="'+n.get("wcf.media.button.insert")+'"></span> <span class="invisible">'+n.get("wcf.media.button.insert")+"</span></a>"}}),s}),define("WoltLabSuite/Core/Media/Manager/Select",["Core","Dom/Traverse","Dom/Util","Language","ObjectMap","Ui/Dialog","WoltLabSuite/Core/Media/Manager/Base"],function(e,t,i,n,a,r,o){"use strict";function s(e){o.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaSelectButton"),this._storeElements=new a;for(var t=0,n=this._buttons.length;n>t;t++){var r=this._buttons[t],s=elData(r,"store");if(s){var l=elById(s);if(l&&"INPUT"===l.tagName){this._buttons[t].addEventListener(WCF_CLICK_EVENT,this._click.bind(this)),this._storeElements.set(r,l);var c=elCreate("p");c.className="button",i.insertAfter(c,r);var d=elCreate("span");d.className="icon icon16 fa-times",c.appendChild(d),l.value||elHide(c),c.addEventListener(WCF_CLICK_EVENT,this._removeMedia.bind(this))}}}}return e.inherit(s,o,{_addButtonEventListeners:function(){if(s._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("jsMediaSelectButton",a)[0];r&&(r.classList.remove("jsMediaSelectButton"),r.addEventListener(WCF_CLICK_EVENT,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._media.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?t.smallThumbnailLink:t.link)+'" alt="'+(t.altText&&t.altText[LANGUAGE_ID]?t.altText[LANGUAGE_ID]:"")+'" />':n.innerHTML='<div class="box48" style="margin-bottom: 10px;"><span class="icon icon48 fa-file-o"></span><div class="containerHeadline"><h3>'+t.filename+"</h3><p>"+t.formattedFilesize+"</p></div></div>")}elShow(this._activeButton.nextElementSibling),r.close(this)},_click:function(e){if(e.preventDefault(),this._activeButton=e.currentTarget,s._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,o=a.length;o>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){s._super.prototype.setupMediaElement.call(this,e,t);var i=elBySel("nav.buttonGroupNavigation > ul",t),a=elCreate("li");a.className="jsMediaSelectButton",elData(a,"object-id",e.mediaID),i.appendChild(a),a.innerHTML='<a><span class="icon icon16 fa-check jsTooltip" title="'+n.get("wcf.media.button.select")+'"></span> <span class="invisible">'+n.get("wcf.media.button.select")+"</span></a>"},_removeMedia:function(e){e.preventDefault();var t=e.currentTarget;elHide(t);var i=t.previousElementSibling;elById(elData(i,"store")).value=0;var n=elData(i,"display");if(n){var a=elById(n);a&&(a.innerHTML="")}}}),s}),define("WoltLabSuite/Core/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),this._activeItem=null)):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("WoltLabSuite/Core/Ui/User/Search/Input",["Core","WoltLabSuite/Core/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);elData(t,"type",e.type);var 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("WoltLabSuite/Core/Ui/Acl/Simple",["Language","Dom/ChangeListener","WoltLabSuite/Core/Ui/User/Search/Input"],function(e,t,i){"use strict";function n(e){this.init(e)}return n.prototype={init:function(e){this._prefix=e||"",this._build()},_build:function(){var e=elById(this._prefix+"aclInputContainer");elById(this._prefix+"aclAllowAll").addEventListener("change",function(){elHide(e)}),elById(this._prefix+"aclAllowAll_no").addEventListener("change",function(){elShow(e)}),new i(elById(this._prefix+"aclSearchInput"),{callbackSelect:this._select.bind(this),includeUserGroups:!0,preventSubmit:!0}),this._aclListContainer=elById(this._prefix+"aclListContainer"),this._list=elById(this._prefix+"aclAccessList"),this._list.addEventListener(WCF_CLICK_EVENT,this._removeItem.bind(this)),t.trigger()},_select:function(i){var n=elData(i,"type"),a='<span class="icon icon16 fa-'+("group"===n?"users":"user")+'"></span>';a+='<span class="aclLabel">'+elData(i,"label")+"</span>",a+='<span class="icon icon16 fa-times pointer jsTooltip" title="'+e.get("wcf.global.button.delete")+'"></span>',a+='<input type="hidden" name="aclValues['+n+'][]" value="'+elData(i,"object-id")+'">';var r=elCreate("li");r.innerHTML=a;var o=elBySel(".fa-user",this._list);return null===o?this._list.appendChild(r):this._list.insertBefore(r,o.parentNode),elShow(this._aclListContainer),t.trigger(),!1},_removeItem:function(e){e.target.classList.contains("fa-times")&&(elRemove(e.target.parentNode),0===this._list.childElementCount&&elHide(this._aclListContainer))}},n}),define("WoltLabSuite/Core/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("WoltLabSuite/Core/Ui/ItemList/Filter",["EventKey","Language","List","StringUtil","Dom/Util"],function(e,t,i,n,a){"use strict";function r(e){this.init(e)}return r.prototype={init:function(i){this._value="";var n=elById(i);if(null===n)throw new Error("Expected a valid element id, '"+i+"' does not match anything.");if(!n.classList.contains("scrollableCheckboxList"))throw new Error("Filter only works with elements with the CSS class 'scrollableCheckboxList'.");var a=elCreate("div");a.className="itemListFilter",n.parentNode.insertBefore(a,n),a.appendChild(n);var r=elCreate("div");r.className="inputAddon";var o=elCreate("input");o.className="long",o.type="text",o.placeholder=t.get("wcf.global.filter.placeholder"),o.addEventListener("keydown",function(t){e.Enter(t)&&t.preventDefault()}),o.addEventListener("keyup",this._keyup.bind(this));var s=elCreate("a");s.href="#",s.className="button inputSuffix jsTooltip",s.title=t.get("wcf.global.filter.button.clear"),s.innerHTML='<span class="icon icon16 fa-times"></span>',s.addEventListener("click",function(e){e.preventDefault(),this._input.value="",this._keyup()}.bind(this)),r.appendChild(o),r.appendChild(s),a.appendChild(r),this._container=a,this._element=n,this._input=o,this._items=null,this._fragment=null},_buildItems:function(){this._items=new i;for(var e,t=0,n=this._element.childElementCount;n>t;t++){e=this._element.children[t];for(var a=e.children[0],r=a.textContent.trim(),o=a.children[0];o.nextSibling;)a.removeChild(o.nextSibling);a.appendChild(document.createTextNode(" "));var s=elCreate("span");s.textContent=r,a.appendChild(s),this._items.add({item:e,span:s,text:r})}},_keyup:function(){var e=this._input.value.trim();if(this._value!==e){null===this._fragment&&(this._fragment=document.createDocumentFragment(),this._element.style.setProperty("height",this._element.offsetHeight+"px","")),this._fragment.appendChild(this._element),null===this._items&&this._buildItems();var i=new RegExp("("+n.escapeRegExp(e)+")","i"),r=""===e;this._items.forEach(function(t){""===e?(t.span.textContent=t.text,elShow(t.item)):i.test(t.text)?(t.span.innerHTML=t.text.replace(i,"<u>$1</u>"),elShow(t.item),r=!0):elHide(t.item)}),this._container.insertBefore(this._fragment.firstChild,this._container.firstChild),this._value=e;var o=this._container.nextElementSibling;o&&!o.classList.contains("innerError")&&(o=null),r?o&&elRemove(o):o||(o=elCreate("small"),o.className="innerError",o.textContent=t.get("wcf.global.filter.error.noMatches"),a.insertAfter(o,this._container))}}},r}),define("WoltLabSuite/Core/Ui/ItemList/User",["WoltLabSuite/Core/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("WoltLabSuite/Core/Ui/User/List",["Ajax","Core","Dictionary","Dom/Util","Ui/Dialog","WoltLabSuite/Core/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("WoltLabSuite/Core/Ui/Like/Handler",["Ajax","Core","Dictionary","Language","ObjectMap","StringUtil","Dom/ChangeListener","Dom/Util","Ui/Dialog","WoltLabSuite/Core/Ui/User/List","User"],function(e,t,i,n,a,r,o,s,l,c,d){"use strict";function u(e,t){this.init(e,t)}var h=!1;return u.prototype={init:function(e,i){if(""===i.containerSelector)throw new Error("[WoltLabSuite/Core/Ui/Like/Handler] Expected a non-empty 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("WoltLabSuite/Core/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=this._options.isSingleItem?elBySel(this._options.summarySelector):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(WCF_CLICK_EVENT,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=this._options.isSingleItem?elBySel(this._options.badgeContainerSelector):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(WCF_CLICK_EVENT,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)),this._options.canLike&&(d.userId!=elData(e,"user-id")||this._options.canLikeOwnContent)){var u=this._options.buttonAppendToSelector?this._options.isSingleItem?elBySel(this._options.buttonAppendToSelector):elBySel(this._options.buttonAppendToSelector,e):null,h=this._options.buttonBeforeSelector?this._options.isSingleItem?elBySel(this._options.buttonBeforeSelector):elBySel(this._options.buttonBeforeSelector,e):null;if(null===h&&null===u)throw new Error("Unable to find insert location for like/dislike buttons.");t.likeButton=this._createButton(e,!0,h,u),this._options.canDislike&&(t.dislikeButton=this._createButton(e,!1,h,u)),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> <span class="invisible">'+r+"</span>",s.addEventListener(WCF_CLICK_EVENT,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),t.badge.classList.remove("likeCounterLiked","likeCounterDisliked");var i=t.likes-t.dislikes,a='<span class="icon icon16 fa-thumbs-o-'+(0>i?"down":"up")+'"></span><span class="wcfLikeValue">';i>0?(a+="+"+r.addThousandsSeparator(i),t.badge.classList.add("likeCounterLiked")):0>i?(a+="−"+r.addThousandsSeparator(Math.abs(i)),t.badge.classList.add("likeCounterDisliked")):a+="±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.likeButton.parentNode:t.likeButton;if(i.classList.remove("active"),1===t.liked&&i.classList.add("active"),this._options.canDislike){var n=this._options.markListItemAsActive?t.dislikeButton.parentNode:t.dislikeButton;n.classList.remove("active"),-1===t.liked&&n.classList.add("active")}},_like:function(t,i){i.preventDefault(),h||(h=!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),h=!1}},_ajaxSetup:function(){return{data:{className:"wcf\\data\\like\\LikeAction"}}}},u}),define("WoltLabSuite/Core/Ui/Message/InlineEditor",["Ajax","Core","Dictionary","Environment","EventHandler","Language","ObjectMap","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/Notification","Ui/ReusableDropdown","WoltLabSuite/Core/Ui/Scroll"],function(e,t,i,n,a,r,o,s,l,c,d,u,h){"use strict";function p(e){this.init(e)}return p.prototype={init:function(e){this._activeDropdownElement=null,this._activeElement=null,this._dropdownMenu=null,this._elements=new o,this._options=t.extend({canEditInline:!1,className:"",containerId:0,dropdownIdentifier:"",editorPrefix:"messageEditor",messageSelector:".jsMessage",quoteManager:null},e),this.rebuild(),s.add("Ui/Message/InlineEdit_"+this._options.className,this.rebuild.bind(this))},rebuild: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||elDataBool(i,"can-edit-inline")?(e.addEventListener(WCF_CLICK_EVENT,this._clickDropdown.bind(this,i)),e.classList.add("jsDropdownEnabled"),t&&e.addEventListener("dblclick",this._click.bind(this,i))):t&&e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,i)));var o=elBySel(".messageBody",i),s=elBySel(".messageFooter",i),l=elBySel(".messageHeader",i);this._elements.set(i,{button:e,messageBody:o,messageBodyEditor:null,messageFooter:s,messageFooterButtons:elBySel(".messageFooterButtons",s),messageHeader:l,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)}})):d.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(WCF_CLICK_EVENT,function(i){i.preventDefault(),i.stopPropagation(),this._activeDropdownElement=t,u.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),u.init(this._options.dropdownIdentifier,this._dropdownMenu),u.registerCallback(this._options.dropdownIdentifier,this._dropdownToggle.bind(this))}setTimeout(function(){t.triggerEvent(n,WCF_CLICK_EVENT)},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(WCF_CLICK_EVENT,this._click.bind(this,null)):n.addEventListener(WCF_CLICK_EVENT,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),l>0&&l+1===this._dropdownMenu.childElementCount&&"divider"===elData(o.previousElementSibling,"item")&&elHide(o.previousElementSibling)):(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),c.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=l.childByClass(i.messageBodyEditor,"icon");elRemove(r);var o=i.messageBodyEditor,s=elCreate("div");s.className="editorContainer",c.setInnerHtml(s,e.returnValues.template),o.appendChild(s);var d=elBySel(".formSubmit",s),u=elBySel('button[data-type="save"]',d);u.addEventListener(WCF_CLICK_EVENT,this._save.bind(this));var p=elBySel('button[data-type="cancel"]',d);p.addEventListener(WCF_CLICK_EVENT,this._restoreMessage.bind(this)),a.add("com.woltlab.wcf.redactor","submitEditor_"+t,function(e){e.cancel=!0,this._save()}.bind(this)),elHide(i.messageHeader),elHide(i.messageFooter);var f=elById(t);"redactor"===n.editor()?window.setTimeout(function(){this._options.quoteManager&&this._options.quoteManager.setAlternativeEditor(t),h.element(this._activeElement)}.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),elShow(e.messageHeader),this._activeElement.classList.remove("jsInvalidQuoteTarget"),this._activeElement=null,this._options.quoteManager&&this._options.quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[]},i=this._getEditorId(),n=elById("settings_"+i);n&&elBySelAll("input, select, textarea",n,function(e){if("INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||e.checked){var i=e.name;if(t.hasOwnProperty(i))throw new Error("Variable overshadowing, key '"+i+"' is already present.");t[i]=e.value.trim()}}),a.fire("com.woltlab.wcf.redactor2","getText_"+i,t.data),this._validate(t)&&(a.fire("com.woltlab.wcf.redactor2","submit_"+i,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor())},_validate:function(e){for(var t=elByClass("innerError",this._activeElement);t.length;)elRemove(t[0]);var i={api:this,parameters:e,valid:!0};return a.fire("com.woltlab.wcf.redactor2","validate_"+this._getEditorId(),i),i.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,c.insertAfter(i,e)},_showMessage:function(e){var t=this._activeElement,i=this._getEditorId(),n=this._elements.get(t),r=elBySelAll(".attachmentThumbnailList, .attachmentFileList",n.messageFooter);if(c.setInnerHtml(l.childByClass(n.messageBody,"messageText"),e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var o=0,s=r.length;s>o;o++)elRemove(r[o]);var u=elCreate("div");c.setInnerHtml(u,e.returnValues.attachmentList);for(var h;u.childNodes.length;)h=u.childNodes[u.childNodes.length-1],n.messageFooter.insertBefore(h,n.messageFooter.firstChild)}if("string"==typeof e.returnValues.poll){var p=elBySel(".pollContainer",n.messageBody);null!==p&&elRemove(p.parentNode);var f=elCreate("div");f.className="jsInlineEditorHideContent",c.setInnerHtml(f,e.returnValues.poll),c.prepend(f,n.messageBody)}this._restoreMessage(),this._updateHistory(this._getHash(this._getObjectId(t))),a.fire("com.woltlab.wcf.redactor","autosaveDestroy_"+i),d.show(),this._options.quoteManager&&(this._options.quoteManager.clearAlternativeEditor(),this._options.quoteManager.countQuotes())},_hideEditor:function(){var e=this._elements.get(this._activeElement);elHide(l.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=l.childByClass(e.messageBodyEditor,"editorContainer");null!==i&&elShow(i)},_destroyEditor:function(){a.fire("com.woltlab.wcf.redactor2","autosaveDestroy_"+this._getEditorId()),a.fire("com.woltlab.wcf.redactor2","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",c.insertAfter(n,i)),n.textContent=e.returnValues.errorType,!1},_ajaxSuccess:function(e){switch(e.actionName){case"beginEdit":this._showEditor(e);break;case"save":this._showMessage(e)}},_ajaxSetup:function(){return{data:{className:this._options.className,interfaceName:"wcf\\data\\IMessageInlineEditorAction"}}},legacyEdit:function(e){this._click(elById(e),null)}},p}),define("WoltLabSuite/Core/Ui/Message/Manager",["Ajax","Core","Dictionary","Language","Dom/ChangeListener","Dom/Util"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._elements=null,this._options=t.extend({className:"",selector:""},e),this.rebuild(),a.add("Ui/Message/Manager"+this._options.className,this.rebuild.bind(this))},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)t.hasOwnProperty(r)&&this._update(i,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,i){t.push(i)}.bind(this)),this.updateItems(t,e)},setNote: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+"'");var a=elBySel(".messageFooterNotes",n),r=elBySel("."+t,a);i?(null===r&&(r=elCreate("p"),r.className="messageFooterNote "+t,a.appendChild(r)),r.innerHTML=i):null!==r&&elRemove(r)},_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"),this._toggleMessageStatus(e,"jsIconDeleted","wcf.message.status.deleted","red",n);break;case"isDisabled":e.classList[n?"add":"remove"]("messageDisabled"),this._toggleMessageStatus(e,"jsIconDisabled","wcf.message.status.disabled","green",n)}},_toggleMessageStatus:function(e,t,i,a,o){var s=elBySel(".messageStatus",e);if(null===s){var l=elBySel(".messageHeaderMetaData",e);if(null===l)return;s=elCreate("ul"),s.className="messageStatus",r.insertAfter(s,l)}var c=elBySel("."+t,s);if(o){if(null!==c)return;c=elCreate("span"),c.className="badge label "+a+" "+t,c.textContent=n.get(i);var d=elCreate("li");d.appendChild(c),s.appendChild(d)}else{if(null===c)return;elRemove(c.parentNode)}},_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(){throw new Error("Method _ajaxSuccess() must be implemented by deriving functions.")},_ajaxSetup:function(){return{data:{className:this._options.className}}}},o}),define("WoltLabSuite/Core/Ui/Message/Reply",["Ajax","Core","EventHandler","Language","Dom/ChangeListener","Dom/Util","Dom/Traverse","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Ui/Scroll","EventKey","User","WoltLabSuite/Core/Controller/Captcha"],function(e,t,i,n,a,r,o,s,l,c,d,u,h){"use strict";function p(e){this.init(e)}return p.prototype={init:function(e){this._options=t.extend({ajax:{className:""},quoteManager:null,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,o=a.length;o>r;r++)a[r].addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this._getEditor().WoltLabReply.showEditor(),c.element(this._container,function(){this._getEditor().WoltLabCaret.endOfEditor()}.bind(this))}.bind(this))},_submitGuestDialog:function(e){if("keypress"!==e.type||d.Enter(e)){var i=elBySel("input[name=username]",e.currentTarget.closest(".dialogContent"));if(""===i.value){var a=o.nextByClass(i,"innerError");return void(a||(a=elCreate("small"),a.className="innerError",a.innerText=n.get("wcf.global.form.error.empty"),r.insertAfter(a,i),i.closest("dl").classList.add("formError")))}var s={parameters:{data:{username:i.value}}},l=elData(e.currentTarget,"captcha-id");h.has(l)&&(s=t.extend(s,h.getData(l))),this._submit(void 0,s)}},_submit:function(n,a){if(n&&n.preventDefault(),this._validate()){this._showLoadingOverlay();var o=r.getDataAttributes(this._container,"data-",!0,!0);o.data={message:this._getEditor().code.get()},o.removeQuoteIDs=this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[];var s=elById("settings_text");s&&elBySelAll("input, select, textarea",s,function(e){if("INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||e.checked){var t=e.name;if(o.hasOwnProperty(t))throw new Error("Variable overshadowing, key '"+t+"' is already present.");o[t]=e.value.trim()}}),i.fire("com.woltlab.wcf.redactor2","submit_text",o.data),u.userId||a||(o.requireGuestDialog=!0),e.api(this,t.extend({parameters:o},a))}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)elRemove(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="empty"===t?n.get("wcf.global.form.error.empty"):t,r.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(this._getEditor().WoltLabAutosave.reset(),e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t;if("DESC"===elData(this._container,"sort-order"))r.insertHtml(e.returnValues.template,this._container,"after"),t=r.identify(this._container.nextElementSibling);else{var i=this._container;i.previousElementSibling&&i.previousElementSibling.classList.contains("messageListPagination")&&(i=i.previousElementSibling),r.insertHtml(e.returnValues.template,i,"before"),t=r.identify(i.previousElementSibling)}elData(this._container,"last-post-time",e.returnValues.lastPostTime),window.history.replaceState(void 0,"","#"+t),c.element(elById(t))}l.show(n.get(this._options.successMessage)),this._options.quoteManager&&this._options.quoteManager.countQuotes(),a.trigger()}},_ajaxSuccess:function(e){if(!u.userId&&!e.returnValues.guestDialogID)throw new Error("Missing 'guestDialogID' return value for guest.");if(!u.userId&&e.returnValues.guestDialog){s.openStatic(e.returnValues.guestDialogID,e.returnValues.guestDialog,{closable:!1,title:n.get("wcf.global.confirmation.title")});var t=s.getDialog(e.returnValues.guestDialogID);elBySel("input[type=submit]",t.content).addEventListener(WCF_CLICK_EVENT,this._submitGuestDialog.bind(this)),elBySel("input[type=text]",t.content).addEventListener("keypress",this._submitGuestDialog.bind(this))}else this._insertMessage(e),u.userId||s.close(e.returnValues.guestDialogID),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{silent:!0,data:{actionName:"quickReply",className:this._options.ajax.className,interfaceName:"wcf\\data\\IMessageQuickReplyAction"}}}},p}),define("WoltLabSuite/Core/Ui/Message/Share",["EventHandler"],function(e){"use strict";return{_pageDescription:"",_pageUrl:"",init:function(){var t=elBySel('meta[property="og:title"]');null!==t&&(this._pageDescription=encodeURIComponent(t.content));var i=elBySel('meta[property="og:url"]');null!==i&&(this._pageUrl=encodeURIComponent(i.content)),elBySelAll(".jsMessageShareButtons",null,function(t){t.classList.remove("jsMessageShareButtons");var i={facebook:{link:elBySel(".jsShareFacebook",t),share:function(){this._share("facebook","https://www.facebook.com/sharer.php?u={pageURL}&t={text}",!0)}.bind(this)},google:{link:elBySel(".jsShareGoogle",t),share:function(){this._share("google","https://plus.google.com/share?url={pageURL}",!1)}.bind(this)},reddit:{link:elBySel(".jsShareReddit",t),share:function(){this._share("reddit","https://ssl.reddit.com/submit?url={pageURL}",!1)}.bind(this)},twitter:{link:elBySel(".jsShareTwitter",t),share:function(){this._share("twitter","https://twitter.com/share?url={pageURL}&text={text}",!1)}.bind(this)},linkedIn:{link:elBySel(".jsShareLinkedIn",t),share:function(){this._share("linkedIn","https://www.linkedin.com/cws/share?url={pageURL}",!1)}.bind(this)},pinterest:{link:elBySel(".jsSharePinterest",t),share:function(){this._share("pinterest","https://www.pinterest.com/pin/create/link/?url={pageURL}&description={text}",!1)}.bind(this)},xing:{link:elBySel(".jsShareXing",t),share:function(){this._share("xing","https://www.xing.com/social_plugins/share?url={pageURL}",!1)}.bind(this)},whatsApp:{link:elBySel(".jsShareWhatsApp",t),share:function(){window.location.href="whatsapp://send?text="+this._pageDescription+"%20"+this._pageUrl}.bind(this)}};e.fire("com.woltlab.wcf.message.share","shareProvider",{container:t,providers:i,pageDescription:this._pageDescription,pageUrl:this._pageUrl});for(var n in i)i.hasOwnProperty(n)&&null!==i[n].link&&i[n].link.addEventListener(WCF_CLICK_EVENT,i[n].share)}.bind(this))},_share:function(e,t,i){window.open(t.replace(/\{pageURL}/,this._pageUrl).replace(/\{text}/,this._pageDescription+(i?"%20"+this._pageUrl:"")),e,"height=600,width=600")}}}),define("WoltLabSuite/Core/Ui/Page/Search",["Ajax","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r){"use strict";var o,s,l,c=null;return{open:function(e){o=e,r.open(this)},_search:function(t){t.preventDefault();var n=c.parentNode,r=n.nextSibling;r&&"SMALL"===r.nodeName&&elRemove(r);var o=c.value.trim();return o.length<3?(r=elCreate("small"),r.className="innerError",r.textContent=i.get("wcf.page.search.error.tooShort"),void a.insertAfter(r,n)):void e.api(this,{parameters:{searchString:o}})},_click:function(e){e.preventDefault(),o(elData(e.currentTarget,"page-id")),r.close(this)},_ajaxSuccess:function(e){for(var t,r="",o=0,d=e.returnValues.length;d>o;o++)t=e.returnValues[o],r+='<li><div class="containerHeadline pointer" data-page-id="'+t.pageID+'"><h3>'+n.escapeHTML(t.name)+"</h3><small>"+n.escapeHTML(t.displayLink)+"</small></div></li>";if(l.innerHTML=r,window[r?"elShow":"elHide"](s),r)elBySelAll(".containerHeadline",l,function(e){e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))}.bind(this));else{var u=elCreate("small");u.className="innerError",u.textContent=i.get("wcf.page.search.error.noResults"),a.insertAfter(u,c.parentNode)}},_ajaxSetup:function(){return{data:{actionName:"search",className:"wcf\\data\\page\\PageAction"}}},_dialogSetup:function(){return{id:"wcfUiPageSearch",options:{onSetup:function(){var e=this._search.bind(this);c=elById("wcfUiPageSearchInput"),c.addEventListener("keydown",function(i){t.Enter(i)&&e(i)}),c.nextElementSibling.addEventListener(WCF_CLICK_EVENT,e),s=elById("wcfUiPageSearchResultContainer"),l=elById("wcfUiPageSearchResultList")}.bind(this),onShow:function(){c.focus()},title:i.get("wcf.page.search")},source:'<div class="section"><dl><dt><label for="wcfUiPageSearchInput">'+i.get("wcf.page.search.name")+'</label></dt><dd><div class="inputAddon"><input type="text" id="wcfUiPageSearchInput" class="long"><a href="#" class="inputSuffix"><span class="icon icon16 fa-search"></span></a></div></dd></dl></div><section id="wcfUiPageSearchResultContainer" class="section" style="display: none;"><header class="sectionHeader"><h2 class="sectionTitle">'+i.get("wcf.page.search.results")+'</h2></header><ol id="wcfUiPageSearchResultList" class="containerList"></ol></section>'}}}}),define("WoltLabSuite/Core/Ui/Redactor/Autosave",["Language","Dom/Traverse"],function(e,t){"use strict";function i(e){this.init(e)}var n=15,a="wsc"+window.WCF_PATH.hashCode()+"-";return i.prototype={init:function(e){this._container=null,this._editor=null,this._element=e,this._key=a+elData(this._element,"autosave"),this._lastMessage="",this._originalMessage="",this._overlay=null,this._restored=!1,this._timer=null,this._cleanup(),this._element.removeAttribute("data-autosave");var i=t.parentByTag(this._element,"FORM");null!==i&&i.addEventListener("submit",this.destroy.bind(this))},getInitialValue:function(){var e="";try{e=window.localStorage.getItem(this._key)}catch(t){window.console.warn("Unable to access local storage: "+t.message)}try{e=JSON.parse(e)}catch(t){e=""}if(null!==e&&"object"==typeof e&&e.content){var i=~~elData(this._element,"autosave-last-edit-time");if(1e3*i<=e.timestamp)return this._originalMessage=this._element.value,this._restored=!0,e.content}return this._element.value},watch:function(e){if(this._editor=e,null!==this._timer)throw new Error("Autosave timer is already active.");this._timer=window.setInterval(this._saveToStorage.bind(this),1e3*n),this._saveToStorage()},destroy:function(){this.clear(),this._editor=null,window.clearInterval(this._timer),this._timer=null},clear:function(){this._lastMessage="";try{window.localStorage.removeItem(this._key)}catch(e){window.console.warn("Unable to remove from local storage: "+e.message)}},createOverlay:function(){if(this._restored){var t=elCreate("div");t.className="redactorAutosaveRestored active";var i=elCreate("span");i.textContent=e.get("wcf.editor.autosave.restored"),t.appendChild(i);var n=elCreate("a");n.className="jsTooltip",n.href="#",n.title=e.get("wcf.editor.autosave.keep"),n.innerHTML='<span class="icon icon16 fa-check green"></span>',n.addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this.hideOverlay()}.bind(this)),t.appendChild(n),n=elCreate("a"),n.className="jsTooltip",n.href="#",n.title=e.get("wcf.editor.autosave.discard"),n.innerHTML='<span class="icon icon16 fa-times red"></span>',n.addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this.clear(),this._editor.code.start(this._originalMessage),this._editor.core.textarea().val(this._editor.clean.onSync(this._editor.$editor.html())),this.hideOverlay()}.bind(this)),t.appendChild(n),this._editor.core.box()[0].appendChild(t);var a=function(){this._editor.core.editor()[0].removeEventListener(WCF_CLICK_EVENT,a),this.hideOverlay()}.bind(this);this._editor.core.editor()[0].addEventListener(WCF_CLICK_EVENT,a),this._container=t}},hideOverlay:function(){null!==this._container&&(this._container.classList.remove("active"),window.setTimeout(function(){null!==this._container&&elRemove(this._container),this._container=null,this._originalMessage=""}.bind(this),1e3))},_saveToStorage:function(){var e=this._editor.code.get();if(this._editor.utils.isEmpty(e)&&(e=""),this._lastMessage!==e){if(""===e)return this.clear();try{window.localStorage.setItem(this._key,JSON.stringify({content:e,timestamp:Date.now()})),this._lastMessage=e}catch(t){window.console.warn("Unable to write to local storage: "+t.message)}}},_cleanup:function(){var e,t,i,n,r=Date.now()-6048e5,o=[];for(e=0,i=window.localStorage.length;i>e;e++)if(t=window.localStorage.key(e),0===t.indexOf(a)){try{n=window.localStorage.getItem(t)}catch(s){window.console.warn("Unable to access local storage: "+s.message)}try{n=JSON.parse(n)}catch(s){n={timestamp:0}}(!n||n.timestamp<r)&&o.push(t)}for(e=0,i=o.length;i>e;e++)try{window.localStorage.removeItem(o[e])}catch(s){window.console.warn("Unable to remove from local storage: "+s.message)}}},i}),define("WoltLabSuite/Core/Ui/Redactor/PseudoHeader",[],function(){"use strict";return{getHeight:function(e){var t=~~window.getComputedStyle(e).paddingTop.replace(/px$/,""),i=window.getComputedStyle(e,"::before");t+=~~i.paddingTop.replace(/px$/,""),t+=~~i.paddingBottom.replace(/px$/,"");var n=~~i.height.replace(/px$/,"");return 0===n&&(n=e.scrollHeight,e.classList.add("redactorCalcHeight"),n-=e.scrollHeight,e.classList.remove("redactorCalcHeight")),t+=n}}}),define("WoltLabSuite/Core/Ui/Redactor/Code",["EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog","./PseudoHeader"],function(e,t,i,n,a,r,o){"use strict";function s(e){this.init(e)}var l=0;return s.prototype={init:function(t){this._editor=t,this._elementId=this._editor.$element[0].id,this._pre=null,e.add("com.woltlab.wcf.redactor2","bbcode_code_"+this._elementId,this._bbcodeCode.bind(this)),e.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.opts.activeButtonsStates.pre="code",this._callbackEdit=this._edit.bind(this),this._observeLoad()},_bbcodeCode:function(e){e.cancel=!0,this._editor.button.toggle({},"pre","func","block.format");var t=this._editor.selection.block();t&&"PRE"===t.nodeName&&(1===t.childElementCount&&"BR"===t.children[0].nodeName&&t.removeChild(t.children[0]),this._setTitle(t),t.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._editor.caret.end(t))},_observeLoad:function(){elBySelAll("pre",this._editor.$editor[0],function(e){e.addEventListener("mousedown",this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;0===l&&(l=o.getHeight(t));var i=a.offset(t);e.pageY>i.top&&e.pageY<i.top+l&&(e.preventDefault(),this._editor.selection.save(),this._pre=t,r.open(this))},_save:function(e){e.preventDefault();var t="redactor-code-"+this._elementId;["file","highlighter","line"].forEach(function(e){elData(this._pre,e,elById(t+"-"+e).value)}.bind(this)),this._setTitle(this._pre),this._editor.caret.after(this._pre),r.close(this)},_setTitle:function(e){var t=elData(e,"file"),n=elData(e,"highlighter");n=this._editor.opts.woltlab.highlighters.hasOwnProperty(n)?this._editor.opts.woltlab.highlighters[n]:"";var a=i.get("wcf.editor.code.title",{file:t,highlighter:n});elData(e,"title")!==a&&elData(e,"title",a)},_delete:function(e){e.preventDefault();var t=this._pre.nextElementSibling||this._pre.previousElementSibling;null===t&&this._pre.parentNode!==this._editor.core.editor()[0]&&(t=this._pre.parentNode),null===t?(this._editor.code.set(""),this._editor.focus.end()):(elRemove(this._pre),this._editor.caret.end(t)),r.close(this)},_dialogSetup:function(){var e="redactor-code-"+this._elementId,t=e+"-button-delete",a=e+"-button-save",r=e+"-file",o=e+"-highlighter",s=e+"-line";return{id:e,options:{onClose:function(){this._editor.selection.restore()}.bind(this),onSetup:function(){elById(a).addEventListener(WCF_CLICK_EVENT,this._save.bind(this)),elById(t).addEventListener(WCF_CLICK_EVENT,this._delete.bind(this));var e='<option value="">'+i.get("wcf.editor.code.highlighter.detect")+"</option>",r=[];for(var s in this._editor.opts.woltlab.highlighters)this._editor.opts.woltlab.highlighters.hasOwnProperty(s)&&r.push([s,this._editor.opts.woltlab.highlighters[s]]);r.sort(function(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:0}),r.forEach(function(t){e+='<option value="'+t[0]+'">'+n.escapeHTML(t[1])+"</option>"}.bind(this)),elById(o).innerHTML=e}.bind(this),onShow:function(){elById(o).value=elData(this._pre,"highlighter");var e=elData(this._pre,"line");elById(s).value=""===e?1:~~e,elById(r).value=elData(this._pre,"file")}.bind(this),title:i.get("wcf.editor.code.edit")},source:'<div class="section"><dl><dt><label for="'+o+'">'+i.get("wcf.editor.code.highlighter")+'</label></dt><dd><select id="'+o+'"></select><small>'+i.get("wcf.editor.code.highlighter.description")+'</small></dd></dl><dl><dt><label for="'+s+'">'+i.get("wcf.editor.code.line")+'</label></dt><dd><input type="number" id="'+s+'" min="0" value="1" class="long"><small>'+i.get("wcf.editor.code.line.description")+'</small></dd></dl><dl><dt><label for="'+r+'">'+i.get("wcf.editor.code.file")+'</label></dt><dd><input type="text" id="'+r+'" class="long"><small>'+i.get("wcf.editor.code.file.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+a+'" class="buttonPrimary">'+i.get("wcf.global.button.save")+'</button><button id="'+t+'">'+i.get("wcf.global.button.delete")+"</button></div>"}}},s}),define("WoltLabSuite/Core/Ui/Redactor/DragAndDrop",["Dictionary","EventHandler","Language"],function(e,t,i){"use strict";var n=!1,a=new e,r=!1,o=!1,s=null;return{init:function(e){n||this._setup(),a.set(e.uuid,{editor:e,element:null})},_dragOver:function(e){if(e.preventDefault(),e.dataTransfer&&e.dataTransfer.types){var t=!1;for(var n in e.dataTransfer)if(e.dataTransfer.hasOwnProperty(n)&&n.match(/^moz/)){t=!0;break}if(o=!1,t)"application/x-moz-file"===e.dataTransfer.types[0]&&(o=!0);else for(var s=0;s<e.dataTransfer.types.length;s++)if("Files"===e.dataTransfer.types[s]){o=!0;break}o&&(r||(r=!0,a.forEach(function(e,t){var n=e.editor.$editor[0];if(!n.parentNode)return void a["delete"](t);var r=e.element;null===r&&(r=elCreate("div"),r.className="redactorDropArea",elData(r,"element-id",e.editor.$element[0].id),elData(r,"drop-here",i.get("wcf.attachment.dragAndDrop.dropHere")),elData(r,"drop-now",i.get("wcf.attachment.dragAndDrop.dropNow")),r.addEventListener("dragover",function(){r.classList.add("active")}),r.addEventListener("dragleave",function(){r.classList.remove("active")}),r.addEventListener("drop",this._drop.bind(this)),e.element=r),n.parentNode.insertBefore(r,n),r.style.setProperty("top",n.offsetTop+"px","")}.bind(this))))}},_drop:function(e){if(o&&e.dataTransfer&&e.dataTransfer.files.length){e.preventDefault();for(var i=elData(e.currentTarget,"element-id"),n=0,a=e.dataTransfer.files.length;a>n;n++)t.fire("com.woltlab.wcf.redactor2","dragAndDrop_"+i,{file:e.dataTransfer.files[n]});this._dragLeave()}},_dragLeave:function(){r&&o&&(null!==s&&window.clearTimeout(s),s=window.setTimeout(function(){r||a.forEach(function(e){e.element&&e.element.parentNode&&(e.element.classList.remove("active"),elRemove(e.element))}),s=null},100),r=!1)},_setup:function(){window.addEventListener("dragend",function(e){e.preventDefault()}),window.addEventListener("dragover",this._dragOver.bind(this)),window.addEventListener("dragleave",this._dragLeave.bind(this)),window.addEventListener("drop",this._dragLeave.bind(this)),n=!0}}}),define("WoltLabSuite/Core/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,i,n){var a=window.getSelection();if(a.rangeCount){var r=a.getRangeAt(0),o=null,s=null,l=null;if(r.collapsed)l=elCreate("strike"),l.textContent="​",r.insertNode(l),r=document.createRange(),r.selectNodeContents(l),a.removeAllRanges(),a.addRange(r);else{o=elCreate("mark"),s=elCreate("mark");var c=r.cloneRange();c.collapse(!0),c.insertNode(o),c=r.cloneRange(),c.collapse(!1),c.insertNode(s),r=document.createRange(),r.setStartAfter(o),r.setEndBefore(s),a.removeAllRanges(),a.addRange(r),this.removeFormat(t,i),r=document.createRange(),r.setStartAfter(o),r.setEndBefore(s),a.removeAllRanges(),a.addRange(r)}null===l&&document.execCommand("strikethrough");for(var d,u,h=elBySelAll("strike",t),p=[],f=0,m=h.length;m>f;f++)u=h[f],d=elCreate("span"),elAttr(d,"style",i+": "+n),e.replaceElement(u,d),p.push(d);var g=p.length;if(g){var v=p[0],b=p[g-1];if(null===l&&v.parentNode===b.parentNode){var _=v.parentNode;"SPAN"===_.nodeName&&""!==_.style.getPropertyValue(i)&&this._isBoundaryElement(v,_,"previous")&&this._isBoundaryElement(b,_,"next")&&e.unwrapChildNodes(_)}r=document.createRange(),r.setStart(v,0),r.setEnd(b,b.childNodes.length),a.removeAllRanges(),a.addRange(r)}null!==o&&(elRemove(o),elRemove(s))}},removeFormat:function(t,i){for(var n=elByTag("strike",t);n.length;)e.unwrapChildNodes(n[0]);document.execCommand("strikethrough");for(var a,r;n.length;)r=n[0],a=this._getLastMatchingParent(r,t,i),null!==a&&this._handleParentNodes(r,a,i),elBySelAll("span",r,function(t){t.style.getPropertyValue(i)&&e.unwrapChildNodes(t)}),e.unwrapChildNodes(r);elBySelAll("span",t,function(e){e.parentNode&&!e.textContent.length&&""!==e.style.getPropertyValue(i)&&(1===e.childElementCount&&"MARK"===e.children[0].nodeName&&e.parentNode.insertBefore(e.children[0],e),0===e.childElementCount&&elRemove(e))})},_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)),elBySelAll("span",i,function(t){t.style.getPropertyValue(n)&&e.unwrapChildNodes(t)}),e.unwrapChildNodes(i)},_getLastMatchingParent:function(e,t,i){for(var n=e.parentNode,a=null;n!==t;)"SPAN"===n.nodeName&&""!==n.style.getPropertyValue(i)&&(a=n),n=n.parentNode;return a},_isBoundaryElement:function(e,t,i){for(var n=e;n=n[i+"Sibling"];)if(n.nodeType!==Node.TEXT_NODE||""!==n.textContent.replace(/\u200B/,""))return!1;return!0}}}),define("WoltLabSuite/Core/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.editor.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;
+_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),c.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=l.childByClass(i.messageBodyEditor,"icon");elRemove(r);var o=i.messageBodyEditor,s=elCreate("div");s.className="editorContainer",c.setInnerHtml(s,e.returnValues.template),o.appendChild(s);var d=elBySel(".formSubmit",s),u=elBySel('button[data-type="save"]',d);u.addEventListener(WCF_CLICK_EVENT,this._save.bind(this));var p=elBySel('button[data-type="cancel"]',d);p.addEventListener(WCF_CLICK_EVENT,this._restoreMessage.bind(this)),a.add("com.woltlab.wcf.redactor","submitEditor_"+t,function(e){e.cancel=!0,this._save()}.bind(this)),elHide(i.messageHeader),elHide(i.messageFooter);var f=elById(t);"redactor"===n.editor()?window.setTimeout(function(){this._options.quoteManager&&this._options.quoteManager.setAlternativeEditor(t),h.element(this._activeElement)}.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),elShow(e.messageHeader),this._activeElement.classList.remove("jsInvalidQuoteTarget"),this._activeElement=null,this._options.quoteManager&&this._options.quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[]},i=this._getEditorId(),n=elById("settings_"+i);n&&elBySelAll("input, select, textarea",n,function(e){if("INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||e.checked){var i=e.name;if(t.hasOwnProperty(i))throw new Error("Variable overshadowing, key '"+i+"' is already present.");t[i]=e.value.trim()}}),a.fire("com.woltlab.wcf.redactor2","getText_"+i,t.data),this._validate(t)&&(a.fire("com.woltlab.wcf.redactor2","submit_"+i,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor())},_validate:function(e){for(var t=elByClass("innerError",this._activeElement);t.length;)elRemove(t[0]);var i={api:this,parameters:e,valid:!0};return a.fire("com.woltlab.wcf.redactor2","validate_"+this._getEditorId(),i),i.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,c.insertAfter(i,e)},_showMessage:function(e){var t=this._activeElement,i=this._getEditorId(),n=this._elements.get(t),r=elBySelAll(".attachmentThumbnailList, .attachmentFileList",n.messageFooter);if(c.setInnerHtml(l.childByClass(n.messageBody,"messageText"),e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var o=0,s=r.length;s>o;o++)elRemove(r[o]);var u=elCreate("div");c.setInnerHtml(u,e.returnValues.attachmentList);for(var h;u.childNodes.length;)h=u.childNodes[u.childNodes.length-1],n.messageFooter.insertBefore(h,n.messageFooter.firstChild)}if("string"==typeof e.returnValues.poll){var p=elBySel(".pollContainer",n.messageBody);null!==p&&elRemove(p.parentNode);var f=elCreate("div");f.className="jsInlineEditorHideContent",c.setInnerHtml(f,e.returnValues.poll),c.prepend(f,n.messageBody)}this._restoreMessage(),this._updateHistory(this._getHash(this._getObjectId(t))),a.fire("com.woltlab.wcf.redactor","autosaveDestroy_"+i),d.show(),this._options.quoteManager&&(this._options.quoteManager.clearAlternativeEditor(),this._options.quoteManager.countQuotes())},_hideEditor:function(){var e=this._elements.get(this._activeElement);elHide(l.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=l.childByClass(e.messageBodyEditor,"editorContainer");null!==i&&elShow(i)},_destroyEditor:function(){a.fire("com.woltlab.wcf.redactor2","autosaveDestroy_"+this._getEditorId()),a.fire("com.woltlab.wcf.redactor2","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-layer",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",c.insertAfter(n,i)),n.textContent=e.returnValues.errorType,!1},_ajaxSuccess:function(e){switch(e.actionName){case"beginEdit":this._showEditor(e);break;case"save":this._showMessage(e)}},_ajaxSetup:function(){return{data:{className:this._options.className,interfaceName:"wcf\\data\\IMessageInlineEditorAction"}}},legacyEdit:function(e){this._click(elById(e),null)}},p}),define("WoltLabSuite/Core/Ui/Message/Manager",["Ajax","Core","Dictionary","Language","Dom/ChangeListener","Dom/Util"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._elements=null,this._options=t.extend({className:"",selector:""},e),this.rebuild(),a.add("Ui/Message/Manager"+this._options.className,this.rebuild.bind(this))},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)t.hasOwnProperty(r)&&this._update(i,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,i){t.push(i)}.bind(this)),this.updateItems(t,e)},setNote: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+"'");var a=elBySel(".messageFooterNotes",n),r=elBySel("."+t,a);i?(null===r&&(r=elCreate("p"),r.className="messageFooterNote "+t,a.appendChild(r)),r.innerHTML=i):null!==r&&elRemove(r)},_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"),this._toggleMessageStatus(e,"jsIconDeleted","wcf.message.status.deleted","red",n);break;case"isDisabled":e.classList[n?"add":"remove"]("messageDisabled"),this._toggleMessageStatus(e,"jsIconDisabled","wcf.message.status.disabled","green",n)}},_toggleMessageStatus:function(e,t,i,a,o){var s=elBySel(".messageStatus",e);if(null===s){var l=elBySel(".messageHeaderMetaData",e);if(null===l)return;s=elCreate("ul"),s.className="messageStatus",r.insertAfter(s,l)}var c=elBySel("."+t,s);if(o){if(null!==c)return;c=elCreate("span"),c.className="badge label "+a+" "+t,c.textContent=n.get(i);var d=elCreate("li");d.appendChild(c),s.appendChild(d)}else{if(null===c)return;elRemove(c.parentNode)}},_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(){throw new Error("Method _ajaxSuccess() must be implemented by deriving functions.")},_ajaxSetup:function(){return{data:{className:this._options.className}}}},o}),define("WoltLabSuite/Core/Ui/Message/Reply",["Ajax","Core","EventHandler","Language","Dom/ChangeListener","Dom/Util","Dom/Traverse","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Ui/Scroll","EventKey","User","WoltLabSuite/Core/Controller/Captcha"],function(e,t,i,n,a,r,o,s,l,c,d,u,h){"use strict";function p(e){this.init(e)}return p.prototype={init:function(e){this._options=t.extend({ajax:{className:""},quoteManager:null,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,o=a.length;o>r;r++)a[r].addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this._getEditor().WoltLabReply.showEditor(),c.element(this._container,function(){this._getEditor().WoltLabCaret.endOfEditor()}.bind(this))}.bind(this))},_submitGuestDialog:function(e){if("keypress"!==e.type||d.Enter(e)){var i=elBySel("input[name=username]",e.currentTarget.closest(".dialogContent"));if(""===i.value){var a=o.nextByClass(i,"innerError");return void(a||(a=elCreate("small"),a.className="innerError",a.innerText=n.get("wcf.global.form.error.empty"),r.insertAfter(a,i),i.closest("dl").classList.add("formError")))}var s={parameters:{data:{username:i.value}}},l=elData(e.currentTarget,"captcha-id");h.has(l)&&(s=t.extend(s,h.getData(l))),this._submit(void 0,s)}},_submit:function(n,a){if(n&&n.preventDefault(),this._validate()){this._showLoadingOverlay();var o=r.getDataAttributes(this._container,"data-",!0,!0);o.data={message:this._getEditor().code.get()},o.removeQuoteIDs=this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[];var s=elById("settings_text");s&&elBySelAll("input, select, textarea",s,function(e){if("INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||e.checked){var t=e.name;if(o.hasOwnProperty(t))throw new Error("Variable overshadowing, key '"+t+"' is already present.");o[t]=e.value.trim()}}),i.fire("com.woltlab.wcf.redactor2","submit_text",o.data),u.userId||a||(o.requireGuestDialog=!0),e.api(this,t.extend({parameters:o},a))}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)elRemove(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="empty"===t?n.get("wcf.global.form.error.empty"):t,r.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(this._getEditor().WoltLabAutosave.reset(),e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t;if("DESC"===elData(this._container,"sort-order"))r.insertHtml(e.returnValues.template,this._container,"after"),t=r.identify(this._container.nextElementSibling);else{var i=this._container;i.previousElementSibling&&i.previousElementSibling.classList.contains("messageListPagination")&&(i=i.previousElementSibling),r.insertHtml(e.returnValues.template,i,"before"),t=r.identify(i.previousElementSibling)}elData(this._container,"last-post-time",e.returnValues.lastPostTime),window.history.replaceState(void 0,"","#"+t),c.element(elById(t))}l.show(n.get(this._options.successMessage)),this._options.quoteManager&&this._options.quoteManager.countQuotes(),a.trigger()}},_ajaxSuccess:function(e){if(!u.userId&&!e.returnValues.guestDialogID)throw new Error("Missing 'guestDialogID' return value for guest.");if(!u.userId&&e.returnValues.guestDialog){s.openStatic(e.returnValues.guestDialogID,e.returnValues.guestDialog,{closable:!1,title:n.get("wcf.global.confirmation.title")});var t=s.getDialog(e.returnValues.guestDialogID);elBySel("input[type=submit]",t.content).addEventListener(WCF_CLICK_EVENT,this._submitGuestDialog.bind(this)),elBySel("input[type=text]",t.content).addEventListener("keypress",this._submitGuestDialog.bind(this))}else this._insertMessage(e),u.userId||s.close(e.returnValues.guestDialogID),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{silent:!0,data:{actionName:"quickReply",className:this._options.ajax.className,interfaceName:"wcf\\data\\IMessageQuickReplyAction"}}}},p}),define("WoltLabSuite/Core/Ui/Message/Share",["EventHandler"],function(e){"use strict";return{_pageDescription:"",_pageUrl:"",init:function(){var t=elBySel('meta[property="og:title"]');null!==t&&(this._pageDescription=encodeURIComponent(t.content));var i=elBySel('meta[property="og:url"]');null!==i&&(this._pageUrl=encodeURIComponent(i.content)),elBySelAll(".jsMessageShareButtons",null,function(t){t.classList.remove("jsMessageShareButtons");var i={facebook:{link:elBySel(".jsShareFacebook",t),share:function(){this._share("facebook","https://www.facebook.com/sharer.php?u={pageURL}&t={text}",!0)}.bind(this)},google:{link:elBySel(".jsShareGoogle",t),share:function(){this._share("google","https://plus.google.com/share?url={pageURL}",!1)}.bind(this)},reddit:{link:elBySel(".jsShareReddit",t),share:function(){this._share("reddit","https://ssl.reddit.com/submit?url={pageURL}",!1)}.bind(this)},twitter:{link:elBySel(".jsShareTwitter",t),share:function(){this._share("twitter","https://twitter.com/share?url={pageURL}&text={text}",!1)}.bind(this)},linkedIn:{link:elBySel(".jsShareLinkedIn",t),share:function(){this._share("linkedIn","https://www.linkedin.com/cws/share?url={pageURL}",!1)}.bind(this)},pinterest:{link:elBySel(".jsSharePinterest",t),share:function(){this._share("pinterest","https://www.pinterest.com/pin/create/link/?url={pageURL}&description={text}",!1)}.bind(this)},xing:{link:elBySel(".jsShareXing",t),share:function(){this._share("xing","https://www.xing.com/social_plugins/share?url={pageURL}",!1)}.bind(this)},whatsApp:{link:elBySel(".jsShareWhatsApp",t),share:function(){window.location.href="whatsapp://send?text="+this._pageDescription+"%20"+this._pageUrl}.bind(this)}};e.fire("com.woltlab.wcf.message.share","shareProvider",{container:t,providers:i,pageDescription:this._pageDescription,pageUrl:this._pageUrl});for(var n in i)i.hasOwnProperty(n)&&null!==i[n].link&&i[n].link.addEventListener(WCF_CLICK_EVENT,i[n].share)}.bind(this))},_share:function(e,t,i){window.open(t.replace(/\{pageURL}/,this._pageUrl).replace(/\{text}/,this._pageDescription+(i?"%20"+this._pageUrl:"")),e,"height=600,width=600")}}}),define("WoltLabSuite/Core/Ui/Page/Search",["Ajax","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r){"use strict";var o,s,l,c=null;return{open:function(e){o=e,r.open(this)},_search:function(t){t.preventDefault();var n=c.parentNode,r=n.nextSibling;r&&"SMALL"===r.nodeName&&elRemove(r);var o=c.value.trim();return o.length<3?(r=elCreate("small"),r.className="innerError",r.textContent=i.get("wcf.page.search.error.tooShort"),void a.insertAfter(r,n)):void e.api(this,{parameters:{searchString:o}})},_click:function(e){e.preventDefault(),o(elData(e.currentTarget,"page-id")),r.close(this)},_ajaxSuccess:function(e){for(var t,r="",o=0,d=e.returnValues.length;d>o;o++)t=e.returnValues[o],r+='<li><div class="containerHeadline pointer" data-page-id="'+t.pageID+'"><h3>'+n.escapeHTML(t.name)+"</h3><small>"+n.escapeHTML(t.displayLink)+"</small></div></li>";if(l.innerHTML=r,window[r?"elShow":"elHide"](s),r)elBySelAll(".containerHeadline",l,function(e){e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))}.bind(this));else{var u=elCreate("small");u.className="innerError",u.textContent=i.get("wcf.page.search.error.noResults"),a.insertAfter(u,c.parentNode)}},_ajaxSetup:function(){return{data:{actionName:"search",className:"wcf\\data\\page\\PageAction"}}},_dialogSetup:function(){return{id:"wcfUiPageSearch",options:{onSetup:function(){var e=this._search.bind(this);c=elById("wcfUiPageSearchInput"),c.addEventListener("keydown",function(i){t.Enter(i)&&e(i)}),c.nextElementSibling.addEventListener(WCF_CLICK_EVENT,e),s=elById("wcfUiPageSearchResultContainer"),l=elById("wcfUiPageSearchResultList")}.bind(this),onShow:function(){c.focus()},title:i.get("wcf.page.search")},source:'<div class="section"><dl><dt><label for="wcfUiPageSearchInput">'+i.get("wcf.page.search.name")+'</label></dt><dd><div class="inputAddon"><input type="text" id="wcfUiPageSearchInput" class="long"><a href="#" class="inputSuffix"><span class="icon icon16 fa-search"></span></a></div></dd></dl></div><section id="wcfUiPageSearchResultContainer" class="section" style="display: none;"><header class="sectionHeader"><h2 class="sectionTitle">'+i.get("wcf.page.search.results")+'</h2></header><ol id="wcfUiPageSearchResultList" class="containerList"></ol></section>'}}}}),define("WoltLabSuite/Core/Ui/Redactor/Autosave",["Language","Dom/Traverse"],function(e,t){"use strict";function i(e){this.init(e)}var n=15,a="wsc"+window.WCF_PATH.hashCode()+"-";return i.prototype={init:function(e){this._container=null,this._editor=null,this._element=e,this._key=a+elData(this._element,"autosave"),this._lastMessage="",this._originalMessage="",this._overlay=null,this._restored=!1,this._timer=null,this._cleanup(),this._element.removeAttribute("data-autosave");var i=t.parentByTag(this._element,"FORM");null!==i&&i.addEventListener("submit",this.destroy.bind(this))},getInitialValue:function(){var e="";try{e=window.localStorage.getItem(this._key)}catch(t){window.console.warn("Unable to access local storage: "+t.message)}try{e=JSON.parse(e)}catch(t){e=""}if(null!==e&&"object"==typeof e&&e.content){var i=~~elData(this._element,"autosave-last-edit-time");if(1e3*i<=e.timestamp)return this._originalMessage=this._element.value,this._restored=!0,e.content}return this._element.value},watch:function(e){if(this._editor=e,null!==this._timer)throw new Error("Autosave timer is already active.");this._timer=window.setInterval(this._saveToStorage.bind(this),1e3*n),this._saveToStorage()},destroy:function(){this.clear(),this._editor=null,window.clearInterval(this._timer),this._timer=null},clear:function(){this._lastMessage="";try{window.localStorage.removeItem(this._key)}catch(e){window.console.warn("Unable to remove from local storage: "+e.message)}},createOverlay:function(){if(this._restored){var t=elCreate("div");t.className="redactorAutosaveRestored active";var i=elCreate("span");i.textContent=e.get("wcf.editor.autosave.restored"),t.appendChild(i);var n=elCreate("a");n.className="jsTooltip",n.href="#",n.title=e.get("wcf.editor.autosave.keep"),n.innerHTML='<span class="icon icon16 fa-check green"></span>',n.addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this.hideOverlay()}.bind(this)),t.appendChild(n),n=elCreate("a"),n.className="jsTooltip",n.href="#",n.title=e.get("wcf.editor.autosave.discard"),n.innerHTML='<span class="icon icon16 fa-times red"></span>',n.addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),this.clear(),this._editor.code.start(this._originalMessage),this._editor.core.textarea().val(this._editor.clean.onSync(this._editor.$editor.html())),this.hideOverlay()}.bind(this)),t.appendChild(n),this._editor.core.box()[0].appendChild(t);var a=function(){this._editor.core.editor()[0].removeEventListener(WCF_CLICK_EVENT,a),this.hideOverlay()}.bind(this);this._editor.core.editor()[0].addEventListener(WCF_CLICK_EVENT,a),this._container=t}},hideOverlay:function(){null!==this._container&&(this._container.classList.remove("active"),window.setTimeout(function(){null!==this._container&&elRemove(this._container),this._container=null,this._originalMessage=""}.bind(this),1e3))},_saveToStorage:function(){var e=this._editor.code.get();if(this._editor.utils.isEmpty(e)&&(e=""),this._lastMessage!==e){if(""===e)return this.clear();try{window.localStorage.setItem(this._key,JSON.stringify({content:e,timestamp:Date.now()})),this._lastMessage=e}catch(t){window.console.warn("Unable to write to local storage: "+t.message)}}},_cleanup:function(){var e,t,i,n,r=Date.now()-6048e5,o=[];for(e=0,i=window.localStorage.length;i>e;e++)if(t=window.localStorage.key(e),0===t.indexOf(a)){try{n=window.localStorage.getItem(t)}catch(s){window.console.warn("Unable to access local storage: "+s.message)}try{n=JSON.parse(n)}catch(s){n={timestamp:0}}(!n||n.timestamp<r)&&o.push(t)}for(e=0,i=o.length;i>e;e++)try{window.localStorage.removeItem(o[e])}catch(s){window.console.warn("Unable to remove from local storage: "+s.message)}}},i}),define("WoltLabSuite/Core/Ui/Redactor/PseudoHeader",[],function(){"use strict";return{getHeight:function(e){var t=~~window.getComputedStyle(e).paddingTop.replace(/px$/,""),i=window.getComputedStyle(e,"::before");t+=~~i.paddingTop.replace(/px$/,""),t+=~~i.paddingBottom.replace(/px$/,"");var n=~~i.height.replace(/px$/,"");return 0===n&&(n=e.scrollHeight,e.classList.add("redactorCalcHeight"),n-=e.scrollHeight,e.classList.remove("redactorCalcHeight")),t+=n}}}),define("WoltLabSuite/Core/Ui/Redactor/Code",["EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog","./PseudoHeader"],function(e,t,i,n,a,r,o){"use strict";function s(e){this.init(e)}var l=0;return s.prototype={init:function(t){this._editor=t,this._elementId=this._editor.$element[0].id,this._pre=null,e.add("com.woltlab.wcf.redactor2","bbcode_code_"+this._elementId,this._bbcodeCode.bind(this)),e.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.opts.activeButtonsStates.pre="code",this._callbackEdit=this._edit.bind(this),this._observeLoad()},_bbcodeCode:function(e){e.cancel=!0,this._editor.button.toggle({},"pre","func","block.format");var t=this._editor.selection.block();t&&"PRE"===t.nodeName&&(1===t.childElementCount&&"BR"===t.children[0].nodeName&&t.removeChild(t.children[0]),this._setTitle(t),t.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._editor.caret.end(t))},_observeLoad:function(){elBySelAll("pre",this._editor.$editor[0],function(e){e.addEventListener("mousedown",this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;0===l&&(l=o.getHeight(t));var i=a.offset(t);e.pageY>i.top&&e.pageY<i.top+l&&(e.preventDefault(),this._editor.selection.save(),this._pre=t,r.open(this))},_save:function(e){e.preventDefault();var t="redactor-code-"+this._elementId;["file","highlighter","line"].forEach(function(e){elData(this._pre,e,elById(t+"-"+e).value)}.bind(this)),this._setTitle(this._pre),this._editor.caret.after(this._pre),r.close(this)},_setTitle:function(e){var t=elData(e,"file"),n=elData(e,"highlighter");n=this._editor.opts.woltlab.highlighters.hasOwnProperty(n)?this._editor.opts.woltlab.highlighters[n]:"";var a=i.get("wcf.editor.code.title",{file:t,highlighter:n});elData(e,"title")!==a&&elData(e,"title",a)},_delete:function(e){e.preventDefault();var t=this._pre.nextElementSibling||this._pre.previousElementSibling;null===t&&this._pre.parentNode!==this._editor.core.editor()[0]&&(t=this._pre.parentNode),null===t?(this._editor.code.set(""),this._editor.focus.end()):(elRemove(this._pre),this._editor.caret.end(t)),r.close(this)},_dialogSetup:function(){var e="redactor-code-"+this._elementId,t=e+"-button-delete",a=e+"-button-save",r=e+"-file",o=e+"-highlighter",s=e+"-line";return{id:e,options:{onClose:function(){this._editor.selection.restore()}.bind(this),onSetup:function(){elById(a).addEventListener(WCF_CLICK_EVENT,this._save.bind(this)),elById(t).addEventListener(WCF_CLICK_EVENT,this._delete.bind(this));var e='<option value="">'+i.get("wcf.editor.code.highlighter.detect")+"</option>",r=[];for(var s in this._editor.opts.woltlab.highlighters)this._editor.opts.woltlab.highlighters.hasOwnProperty(s)&&r.push([s,this._editor.opts.woltlab.highlighters[s]]);r.sort(function(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:0}),r.forEach(function(t){e+='<option value="'+t[0]+'">'+n.escapeHTML(t[1])+"</option>"}.bind(this)),elById(o).innerHTML=e}.bind(this),onShow:function(){elById(o).value=elData(this._pre,"highlighter");var e=elData(this._pre,"line");elById(s).value=""===e?1:~~e,elById(r).value=elData(this._pre,"file")}.bind(this),title:i.get("wcf.editor.code.edit")},source:'<div class="section"><dl><dt><label for="'+o+'">'+i.get("wcf.editor.code.highlighter")+'</label></dt><dd><select id="'+o+'"></select><small>'+i.get("wcf.editor.code.highlighter.description")+'</small></dd></dl><dl><dt><label for="'+s+'">'+i.get("wcf.editor.code.line")+'</label></dt><dd><input type="number" id="'+s+'" min="0" value="1" class="long"><small>'+i.get("wcf.editor.code.line.description")+'</small></dd></dl><dl><dt><label for="'+r+'">'+i.get("wcf.editor.code.file")+'</label></dt><dd><input type="text" id="'+r+'" class="long"><small>'+i.get("wcf.editor.code.file.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+a+'" class="buttonPrimary">'+i.get("wcf.global.button.save")+'</button><button id="'+t+'">'+i.get("wcf.global.button.delete")+"</button></div>"}}},s}),define("WoltLabSuite/Core/Ui/Redactor/DragAndDrop",["Dictionary","EventHandler","Language"],function(e,t,i){"use strict";var n=!1,a=new e,r=!1,o=!1,s=null;return{init:function(e){n||this._setup(),a.set(e.uuid,{editor:e,element:null})},_dragOver:function(e){if(e.preventDefault(),e.dataTransfer&&e.dataTransfer.types){var t=!1;for(var n in e.dataTransfer)if(e.dataTransfer.hasOwnProperty(n)&&n.match(/^moz/)){t=!0;break}if(o=!1,t)"application/x-moz-file"===e.dataTransfer.types[0]&&(o=!0);else for(var s=0;s<e.dataTransfer.types.length;s++)if("Files"===e.dataTransfer.types[s]){o=!0;break}o&&(r||(r=!0,a.forEach(function(e,t){var n=e.editor.$editor[0];if(!n.parentNode)return void a["delete"](t);var r=e.element;null===r&&(r=elCreate("div"),r.className="redactorDropArea",elData(r,"element-id",e.editor.$element[0].id),elData(r,"drop-here",i.get("wcf.attachment.dragAndDrop.dropHere")),elData(r,"drop-now",i.get("wcf.attachment.dragAndDrop.dropNow")),r.addEventListener("dragover",function(){r.classList.add("active")}),r.addEventListener("dragleave",function(){r.classList.remove("active")}),r.addEventListener("drop",this._drop.bind(this)),e.element=r),n.parentNode.insertBefore(r,n),r.style.setProperty("top",n.offsetTop+"px","")}.bind(this))))}},_drop:function(e){if(o&&e.dataTransfer&&e.dataTransfer.files.length){e.preventDefault();for(var i=elData(e.currentTarget,"element-id"),n=0,a=e.dataTransfer.files.length;a>n;n++)t.fire("com.woltlab.wcf.redactor2","dragAndDrop_"+i,{file:e.dataTransfer.files[n]});this._dragLeave()}},_dragLeave:function(){r&&o&&(null!==s&&window.clearTimeout(s),s=window.setTimeout(function(){r||a.forEach(function(e){e.element&&e.element.parentNode&&(e.element.classList.remove("active"),elRemove(e.element))}),s=null},100),r=!1)},_setup:function(){window.addEventListener("dragend",function(e){e.preventDefault()}),window.addEventListener("dragover",this._dragOver.bind(this)),window.addEventListener("dragleave",this._dragLeave.bind(this)),window.addEventListener("drop",this._dragLeave.bind(this)),n=!0}}}),define("WoltLabSuite/Core/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,i,n){var a=window.getSelection();if(a.rangeCount){var r=a.getRangeAt(0),o=null,s=null,l=null;if(r.collapsed)l=elCreate("strike"),l.textContent="​",r.insertNode(l),r=document.createRange(),r.selectNodeContents(l),a.removeAllRanges(),a.addRange(r);else{o=elCreate("mark"),s=elCreate("mark");var c=r.cloneRange();c.collapse(!0),c.insertNode(o),c=r.cloneRange(),c.collapse(!1),c.insertNode(s),r=document.createRange(),r.setStartAfter(o),r.setEndBefore(s),a.removeAllRanges(),a.addRange(r),this.removeFormat(t,i),r=document.createRange(),r.setStartAfter(o),r.setEndBefore(s),a.removeAllRanges(),a.addRange(r)}null===l&&document.execCommand("strikethrough");for(var d,u,h=elBySelAll("strike",t),p=[],f=0,m=h.length;m>f;f++)u=h[f],d=elCreate("span"),elAttr(d,"style",i+": "+n),e.replaceElement(u,d),p.push(d);var g=p.length;if(g){var v=p[0],b=p[g-1];if(null===l&&v.parentNode===b.parentNode){var _=v.parentNode;"SPAN"===_.nodeName&&""!==_.style.getPropertyValue(i)&&this._isBoundaryElement(v,_,"previous")&&this._isBoundaryElement(b,_,"next")&&e.unwrapChildNodes(_)}r=document.createRange(),r.setStart(v,0),r.setEnd(b,b.childNodes.length),a.removeAllRanges(),a.addRange(r)}null!==o&&(elRemove(o),elRemove(s))}},removeFormat:function(t,i){for(var n=elByTag("strike",t);n.length;)e.unwrapChildNodes(n[0]);document.execCommand("strikethrough");for(var a,r;n.length;)r=n[0],a=this._getLastMatchingParent(r,t,i),null!==a&&this._handleParentNodes(r,a,i),elBySelAll("span",r,function(t){t.style.getPropertyValue(i)&&e.unwrapChildNodes(t)}),e.unwrapChildNodes(r);elBySelAll("span",t,function(e){e.parentNode&&!e.textContent.length&&""!==e.style.getPropertyValue(i)&&(1===e.childElementCount&&"MARK"===e.children[0].nodeName&&e.parentNode.insertBefore(e.children[0],e),0===e.childElementCount&&elRemove(e))})},_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)),elBySelAll("span",i,function(t){t.style.getPropertyValue(n)&&e.unwrapChildNodes(t)}),e.unwrapChildNodes(i)},_getLastMatchingParent:function(e,t,i){for(var n=e.parentNode,a=null;n!==t;)"SPAN"===n.nodeName&&""!==n.style.getPropertyValue(i)&&(a=n),n=n.parentNode;return a},_isBoundaryElement:function(e,t,i){for(var n=e;n=n[i+"Sibling"];)if(n.nodeType!==Node.TEXT_NODE||""!==n.textContent.replace(/\u200B/,""))return!1;return!0}}}),define("WoltLabSuite/Core/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.editor.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",i.parentNode.appendChild(a)),a.textContent=e.get(""===i.value.trim()?"wcf.global.form.error.empty":"wcf.editor.link.error.invalid")}},_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.editor.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.editor.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("WoltLabSuite/Core/Ui/Redactor/Mention",["Ajax","Environment","StringUtil","Ui/CloseOverlay"],function(e,t,i,n){"use strict";function a(e){this.init(e)}var r=null;return a.prototype={init:function(e){this._active=!1,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)),n.add("UiRedactorMention-"+e.core.element()[0].id,this._hideDropdown.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 void this._hideDropdown()}t.preventDefault(),e.cancel=!0}},_keyUp:function(t){var i=t.event;if(13===i.which)return void(this._active=!1);if(!this._dropdownActive||(t.cancel=!0,38!==i.which&&40!==i.which)){var n=this._getTextLineInFrontOfCaret();if(n.length>0&&n.length<25){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()}},_getTextLineInFrontOfCaret:function(){var e=this._selectMention(!1);return null!==e?e.range.cloneContents().textContent.replace(/\u200B/g,"").replace(/\u00A0/g," ").trim():""},_getDropdownMenuPosition:function(){var e=this._selectMention();if(null===e)return null;this._redactor.selection.save(),e.selection.removeAllRanges(),e.selection.addRange(e.range);var t=e.selection.getRangeAt(0).getBoundingClientRect(),i={top:Math.round(t.bottom)+(window.scrollY||window.pageYOffset),left:Math.round(t.left)+document.body.scrollLeft};return null===this._lineHeight&&(this._lineHeight=Math.round(t.bottom-t.top)),this._redactor.selection.restore(),i},_setUsername:function(e,t){e&&(e.preventDefault(),t=e.currentTarget);var i=this._selectMention();if(null===i)return void this._hideDropdown();this._redactor.buffer.set(),i.selection.removeAllRanges(),i.selection.addRange(i.range);var n=getSelection().getRangeAt(0);n.deleteContents(),n.collapse(!0);var a=document.createTextNode("@"+elData(t,"username")+" ");n.insertNode(a),n=document.createRange(),n.selectNode(a),n.collapse(!1),i.selection.removeAllRanges(),i.selection.addRange(n),this._hideDropdown()},_selectMention:function(e){var t=window.getSelection();if(!t.rangeCount||!t.isCollapsed)return null;var i=t.anchorNode;if(i.nodeType===Node.TEXT_NODE&&(i=i.parentNode),-1===i.textContent.indexOf("@"))return null;for(var n=this._redactor.core.editor()[0];i&&i!==n;){if(-1!==["PRE","WOLTLAB-QUOTE"].indexOf(i.nodeName))return null;i=i.parentNode}for(var a=t.getRangeAt(0),r=a.startContainer,o=a.startOffset;r.nodeType===Node.ELEMENT_NODE;){if(0===o&&0===r.childNodes.length)return null;r=r.childNodes[o?o-1:0],o>0&&(o=r.nodeType===Node.TEXT_NODE?r.textContent.length:r.childNodes.length)}for(var s=r,l=-1;null!==s;){if(s.nodeType!==Node.TEXT_NODE)return null;if(-1!==s.textContent.indexOf("@")){l=s.textContent.lastIndexOf("@");break}s=s.previousSibling}if(-1===l)return null;try{a=document.createRange(),a.setStart(s,l),a.setEnd(r,o)}catch(c){return window.console.debug(c),null}if(e===!1){var d="";for(l&&(d=s.textContent.substr(0,l));(s=s.previousSibling)&&s.nodeType===Node.TEXT_NODE;)d=s.textContent+d;if(d.replace(/\u200B/g,"").match(/\S$/))return null}else if(a.cloneContents().textContent.replace(/\u200B/g,"").replace(/\u00A0/g,"").trim().replace(/^@/,"")!==this._mentionStart)return null;return{range:a,selection:t}},_updateDropdownPosition:function(){var e=this._getDropdownMenuPosition();return null===e?void this._hideDropdown():(e.top+=7,this._dropdownMenu.style.setProperty("left",e.left+"px",""),this._dropdownMenu.style.setProperty("top",e.top+"px",""),this._selectItem(0),void(e.top+this._dropdownMenu.offsetHeight+10>window.innerHeight+(window.scrollY||window.pageYOffset)&&this._dropdownMenu.style.setProperty("top",e.top-this._dropdownMenu.offsetHeight-2*this._lineHeight+7+"px","")))},_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},_ajaxSetup:function(){return{data:{actionName:"getSearchResultList",className:"wcf\\data\\user\\UserAction",interfaceName:"wcf\\data\\ISearchAction",parameters:{data:{includeUserGroups:!1}}},silent:!0}},_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",null===r&&(r=elCreate("div"),r.className="dropdownMenuContainer",document.body.appendChild(r)),r.appendChild(this._dropdownMenu)),this._dropdownMenu.innerHTML="";for(var t,n,a,o=this._setUsername.bind(this),s=0,l=e.returnValues.length;l>s;s++)a=e.returnValues[s],n=elCreate("li"),t=elCreate("a"),t.addEventListener("mousedown",o),t.className="box16",t.innerHTML="<span>"+a.icon+"</span> <span>"+i.escapeHTML(a.label)+"</span>",elData(t,"user-id",a.objectID),elData(t,"username",a.label),n.appendChild(t),this._dropdownMenu.appendChild(n);this._dropdownMenu.classList.add("dropdownOpen"),this._dropdownActive=!0,this._updateDropdownPosition()}},a}),define("WoltLabSuite/Core/Ui/Redactor/Metacode",["EventHandler","Dom/Util"],function(e,t){"use strict";return{convert:function(e){e.textContent=this.convertFromHtml(e.textContent)},convertFromHtml:function(i,n){var a=elCreate("div");a.innerHTML=n;for(var r,o,s,l,c,d,u=elByTag("woltlab-metacode",a);u.length;)s=u[0],l=elData(s,"name"),r=this._parseAttributes(elData(s,"attributes")),o={attributes:r,cancel:!1,metacode:s},e.fire("com.woltlab.wcf.redactor2","metacode_"+l+"_"+i,o),o.cancel!==!0&&(d=this._getOpeningTag(l,r),c=this._getClosingTag(l),s.parentNode===a?(t.prepend(d,this._getFirstParagraph(s)),this._getLastParagraph(s).appendChild(c)):(t.prepend(d,s),s.appendChild(c)),t.unwrapChildNodes(s));return a.innerHTML},_getOpeningTag:function(e,t){var i="["+e;if(t.length){i+="=";for(var n=0,a=t.length;a>n;n++)n>0&&(i+=","),i+="'"+t[n]+"'"}return document.createTextNode(i+"]")},_getClosingTag:function(e){return document.createTextNode("[/"+e+"]")},_getFirstParagraph:function(e){var t,i;return 0===e.childElementCount?(i=elCreate("p"),e.appendChild(i)):(t=e.children[0],"P"===t.nodeName?i=t:(i=elCreate("p"),e.insertBefore(i,t))),i},_getLastParagraph:function(e){var t,i,n=e.childElementCount;return 0===n?(i=elCreate("p"),e.appendChild(i)):(t=e.children[n-1],"P"===t.nodeName?i=t:(i=elCreate("p"),e.appendChild(i))),i},_parseAttributes:function(e){try{e=JSON.parse(atob(e))}catch(t){}if(!Array.isArray(e))return[];for(var i,n=[],a=0,r=e.length;r>a;a++)i=e[a],"string"==typeof i&&(i=i.replace(/^'(.*)'$/,"$1")),n.push(i);return n}}}),define("WoltLabSuite/Core/Ui/Redactor/Page",["WoltLabSuite/Core/Ui/Page/Search"],function(e){"use strict";function t(e,t){this.init(e,t)}return t.prototype={init:function(e,t){this._editor=e,t.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))},_click:function(t){t.preventDefault(),e.open(this._insert.bind(this))},_insert:function(e){this._editor.buffer.set(),this._editor.insert.text("[wsp='"+e+"'][/wsp]")}},t}),define("WoltLabSuite/Core/Ui/Redactor/Quote",["Core","EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog","./Metacode","./PseudoHeader"],function(e,t,i,n,a,r,o,s,l){"use strict";function c(e,t){this.init(e,t)}var d=0;return c.prototype={init:function(e,i){this._quote=null,this._quotes=elByTag("woltlab-quote",e.$editor[0]),this._editor=e,this._elementId=this._editor.$element[0].id,t.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.button.addCallback(i,this._click.bind(this)),this._callbackEdit=this._edit.bind(this),this._observeLoad(),t.add("com.woltlab.wcf.redactor2","insertQuote_"+this._elementId,this._insertQuote.bind(this))},_insertQuote:function(e){if(!this._editor.WoltLabSource.isActive()){t.fire("com.woltlab.wcf.redactor2","showEditor");var i=this._editor.core.editor()[0];this._editor.selection.restore(),this._editor.buffer.set();var n=this._editor.selection.block();for(n===!1&&(this._editor.focus.end(),n=this._editor.selection.block());n&&n.parentNode!==i;)n=n.parentNode;var r=elCreate("woltlab-quote");elData(r,"author",e.author),elData(r,"link",e.link);var o=e.content;e.isText?(o=a.escapeHTML(o),o="<p>"+o+"</p>",o=o.replace(/\n\n/g,"</p><p>"),o=o.replace(/\n/g,"<br>")):o=s.convertFromHtml(this._editor.$element[0].id,o),r.innerHTML=o,n.parentNode.insertBefore(r,n.nextSibling),"P"!==n.nodeName||"<br>"!==n.innerHTML&&""!==n.innerHTML.replace(/\u200B/g,"")||n.parentNode.removeChild(n),this._editor.WoltLabCaret.paragraphAfterBlock(r),this._editor.buffer.set()}},_click:function(){this._editor.button.toggle({},"woltlab-quote","func","block.format");var e=this._editor.selection.block();e&&"WOLTLAB-QUOTE"===e.nodeName&&(this._setTitle(e),e.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._editor.caret.end(e))},_observeLoad:function(){for(var e,t=0,i=this._quotes.length;i>t;t++)e=this._quotes[t],e.addEventListener("mousedown",this._callbackEdit),this._setTitle(e)},_edit:function(e){var t=e.currentTarget;0===d&&(d=l.getHeight(t));var i=r.offset(t);e.pageY>i.top&&e.pageY<i.top+d&&(e.preventDefault(),this._editor.selection.save(),this._quote=t,o.open(this))},_save:function(e){e.preventDefault();var t="redactor-quote-"+this._elementId,i=elById(t+"-url"),a=elBySel(".innerError",i.parentNode);null!==a&&elRemove(a);var r=i.value.replace(/\u200B/g,"").trim();return r.length&&!/^https?:\/\/[^\/]+/.test(r)?(a=elCreate("small"),a.className="innerError",a.textContent=n.get("wcf.editor.quote.url.error.invalid"),void i.parentNode.insertBefore(a,i.nextElementSibling)):(elData(this._quote,"author",elById(t+"-author").value),elData(this._quote,"link",r),this._setTitle(this._quote),this._editor.caret.after(this._quote),void o.close(this))},_setTitle:function(e){var t=n.get("wcf.editor.quote.title",{author:elData(e,"author"),url:elData(e,"url")});elData(e,"title")!==t&&elData(e,"title",t)},_delete:function(e){e.preventDefault();var t=this._quote.nextElementSibling||this._quote.previousElementSibling;null===t&&this._quote.parentNode!==this._editor.core.editor()[0]&&(t=this._quote.parentNode),null===t?(this._editor.code.set(""),this._editor.focus.end()):(elRemove(this._quote),this._editor.caret.end(t)),o.close(this)},_dialogSetup:function(){var e="redactor-quote-"+this._elementId,t=e+"-author",i=e+"-button-delete",a=e+"-button-save",r=e+"-url";return{id:e,options:{onClose:function(){this._editor.selection.restore()}.bind(this),onSetup:function(){elById(a).addEventListener(WCF_CLICK_EVENT,this._save.bind(this)),elById(i).addEventListener(WCF_CLICK_EVENT,this._delete.bind(this))}.bind(this),onShow:function(){elById(t).value=elData(this._quote,"author"),elById(r).value=elData(this._quote,"link")}.bind(this),title:n.get("wcf.editor.quote.edit")},source:'<div class="section"><dl><dt><label for="'+t+'">'+n.get("wcf.editor.quote.author")+'</label></dt><dd><input type="text" id="'+t+'" class="long"></dd></dl><dl><dt><label for="'+r+'">'+n.get("wcf.editor.quote.url")+'</label></dt><dd><input type="text" id="'+r+'" class="long"><small>'+n.get("wcf.editor.quote.url.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+a+'" class="buttonPrimary">'+n.get("wcf.global.button.save")+'</button><button id="'+i+'">'+n.get("wcf.global.button.delete")+"</button></div>"}}},c}),define("WoltLabSuite/Core/Ui/Redactor/Spoiler",["EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog","./PseudoHeader"],function(e,t,i,n,a,r,o){"use strict";function s(e){this.init(e)}var l=0;return s.prototype={init:function(t){this._editor=t,this._elementId=this._editor.$element[0].id,this._spoiler=null,e.add("com.woltlab.wcf.redactor2","bbcode_spoiler_"+this._elementId,this._bbcodeSpoiler.bind(this)),e.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._callbackEdit=this._edit.bind(this),this._observeLoad()},_bbcodeSpoiler:function(e){e.cancel=!0,this._editor.button.toggle({},"woltlab-spoiler","func","block.format");var t=this._editor.selection.block();t&&"WOLTLAB-SPOILER"===t.nodeName&&(this._setTitle(t),t.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._editor.caret.end(t))},_observeLoad:function(){elBySelAll("woltlab-spoiler",this._editor.$editor[0],function(e){e.addEventListener("mousedown",this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;0===l&&(l=o.getHeight(t));var i=a.offset(t);e.pageY>i.top&&e.pageY<i.top+l&&(e.preventDefault(),this._editor.selection.save(),this._spoiler=t,r.open(this))},_save:function(e){e.preventDefault(),elData(this._spoiler,"label",elById("redactor-spoiler-"+this._elementId+"-label").value),this._setTitle(this._spoiler),this._editor.caret.after(this._spoiler),r.close(this)},_setTitle:function(e){var t=i.get("wcf.editor.spoiler.title",{label:elData(e,"label")});elData(e,"title")!==t&&elData(e,"title",t)},_delete:function(e){e.preventDefault();var t=this._spoiler.nextElementSibling||this._spoiler.previousElementSibling;null===t&&this._spoiler.parentNode!==this._editor.core.editor()[0]&&(t=this._spoiler.parentNode),null===t?(this._editor.code.set(""),this._editor.focus.end()):(elRemove(this._spoiler),this._editor.caret.end(t)),r.close(this)},_dialogSetup:function(){var e="redactor-spoiler-"+this._elementId,t=e+"-button-delete",n=e+"-button-save",a=e+"-label";return{id:e,options:{onClose:function(){this._editor.selection.restore()}.bind(this),onSetup:function(){elById(n).addEventListener(WCF_CLICK_EVENT,this._save.bind(this)),elById(t).addEventListener(WCF_CLICK_EVENT,this._delete.bind(this))}.bind(this),onShow:function(){elById(a).value=elData(this._spoiler,"label")}.bind(this),title:i.get("wcf.editor.spoiler.edit")},source:'<div class="section"><dl><dt><label for="'+a+'">'+i.get("wcf.editor.spoiler.label")+'</label></dt><dd><input type="text" id="'+a+'" class="long"><small>'+i.get("wcf.editor.spoiler.label.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+n+'" class="buttonPrimary">'+i.get("wcf.global.button.save")+'</button><button id="'+t+'">'+i.get("wcf.global.button.delete")+"</button></div>"}}},s}),define("WoltLabSuite/Core/Ui/Search/Page",["Core","Dom/Traverse","Dom/Util","Ui/Screen","Ui/SimpleDropdown","./Input"],function(e,t,i,n,a,r){"use strict";return{init:function(o){var s=elById("pageHeaderSearchInput");new r(s,{ajax:{className:"wcf\\data\\search\\keyword\\SearchKeywordAction"},callbackDropdownInit:function(e){if(e.classList.add("dropdownMenuPageSearch"),n.is("screen-lg")){elData(e,"dropdown-alignment-horizontal","right");var t=s.clientWidth;e.style.setProperty("min-width",t+"px","");var a=s.parentNode,r=i.offset(a).left+a.clientWidth-(i.offset(s).left+t),o=i.styleAsInt(window.getComputedStyle(a),"padding-bottom");e.style.setProperty("transform","translateX(-"+Math.ceil(r)+"px) translateY(-"+o+"px)","")}},callbackSelect:function(){return setTimeout(function(){t.parentByTag(s,"FORM").submit()},1),!0}});var l=a.getDropdownMenu(i.identify(elBySel(".pageHeaderSearchType"))),c=this._click.bind(this);elBySelAll("a[data-object-type]",l,function(e){e.addEventListener(WCF_CLICK_EVENT,c)});var d=elBySel('a[data-object-type="'+o+'"]',l);e.triggerEvent(d,WCF_CLICK_EVENT)},_click:function(e){e.preventDefault();var t=elById("pageHeader");t.classList.add("searchBarForceOpen"),window.setTimeout(function(){t.classList.remove("searchBarForceOpen")},10);var i=elData(e.currentTarget,"object-type"),n=elById("pageHeaderSearchParameters");n.innerHTML="";var a=elData(e.currentTarget,"extended-link");a&&(elBySel(".pageHeaderSearchExtendedLink").href=a);var r=elData(e.currentTarget,"parameters");r=r?JSON.parse(r):{},i&&(r["types[]"]=i);for(var o in r)if(r.hasOwnProperty(o)){var s=elCreate("input");s.type="hidden",s.name=o,s.value=r[o],n.appendChild(s)}var l=elBySel(".pageHeaderSearchType > .button",elById("pageHeaderSearchInputContainer"));l.textContent=e.currentTarget.textContent}}}),define("WoltLabSuite/Core/Ui/Sortable/List",["Core","Ui/Screen"],function(e,t){"use strict";function i(e){this.init(e)}return i.prototype={init:function(i){this._options=e.extend({containerId:"",className:"",offset:0,options:{},isSimpleSorting:!1,additionalParameters:{}},i),t.on("screen-sm-md",{match:this._enable.bind(this,!0),unmatch:this._disable.bind(this),setup:this._enable.bind(this,!0)}),t.on("screen-lg",{match:this._enable.bind(this,!1),unmatch:this._disable.bind(this),setup:this._enable.bind(this,!1)})},_enable:function(e){var t=this._options.options;e&&(t.handle=".sortableNodeHandle"),new window.WCF.Sortable.List(this._options.containerId,this._options.className,this._options.offset,t,this._options.isSimpleSorting,this._options.additionalParameters)},_disable:function(){window.jQuery("#"+this._options.containerId+" .sortableList")[this._options.isSimpleSorting?"sortable":"nestedSortable"]("destroy")}},i}),define("WoltLabSuite/Core/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)),this._handleElements(this._options.show,this._element.checked),this._handleElements(this._options.hide,!this._element.checked)},_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("WoltLabSuite/Core/Ui/User/Editor",["Ajax","Language","StringUtil","Dom/Util","Ui/Dialog","Ui/Notification"],function(e,t,i,n,a,r){"use strict";var o="",s=null;return{init:function(){s=elBySel(".userProfileUser"),["ban","disableAvatar","disableSignature","enable"].forEach(function(e){var t=elBySel(".userProfileButtonMenu .jsButtonUser"+i.ucfirst(e));t&&(elData(t,"action",e),t.addEventListener(WCF_CLICK_EVENT,this._click.bind(this)))}.bind(this))},_click:function(t){t.preventDefault();var i=elData(t.currentTarget,"action"),n="";switch(i){case"ban":elDataBool(s,"banned")&&(n="unban");break;case"disableAvatar":elDataBool(s,"disable-avatar")&&(n="enableAvatar");break;case"disableSignature":elDataBool(s,"disable-signature")&&(n="enableSignature");break;case"enable":n=elDataBool(s,"is-disabled")?"enable":"disable"}""===n?(o=i,a.open(this)):e.api(this,{actionName:n})},_submit:function(i){i.preventDefault();var n=elById("wcfUiUserEditorExpiresLabel"),a=n.previousElementSibling;a.classList.contains("innerError")&&elRemove(a);var r="";elById("wcfUiUserEditorNeverExpires").checked||(r=elById("wcfUiUserEditorExpiresDatePicker").value,""===r&&(a=elCreate("small"),a.className="innerError",a.textContent=t.get("wcf.global.form.error.empty"),n.parentNode.insertBefore(a,n)));var s={};s[o+"Expires"]=r,s[o+"Reason"]=elById("wcfUiUserEditorReason").value.trim(),e.api(this,{actionName:o,parameters:s})},_ajaxSuccess:function(e){switch(e.actionName){case"ban":case"unban":elData(s,"banned","ban"===e.actionName),elBySel(".userProfileButtonMenu .jsButtonUserBan").textContent=t.get("wcf.user."+("ban"===e.actionName?"unban":"ban"));var i=elBySel(".contentTitle",s),n=elBySel(".jsUserBanned",i);"ban"===e.actionName?(n=elCreate("span"),n.className="icon icon24 fa-lock jsUserBanned jsTooltip",n.title=e.returnValues,i.appendChild(n)):n&&elRemove(n);break;case"disableAvatar":case"enableAvatar":elData(s,"disable-avatar","disableAvatar"===e.actionName),elBySel(".userProfileButtonMenu .jsButtonUserDisableAvatar").textContent=t.get("wcf.user."+("disableAvatar"===e.actionName?"enable":"disable")+"Avatar");break;case"disableSignature":case"enableSignature":elData(s,"disable-signature","disableSignature"===e.actionName),elBySel(".userProfileButtonMenu .jsButtonUserDisableSignature").textContent=t.get("wcf.user."+("disableSignature"===e.actionName?"enable":"disable")+"Signature");break;case"enable":case"disable":elData(s,"is-disabled","disable"===e.actionName),elBySel(".userProfileButtonMenu .jsButtonUserEnable").textContent=t.get("wcf.acp.user."+("enable"===e.actionName?"disable":"enable"))}("ban"===e.actionName||"disableAvatar"===e.actionName||"disableSignature"===e.actionName)&&a.close(this),r.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\UserAction",objectIDs:[elData(s,"object-id")]}}},_dialogSetup:function(){return{id:"wcfUiUserEditor",options:{onSetup:function(e){elById("wcfUiUserEditorNeverExpires").addEventListener("change",function(){window[this.checked?"elHide":"elShow"](elById("wcfUiUserEditorExpiresSettings"))}),elBySel("button.buttonPrimary",e).addEventListener(WCF_CLICK_EVENT,this._submit.bind(this))}.bind(this),onShow:function(e){a.setTitle("wcfUiUserEditor",t.get("wcf.user."+o+".confirmMessage"));var i=elById("wcfUiUserEditorReason").nextElementSibling,n="wcf.user."+o+".reason.description";i.textContent=t.get(n),window[i.textContent===n?"elHide":"elShow"](i),i=elById("wcfUiUserEditorNeverExpires").nextElementSibling,i.textContent=t.get("wcf.user."+o+".neverExpires"),i=elBySel('label[for="wcfUiUserEditorExpires"]',e),i.textContent=t.get("wcf.user."+o+".expires"),i=elById("wcfUiUserEditorExpiresLabel"),i.textContent=t.get("wcf.user."+o+".expires.description")}},source:'<div class="section"><dl><dt><label for="wcfUiUserEditorReason">'+t.get("wcf.global.reason")+'</label></dt><dd><textarea id="wcfUiUserEditorReason" cols="40" rows="3"></textarea><small></small></dd></dl><dl><dt></dt><dd><label><input type="checkbox" id="wcfUiUserEditorNeverExpires" checked> <span></span></label></dd></dl><dl id="wcfUiUserEditorExpiresSettings" style="display: none"><dt><label for="wcfUiUserEditorExpires"></label></dt><dd><input type="date" name="wcfUiUserEditorExpires" id="wcfUiUserEditorExpires" class="medium" min="'+new Date(1e3*TIME_NOW).toISOString()+'" data-ignore-timezone="true"><small id="wcfUiUserEditorExpiresLabel"></small></dd></dl></div><div class="formSubmit"><button class="buttonPrimary">'+t.get("wcf.global.button.submit")+"</button></div>"}}}}),define("WoltLabSuite/Core/Controller/Condition/Page/Dependence",["Dom/ChangeListener","Dom/Traverse","EventHandler","ObjectMap"],function(e,t,i,n){"use strict";var a=elBySelAll('input[name="pageIDs[]"]'),r=[],o=new n,s=new n,l=!1;return{register:function(e,i){if(r.push(e),o.set(e,i),s.set(e,[]),!l){for(var n=0,c=a.length;c>n;n++)a[n].addEventListener("change",this._checkVisibility.bind(this));l=!0}t.parentByTag(e,"FORM").addEventListener("submit",function(){"none"===e.style.getPropertyValue("display")&&e.remove()}),this._checkVisibility()},_checkVisibility:function(){var e,t,n;e:for(var s=0,l=r.length;l>s;s++){e=r[s],n=o.get(e);for(var c=0,d=a.length;d>c;c++)if(t=a[c],t.checked&&-1!==n.indexOf(~~t.value)){this._showDependentElement(e);continue e}this._hideDependentElement(e)}i.fire("com.woltlab.wcf.pageConditionDependence","checkVisivility")},_hideDependentElement:function(e){elHide(e);for(var t=s.get(e),i=0,n=t.length;n>i;i++)elHide(t[i]);s.set(e,[])},_showDependentElement:function(e){elShow(e);for(var t=e;(t=t.parentNode)&&t instanceof Element;)"none"===t.style.getPropertyValue("display")&&s.get(e).push(t),elShow(t)}}}),define("WoltLabSuite/Core/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(WCF_CLICK_EVENT,function(){t.classList.remove("active")});var s=elById("settings_"+n+"_enabled");s.addEventListener(WCF_CLICK_EVENT,function(){t.classList.add("active")});var l=i.childByTag(t,"INPUT"),c=i.childByTag(t,"A");elData(c,"object-id",n),c.addEventListener(WCF_CLICK_EVENT,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(WCF_CLICK_EVENT,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("WoltLabSuite/Core/Ui/Page/Header/Fixed",["Core","EventHandler","Ui/Alignment","Ui/CloseOverlay","Ui/Screen"],function(e,t,i,n,a){"use strict";var r,o,s,l,c,d,u,h=!1;return{init:function(){r=elById("pageHeader"),o=elById("pageHeaderContainer"),this._initSearchBar(),a.on("screen-md-down",{match:function(){h=!0},unmatch:function(){h=!1},setup:function(){h=!0}}),t.add("com.woltlab.wcf.Search","close",this._closeSearchBar.bind(this))},_initSearchBar:function(){l=elById("pageHeaderSearch"),l.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()}),s=elById("pageHeaderPanel"),c=elById("pageHeaderSearchInput"),d=elById("topMenu"),u=elById("userPanelSearchButton"),u.addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),e.stopPropagation(),r.classList.contains("searchBarOpen")?this._closeSearchBar():this._openSearchBar()}.bind(this)),n.add("WoltLabSuite/Core/Ui/Page/Header/Fixed",function(){r.classList.contains("searchBarForceOpen")||this._closeSearchBar()}.bind(this)),t.add("com.woltlab.wcf.MainMenuMobile","more",function(t){"com.woltlab.wcf.search"===t.identifier&&(t.handler.close(!0),e.triggerEvent(u,WCF_CLICK_EVENT))}.bind(this))},_openSearchBar:function(){window.WCF.Dropdown.Interactive.Handler.closeAll(),r.classList.add("searchBarOpen"),u.parentNode.classList.add("open"),h||i.set(l,d,{horizontal:"right"}),l.style.setProperty("top",s.clientHeight+"px",""),c.focus()},_closeSearchBar:function(){r.classList.remove("searchBarOpen"),u.parentNode.classList.remove("open"),["bottom","left","right","top"].forEach(function(e){l.style.removeProperty(e)}),c.blur()}}}),define("WoltLabSuite/Core/Ui/Page/Search/Input",["Core","WoltLabSuite/Core/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("WoltLabSuite/Core/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,d=null;return{open:function(t,i,a,o){r=a,n.open(this),n.setTitle(this,i),o?s.textContent=e.get(o):s.textContent=e.get("wcf.page.pageObjectID.search.terms"),this._getSearchInputHandler().setPageId(t)},_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,l,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+' pointer jsTooltip" title="'+e.get("wcf.global.select")+'"></span>'),l=elCreate("li"),elData(l,"object-id",s.objectID),l.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>",l.addEventListener(WCF_CLICK_EVENT,this._click.bind(this)),c.appendChild(l);elShow(d)},_resetList:function(){var e=o.nextElementSibling;e&&e.classList.contains("innerError")&&elRemove(e),c.innerHTML="",elHide(d)},_getSearchInputHandler:function(){if(null===l){var e=this._buildList.bind(this);l=new a(elById("wcfUiPageSearchInput"),{callbackSuccess:e})}return l},_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"),s=o.parentNode.previousSibling.childNodes[0],c=elById("wcfUiPageSearchResultList"),d=elById("wcfUiPageSearchResultListContainer")),o.value="",elHide(d),c.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"></dd></dl></div><section id="wcfUiPageSearchResultListContainer" class="section sectionContainerList"><header class="sectionHeader"><h2 class="sectionTitle">'+e.get("wcf.page.pageObjectID.search.results")+'</h2></header><ul id="wcfUiPageSearchResultList" class="containerList wcfUiPageSearchResultList"></ul></section>'
 }}}}),define("WoltLabSuite/Core/Ui/User/Activity/Recent",["Ajax","Language","Dom/Util"],function(e,t,i){"use strict";function n(e){this.init(e)}return n.prototype={init:function(e){this._containerId=e;var i=elById(this._containerId);this._list=elBySel(".recentActivityList",i);var n=elCreate("li");n.className="showMore",this._list.childElementCount?(n.innerHTML='<button class="small">'+t.get("wcf.user.recentActivity.more")+"</button>",n.children[0].addEventListener(WCF_CLICK_EVENT,this._showMore.bind(this))):n.innerHTML="<small>"+t.get("wcf.user.recentActivity.noMoreEntries")+"</small>",this._list.appendChild(n),this._showMoreItem=n,elBySelAll(".jsRecentActivitySwitchContext .button",i,function(e){e.addEventListener(WCF_CLICK_EVENT,function(t){t.preventDefault(),e.classList.contains("active")||this._switchContext()}.bind(this))}.bind(this))},_showMore:function(t){t.preventDefault(),this._showMoreItem.children[0].disabled=!0,e.api(this,{actionName:"load",parameters:{boxID:~~elData(this._list,"box-id"),filteredByFollowedUsers:elDataBool(this._list,"filtered-by-followed-users"),lastEventId:elData(this._list,"last-event-id"),lastEventTime:elData(this._list,"last-event-time"),userID:~~elData(this._list,"user-id")}})},_switchContext:function(){e.api(this,{actionName:"switchContext"},function(){window.location.hash="#"+this._containerId,window.location.reload()}.bind(this))},_ajaxSuccess:function(e){e.returnValues.template?(i.insertHtml(e.returnValues.template,this._showMoreItem,"before"),elData(this._list,"last-event-time",e.returnValues.lastEventTime),elData(this._list,"last-event-id",e.returnValues.lastEventID),this._showMoreItem.children[0].disabled=!1):this._showMoreItem.innerHTML="<small>"+t.get("wcf.user.recentActivity.noMoreEntries")+"</small>"},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction"}}}},n}),define("WoltLabSuite/Core/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("WoltLabSuite/Core/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("WoltLabSuite/Core/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){e.matches=e.matches||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector,e.closest=e.closest||function(e){for(var t=this;t&&!t.matches(e);)t=t.parentElement;return t}}(Element.prototype),define("closest",function(){}),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,s){if(!Array.isArray(r))return i.apply(e,arguments);var l=a++;n.push(l),s?i(r,function(){var i=arguments;n[n.indexOf(l)]=function(){o.apply(e,i)},t()},function(){var i=arguments;n[n.indexOf(l)]=function(){s.apply(e,i)},t()}):i(r,function(){var i=arguments;n[n.indexOf(l)]=function(){o.apply(e,i)},t()})},e.require.config=i.config}(window),define("require.linearExecution",function(){});
\ No newline at end of file