/*
* XenForo permission.min.js
* Copyright 2010-2019 XenForo Ltd.
* Released under the XenForo License Agreement: http://xenforo.com/license-agreement
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,c){a instanceof String&&(a=String(a));for(var f=a.length,b=0;b<f;b++){var d=a[b];if(e.call(c,d,b,a))return{i:b,v:d}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,c){a!=Array.prototype&&a!=Object.prototype&&(a[e]=c.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,e,c,f){if(e){c=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var b=a[f];b in c||(c[b]={});c=c[b]}a=a[a.length-1];f=c[a];e=e(f);e!=f&&null!=e&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:e})}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
!function(a,e,c,f){XenForo.PermissionChoicesOld=function(a){this.__construct(a)};XenForo.PermissionChoicesOld.prototype={__construct:function(b){var d={};this.$form=b;this.$selects=b.find("select.PermissionChoice");this.$revokeOption=b.find('.RevokeOption input[type="checkbox"]');b=b.find(".PermissionTooltipOption");b.length&&b.each(function(){var b=a(this);a(b.data("permissionstate").split(" ")).each(function(a,c){d[c]=b})});this.tooltipOptions=d;this.$revokeOption.click(a.context(this,"updateRevokeStatus"));
this.updateRevokeStatus(!0);var c=this;this.$selects.each(function(){var b=a(this);var d=a("<span />").click(a.context(c,"handleClick")).data("select",b);var e=a('<div class="xenTooltip permissionTooltip" />').hide();b.hide().before(a("<div />").append(d).append(e));d.attr("title",XenForo.htmlspecialchars(d.attr("title"))).tooltip({offset:[-12,5],position:"bottom right",relative:!0,onBeforeShow:function(b){this.getTip().is(":empty")&&b.preventDefault()}});d.data("tooltip",e);c.setReplaceState(d,b,
e)})},handleClick:function(b){b=a(b.currentTarget);b.data("tooltip");var d=b.data("select"),c=d.get(0);c.selectedIndex=c.selectedIndex+1<c.length?c.selectedIndex+1:0;this.setReplaceState(b,d)},setReplaceState:function(b,a){var c=a.val();b.attr("class","permissionChoice permissionChoice_"+c);b.text(a.find(":selected").text());this.setTooltipState(b)},setTooltipState:function(a){var b=a.data("select").val();a=a.data("tooltip");this.tooltipOptions[b]?a.html(this.tooltipOptions[b].clone()):a.empty()},
updateRevokeStatus:function(a){var b=this.$form.find(".PermissionOptions");this.$revokeOption.is(":checked")?!0===a?b.hide():b.xfSlideUp():b.xfSlideDown()}};XenForo.PermissionNeverWarning=function(b){var d=a("#PermissionNeverTooltip");d.length&&(d.appendTo(c.body),b.find(".permission td.deny").tooltip({tip:"#PermissionNeverTooltip",position:"center right",offset:[0,5],effect:"fade",predelay:250}))};XenForo.register("form.PermissionChoices","XenForo.PermissionNeverWarning")}(jQuery,this,document);