/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
// ***************************
// js.compressed/jquery/jquery.thumbnail-radio-checkbox.min.js
// ***************************
(function(b){function f(){return"radio-checkbox-"+this.attr("name").replace(/\[|\]/g,"")}var g={thumbnailClass:"",preselect:null,select:null,unselect:null},e={init:function(c){var d=this;"object"===typeof c&&(d.settings=b.extend({},g,c));d.each(function(){var a=b(this);a.hide();b("<div></div>").addClass("radio-checkbox-thumbnail-container").addClass(function(){return"radio"==a.attr("type")?f.apply(a):""}).insertBefore(a).append(b("<div></div>").attr("id",a.attr("id")?"thumbnail-"+a.attr("id"):
"").addClass("radio-checkbox-thumbnail "+d.settings.thumbnailClass).addClass(function(){return"radio"==a.attr("type")?"has-hover":"no-hover"}).bind("mousedown.thumbnailRadioCheckbox",function(){return"function"===typeof d.settings.preselect?d.settings.preselect(b("img",this),a):!0}).bind("click.thumbnailRadioCheckbox",function(){b(this).hasClass("disabled")||"radio"==a.attr("type")&&b(this).hasClass("selected")||("checkbox"==a.attr("type")?(b(this).toggleClass("selected"),b(this).hasClass("selected")?
(a.prop("checked",!0),"function"===typeof d.settings.select&&d.settings.select(b("img",this),a)):(a.removeAttr("checked"),"function"===typeof d.settings.unselect&&d.settings.unselect(b("img",this),a))):(a.prop("checked",!0),b(".radio-checkbox-thumbnail-container."+f.apply(a)+" > div.selected").removeClass("selected"),b(this).addClass("selected"),"function"===typeof d.settings.unselect&&d.settings.unselect(b("img",this),a),"function"===typeof d.settings.select&&d.settings.select(b("img",this),a)))}).append(b("<img />").attr({src:a.attr("data-thumbnail"),
alt:a.next("label").text(),title:""}).css({width:a.attr("data-thumbnail-width")?a.attr("data-thumbnail-width")+"px":"auto",height:a.attr("data-thumbnail-height")?a.attr("data-thumbnail-height")+"px":"auto"})).append(a.nextAll(".radio-checkbox-inside-thumbnail"))).append(a.removeAttr("data-thumbnail").removeAttr("data-thumbnail-width").removeAttr("data-thumbnail-height"),a.nextAll());a.is(":checked")&&(a.prev().addClass("selected"),"function"===typeof d.settings.select&&d.settings.select(b("img",a.prev()),
a));a.is(":disabled")&&a.prev().addClass("disabled")});return this},enable:function(c,d){c.each(function(){var a=b(this);d?(a.prev().removeClass("disabled"),a.removeAttr("disabled")):(a.prev().addClass("disabled"),a.attr("disabled","disabled"))});return this},check:function(c,d){var a=c.prev(),e=b("img",a);d?("radio"==c.attr("type")&&(b(".radio-checkbox-thumbnail-container."+f.apply(c)+" > div.selected").removeClass("selected"),"function"===typeof this.settings.unselect&&this.settings.unselect(e,
c)),a.addClass("selected"),c.prop("checked",!0),"function"===typeof this.settings.select&&this.settings.select(e,c)):(a.removeClass("selected"),c.removeAttr("checked"),"function"===typeof this.settings.unselect&&this.settings.unselect(e,c));return this},option:function(){if(2<=arguments.length)this.settings[arguments[0]]=arguments[1];else if(1===arguments.length)return this.settings[arguments[0]];return this}};b.fn.thumbnailRadioCheckbox=function(){var c=arguments[0];this.settings=this.settings||
g;if(e[c])return e[c].apply(this,Array.prototype.slice.call(arguments,1));if("object"!==typeof c&&c)b.error("Method "+c+" does not exist.");else return e.init.apply(this,arguments)}})(jQuery);
;

// ***************************
// js.compressed/sb_modules.js
// ***************************
vBulletin.precache(["translate"],[]);vBulletin.ensureObj("sitebuilder");
$.extend(vBulletin.sitebuilder,function(d,H,I,F){function v(a,b,c,f,h){let g=d('<select name="data[{0}]" />'.format(a.name)),e={};f&&d.each(f,function(k,l){e[l]=d('<optgroup label="{0}" />'.format(p(l)))});a.data&&d.each(a.data,function(k,l){k=g;f&&(k=e[h(l)]);d("<option />").attr("value",l[b]).prop("selected",a.defaultvalue==l[b]).html(l[c]).appendTo(k)});d.each(e,function(k,l){l.length&&l.appendTo(g)});return g}function x(a){var b=d(".js-sb-module-config--filter_nodes--template");if(!b.length)return"";
a.hasOwnProperty("defaultvalue")||(a.defaultvalue={include:["all"]});b=b.clone().removeClass("js-sb-module-config--filter_nodes--template h-hide");a=a.defaultvalue;let c=a.hasOwnProperty("exclude")?"exclude":"include",f=a.hasOwnProperty("include_children")?a.include_children:!0,h=b.find("input[name='data[module_filter_nodes][include_children]']"),g=b.find("input.js-module_filter_nodes__key[value='include']"),e=b.find("input.js-module_filter_nodes__key[value='exclude']"),k=b.find("select.js-module_filter_nodes-values"),
l=b.find("input[name='data[module_filter_nodes][selection_type]']"),y=b.find("*[data-disable-on='exclude']"),z=b.find("*[data-disable-on='include']"),B=function(t,q){var n=k.data("selectBox-control")||{};t.each(function(){var r=d(this);r.attr("disabled","disabled");r.is("option")&&0<n.length&&n.find("li:has(> a[rel='"+r.val()+"'])").removeClass("selectBox-selected").addClass("selectBox-disabled")});q.each(function(){var r=d(this);r.removeAttr("disabled");if(r.is("option")&&0<n.length){var A="";r.is(":selected")&&
(A="selectBox-selected");n.find("li:has(> a[rel='"+r.val()+"'])").removeClass("selectBox-disabled").addClass(A)}})},C=b.find("*[data-hide-on='exclude']"),D=b.find("*[data-hide-on='include']");l.on("change vb-init",function(t){t=d(this);var q=t.val(),n=k.data("selectBox-control")||{};t.is(":checked")&&("all"==q||"current"==q?(k.attr("disabled","disabled"),0<n.length&&n.addClass("selectBox-disabled")):(k.removeAttr("disabled"),0<n.length&&n.removeClass("selectBox-disabled")))});b.find("input.js-module_filter_nodes__key").on("change",
function(t){"exclude"==this.value?(B(y,z),C.hide(),D.show()):(B(z,y),D.hide(),C.show())});"exclude"==c?(g.prop("checked",!1),e.prop("checked",!0),e.change()):(e.prop("checked",!1),g.prop("checked",!0),g.change());if(!a.hasOwnProperty(c))a.key=[];else if("string"==typeof a[c]||"number"==typeof a[c])a[c]=[a[c]];d.each(a[c],function(t,q){if("all"===q)return l.filter("[value='all']").prop("checked",!0),!1;if("current"===q)return l.filter("[value='current']").prop("checked",!0),!1;l.filter("[value='custom']").prop("checked",
!0);k.find("option[value='"+q+"']").prop("selected",!0)});l.trigger("vb-init");h.prop("checked",f);return b}function E(a){return d("<div />").addClass("config-required-mark h-left").append(a?"*":"&nbsp;")}function w(a,b,c=!1){"undefined"==typeof b&&(b="config-label h-left");b=d("<div />").addClass(b).addClass(a.name).html(a.label);G&&b.prop("title",a.name);a.description&&d("<div />").addClass("config-description").html(a.description).appendTo(b);if(a.isrequired||!c)a=E(1==a.isRequired),b=b.add(a);
return b}function m(a,b){const c=d("<div />").addClass("h-clearfix config-row");0==a.isEditable&&b&&(b.find("input").prop("readonly",!0),b.is("input")||b.prop("disabled",!0));if(a.ishiddeninput&&b)return b.attr("hidden",!0),b;const f=w(a);return c.append([f,d("<div></div>").addClass("config-value h-left").addClass(a.name).append(b)])}const p=F.get,G=1==d("#debug-information").length,u={TranslatableText(a){if(!("translations"in a))return this.Text(a);let b=this.Text(a);const c=d("<fieldset />").addClass("config-fieldset js-collapse-group h-hide-imp").attr("data-name",
a.name);for(const [,e]of Object.entries(a.translations)){var f=e.languageid,h=e.langtitle,g=e.value;g=d("<div />").addClass("config-value h-left").addClass(a.name).append(d(`<input type="text" name="data[${a.name}][${f}]" id="data[${a.name}][${f}]" />`).addClass("textbox config-textbox").val(g));h=d("<div />").addClass("config-label h-left").html(h);0==a.isEditable&&g.prop("readonly",!0);a.ishiddeninput&&g.attr("hidden",!0);0==f?b=g:a.ishiddeninput?c.append(g):(f=E(0),f=d("<div />").addClass("h-clearfix config-row").append(h,
f,g),c.append(f))}console.assert(b&&b.length,"Default input not found for translatable text field.");a.ishiddeninput||(c.length&&(null!=a.description||(a.description=""),a.description+=p("module_translatable_default_note"),a.description+=`<br/><a href="#" class="${"js-toggle-translations"}" data-name="${a.name}">`+p("translations")+"</a>"),b=w(a).add(b));b=d("<div />").addClass("h-clearfix config-row").append(b);c.length&&(b=b.add(c));return b},Text(a){let b;const c=d('<input type="text" name="data[{0}]" id="data[{0}]" />'.format(a.name)).addClass("textbox config-textbox").val(null!=
(b=a.defaultvalue)?b:"");return m(a,c)},LongText(a){let b;const c=d('<textarea name="data[{0}]" id="data[{0}]" rows="3" />'.format(a.name)).addClass("textbox config-textbox").val(null!=(b=a.defaultvalue)?b:"");return m(a,c)},YesNo(a){var b={option_1:d('<input type="radio" value="1" name="data[{0}]" id="data[{0}_1]" />'.format(a.name)),label_1:d("<label />").attr({"for":"data["+a.name+"_1]"}).text(p("yes")),option_0:d('<input type="radio" value="0" name="data[{0}]" id="data[{0}_0]" />'.format(a.name)),
label_0:d("<label />").attr({"for":"data["+a.name+"_0]"}).text(p("no"))};const c=b["option_"+a.defaultvalue];c&&c.prop("checked",!0);b=d("<div />").append(b.option_1,b.label_1,b.option_0,b.label_0);return m(a,b)},Checkboxes(a){const b=d("<div />");d.each(a.data,function(c,f){var h="";a.defaultvalue&&"undefined"!=typeof a.defaultvalue[c]&&1==a.defaultvalue[c]&&(h=' checked="checked"');c=d('<div><label><input type="checkbox" name="data[{0}][{1}]"{2} value="1" class="js-checkbox-always-send" /> {3}</label></div>'.format(a.name,
c,h,f));b.append(c)});return m(a,b)},Select(a){const b=d('<select name="data[{0}]" />'.format(a.name));if(""!=a.data)for(var c in a.data)d("<option />").attr("value",c).prop("selected",a.defaultvalue==c).text(a.data[c]).appendTo(b);return m(a,b)},ChannelSelect(a){const b=v(a,"nodeid","text",["special_options","channels"],function(c){return 1>c.nodeid?"special_options":"channels"});return m(a,b)},ContentTypeSelect(a){d.each(a.data,function(c,f){f.text=p(f.phrase)});const b=v(a,"value","text",["special_options",
"content_types"],function(c){return c.special?"special_options":"content_types"});return m(a,b)},ProfileFieldSelect(a){const b=v(a,"field","title");return m(a,b)},Slider(a){var b,c=b=0;let f=1,h=.1,g="";a.defaultvalue&&(b=a.defaultvalue);if(a.data&&"object"==typeof a.data){let e=a.data;e.hasOwnProperty("min")&&(c=parseFloat(e.min));e.hasOwnProperty("max")&&(f=parseFloat(e.max));e.hasOwnProperty("interval")&&(h=parseFloat(e.interval));e.hasOwnProperty("leftlabel")&&e.leftlabel&&(g+='<span class="h-left">'+
e.leftlabel+"</span>");e.hasOwnProperty("rightlabel")&&e.rightlabel&&(g+='<span class="h-right">'+e.rightlabel+"</span>");""!=g&&(g='<div class="config-slider-label">'+g+'<div class="h-clear"></div></div>')}c='data-min="{0}" data-max="{1}" data-interval="{2}"'.format(c,f,h);b=g+'<div class="js-module-config-slider config-slider" '+c+" >"+'\t<input type="hidden" name="data[{0}]" value="{1}" />'.format(a.name,b)+"</div>";b=d(b);return m(a,b)},ChannelIncludeExclude(a){const b=x(a);return m(a,b)},Custom(a){return m(a,
a.customValue)}};return{renderModuleConfig:function(a){if(u.hasOwnProperty(a.type))return u[a.type](a);console.log("Unknown config type",a.type,a)},attachTranslatableToggleEvent:function(a){a.offon("click.vbmodules",".js-toggle-translations",b=>{var c=d(b.currentTarget).data("name");c=a.find(`.${"js-collapse-group"}[data-name="${c}"]`);b.preventDefault();c.length&&c.toggleClass("h-hide-imp")})},detachTranslatableToggleEvent:function(a){a.off("click.vbmodules")},generateConfigInputs__Module_Filter_Nodes:x,
generateTranslatableForSearchModuleConfig:function(a){if(!("translations"in a))return u.Text(a);let b=u.Text(a),c=[],f=d("<div />").addClass("h-hide");for(const [,k]of Object.entries(a.translations)){var h=k.languageid,g=k.langtitle,e=k.value;e=d("<div />").addClass("field_column").addClass(a.name).append(d(`<input type="text" name="data[${a.name}][${h}]" id="data[${a.name}][${h}]" />`).addClass("textbox").val(e));g=d("<label />").addClass("label_column").html(g);0==a.isEditable&&e.prop("readonly",
!0);a.ishiddeninput&&e.attr("hidden",!0);0==h?b=e:a.ishiddeninput?f.append(e):(h=d("<div />").addClass("js-collapse-group").addClass("h-hide-imp").attr("data-name",a.name).addClass("form_row").append(g,e),c.push(h))}console.assert(b&&b.length,"Default input not found for translatable text field.");a.ishiddeninput||(c.length&&(null!=a.description||(a.description=""),a.description+=p("module_translatable_default_note"),a.description+=`<br/><a href="#" class="${"js-toggle-translations"}" data-name="${a.name}">`+
p("translations")+"</a>"),b=w(a,"label_column",!0).add(b));b=d("<div />").addClass("form_row").append(b);b=b.add(f);c.forEach(k=>{b=b.add(k)});return b}}}(jQuery,vBulletin,vBulletin.dialogtools,vBulletin.phrase));
;

// ***************************
// js.compressed/sb_page.js
// ***************************
vBulletin.precache("action active add_subnavigation_markchannelread ad_list_description ad_otherlocations ad_used_one_other_location ad_used_x_other_locations add_modules add_subforum adding_multiple_modules_not_allowed all applying_new_template are_you_sure_want_to_delete_ad_x cancel cannot_add_system_module cannot_convert_channel cannot_remove_system_module change_homepage change_homepage_confirm_x change_homepage_confirm_x_to_y change_homepage_please_select channels check_to_hide_module choose_base_module choose_options_favicon choose_options_site_logo click_text_edit_title confirm_deletion_gcpglobal confirm_deletion_x confirm_remove_page_desc content_types create_ad create_new_custom_module delete display_order do_you_want_to_cancel_editing_search_module do_you_want_to_exit_without_saving_page do_you_want_to_remove_channel do_you_want_to_remove_forum do_you_want_to_remove_module do_you_want_to_remove_tab drag_and_drop_module_here drop_page_here dropping_container_module_into_container_module_not_allowed edit edit_ad_x edit_blog_categories edit_custom_html_module edit_favicon edit_navigation_item edit_search_module edit_site_logo error_adding_widgets error_cloning_widget error_deleting_page error_fetching_channels error_loading_search_config_script error_processing_favicon error_processing_site_logo error_renaming_module_title error_retrieving_cloned_widget_template error_retrieving_configuration error_retrieving_list_user_groups error_retrieving_modules error_retrieving_navigation_bar_configuration error_retrieving_page_map error_retrieving_templates error_saving_configuration_module error_saving_forums error_saving_navigation_bar_configuration error_saving_page error_saving_search_config error_saving_site_logo error_uploading_logo exit_without_saving_page expand forum_changes_will_be_lost global_section_notice hompage_updated_reload input_navigation_item_name input_target_url invalid_image_url main_navigation_bar make_category make_forum manage_ads module_configuration module_icon move_not_allowed moving_main_nav_to_own_sub_nav_error moving_main_nav_with_sub_nav_error navbar_mark_channels_read new_navigation_item new_subnavigation_item next no no_ad_added no_configurations_found no_modules no_permission none overwrite_template_continue page_saved page_template_title_cannot_be_empty page_title_cannot_be_empty page_view_perm_admincp please_choose_overwrite_template_options please_enter_channel_title please_enter_new_module_title please_enter_new_template_name please_enter_page_name previous remove_channel remove_channel_q remove_forum remove_forum_q remove_module_q rename rename_custom_module reset save save_new_page save_page search_results select_edit_link_header special_options sub_navigation_bar subchannels_will_be_deleted switch_template template_changes_will_be_lost this_url_is_already_used title unable_to_delete_widget_instances uncheck_to_unhide_module url_too_long user_group_settings warning warning_gcpuser yes you_are_here you_can_also_drag_and_drop_modules_here you_cannot_revert_this_layout_confirm you_must_specify_a_screen_layout".split(" "),
[]);vBulletin.ensureObj("sitebuilder");
(function(a,R,O,ia){function La(b){return b.val()==b.prop("defaultValue")}function ja(){location.reload(!0)}function Ma(b,d,c){return new Promise((e,k)=>{b?O.openConfirmDialogSimple({title:d,message:c,iconType:"warning",onClickYes:e,onClickNo:k}):e()})}function Aa(b){var d=()=>b.css("maxHeight","80vh");d();b.on("dialogopen",d);return b}function Z(){setTimeout(function(){vBulletin.vBScroller&&vBulletin.vBScroller.initializeScroller&&a(".js-vbscroller-wrapper:visible").each(function(){vBulletin.vBScroller.initializeScroller(a(this))});let b=
a(".scroller.category"),d=a(".categories");b.length&&d.length&&(d.width()<=b.width()?a(".category-arrow-left, .category-arrow-right").css("visibility","hidden"):a(".category-arrow-right").css("visibility","visible"))},0)}function ra(){var b=a("#edit-page-dropdown .panel .panel-main-content:visible");0<b.length&&(b=parseFloat(b.css("margin-left"))+parseFloat(b.css("margin-right"))+parseFloat(b.css("border-left-width"))+parseFloat(b.css("border-right-width"))+parseFloat(b.css("padding-left"))+parseFloat(b.css("padding-right")),
a("#edit-page-dropdown .panel .panel-main-content").width(a("#edit-page-dropdown .panel:visible").width()-a("#edit-page-dropdown .panel .panel-header-text:visible").outerWidth(!0)-b-1),a("#edit-page-dropdown form .form-gutter-right").width(Math.ceil((a("#edit-page-dropdown form:visible").width()-a("#edit-page-dropdown .panel:visible").outerWidth(!0))/2)),Z())}function pb(b,d){if(b.is(".container-widget")){var c=b.find(".js-admin-widget-list");c.css({minHeight:"35px",height:"auto",paddingBottom:"10px"}).closest(".js-widget-content").removeClass("h-hide").css({minHeight:"35px"});
if(!a.isEmptyObject(d)){var e=[];a.each(d,function(){e.push(this)});e.sort(function(k,r){return k.displayorder==r.displayorder?0:k.displayorder<r.displayorder?-1:1});a.each(e,function(){var k=a(this.rendered_template);this.hidden&&k.addClass("hidden-widget");c.append(k)})}}}function ca(b,d,c){var e=b.attr("data-widget-id");b={widgetinstanceid:b.attr("data-widget-instance-id")||"",widgetid:e,guid:"",userid:0,channelId:0,withTemplate:!1};c="undefined"==typeof c?!1:!!c;vBulletin.AJAX({call:"/ajax/api/widget/fetchConfigAndIsUserEditable",
data:b,success:function(k){var r=k;c||(r=k.config);"function"==typeof d&&d(r)}})}function ka(b){b.tab_data||(b.tab_data=[]);b.default_tab||(b.default_tab=0);b.submodules_key||(b.submodules_key="tabbedContainerSubModules__temp");b.display_tabs||(b.display_tabs="");if(""==b.display_tabs){var d={};a.each(b.tab_data,function(c,e){d[c]="1"});b.display_tabs=d}return b}function la(){"undefined"==typeof da&&(da=a("#config_pagetemplateid").val()||a("#select-template input[type=radio]:checked").val()||"");
return da}function Na(b){b=parseInt(b,10);0<b&&(da=b,a("#config_pagetemplateid, #save-page-form #pagetemplateid-yes, #save-page-form #pagetemplateid-new").val(da))}function sa(b){b=b.closest(".js-section");return b.length?b.data("section")||0:0}function ta(b){b=b.prev(".canvas-widget");return b.length?b.data("widget-instance-id")||0:0}function ma(b,d){vBulletin.AJAX({call:"/ajax/api/widget/saveAdminConfig",data:{widgetid:b.attr("data-widget-id"),widgetinstanceid:b.attr("data-widget-instance-id")||
"",pagetemplateid:la(),data:d,displaysection:sa(b),displayafterwidgetinstanceid:ta(b)},complete:function(){a("body").css("cursor","auto")}})}function ua(b){b=b.parents(".canvas-widget");return b.length?($parentModule=a(b[0]),parseInt($parentModule.data("widget-instance-id"),10)):0}function na(b){var d=b.parents(".canvas-widget[data-is-tabbed-container='true']");b.data("is-tabbed-container")&&Ba(b);0!=d.length&&Ba(a(d[0]))}function aa(b){var d={};b.find("> .js-admin-widget-content > .js-admin-widget-tab").each(function(){var c=
a(this),e=[],k=c&&c.data("tab-number")||0,r=c&&c.data("tab-title")||"";d[k]={title:r};c.find("> .widget-content > .canvas-layout-row > .canvas-widget-list > .canvas-widget:not(.dummy-widget)").each(function(){var v=a(this),p=v.data("widget-id");v=v.data("widget-instance-id")||v.attr("data-widget-instance-id");var f={};v&&(f.widgetinstanceid=v);p&&(f.widgetid=p);a.isEmptyObject(f)||e.push(f)});d[k].widgets=e});return d}function Ba(b){ca(b,function(d){d=ka(d);d.tab_data=aa(b);a.isEmptyObject(d)||ma(b,
d)})}function Oa(b){vBulletin.AJAX({call:"/ajax/api/widget/deleteWidgetInstances",data:{widgetInstanceIds:b},api_error:vBulletin.ajaxtools.logApiError})}function va(b,d,c,e,k,r){var v=la(),p=""==v||0==v;if(p){if(Pa.saveNewWidgetInstance){Qa.one("save-new-widgetinstance-pagetemplateid-ready",function(f){va(b,d,c,e,k,r)});return}Pa.saveNewWidgetInstance=!0}vBulletin.AJAX({call:"/ajax/api/widget/saveNewWidgetInstance",data:{containerinstanceid:b,widgetid:d,pagetemplateid:v,subWidgetConfig:c,displaysection:k,
displayafterwidgetinstanceid:r},success:function(f){p&&f.pagetemplateid&&(Na(f.pagetemplateid),Qa.trigger("save-new-widgetinstance-pagetemplateid-ready"));f.widgetinstanceid&&"function"==typeof e&&e(f.widgetinstanceid)}})}function oa(b){if(b.data("is-tabbed-container")){var d=b.attr("data-widget-instance-id");if(!d){var c=ua(b),e=sa(b),k=ta(b);return va(c,b.attr("data-widget-id"),{},function(q){b.attr("data-widget-instance-id",q);return oa(b)},e,k)}if(a.isEmptyObject(wa))return Ra(oa,[b]);if(!b.data("tabbed-container-initialized")){var r=
b.find(".js-admin-widget-tab-panel-template");c=r.find(".js-admin-widget-list");var v=b.find(".js-admin-widget-tab-header-template");e=b.find(".js-admin-widget-content");var p=e.find(".js-tab-headers"),f=p.find(".js-tab-add");r.detach().removeClass("js-admin-widget-tab-panel-template");v.detach().removeClass("js-admin-widget-tab-header-template");e.tabs({beforeActivate:function(q,h){if(a(h.newTab).hasClass("js-tab-add"))return!1}});var m=e.tabs("widget");c.css({minHeight:"60px",height:"auto",paddingBottom:"10px"});
p.find(".js-tab-add").on("click",function(){ca(b,function(q){var h=ka(q.config),g=h.tab_data.length||0,t=q.isusereditable.tab_data||!1;O.openPromptDialogSimple({title:"enter_tab_title",onClickOk:function(n){if(!n)return!1;y(n,[],g,g,t);h.display_tabs[g]="1";h.tab_data=aa(b);a.isEmptyObject(h)||ma(b,h)}})},!0)});v.find(".js-edit-tab-button").on("click",function(){var q=a(this).closest("li[aria-controls]"),h=q.attr("aria-controls"),g=m.find(".js-admin-widget-tab[id='"+h+"']"),t=g&&g.data("tab-title")||
"";ca(b,function(n){var u=ka(n);O.openPromptDialogSimple({title:"enter_tab_title",initialValue:t,onClickOk:function(w){q.find("span.js-tab-title").text(w);g.data("tab-title",w);u.tab_data=aa(b);a.isEmptyObject(u)||ma(b,u)}})});return!1});v.find(".js-remove-tab-button").on("click",function(){var q=a(this).closest("li[aria-controls]"),h=q.attr("aria-controls"),g=m.find(".js-admin-widget-tab[id='"+h+"']");ca(b,function(t){var n=ka(t.config),u=g.data("tab-number");O.openConfirmDialogSimple({title:"remove_tab_q",
message:["do_you_want_to_remove_tab",g.data("tab-title")],iconType:"warning",onClickYes:function(){n.default_tab==u&&(n.default_tab=0);Array.isArray(n.display_tabs)||(n.display_tabs=a.map(n.display_tabs,function(x){return x}));n.display_tabs.splice(u,1);var w=[];g.find(".canvas-widget").each(function(x,F){(x=a(this).data("widget-instance-id"))&&w.push(x)});w.length&&Oa(w);q.remove();g.remove();p.find("li:not('.js-tab-add')").each(function(x,F){F=a(this).attr("aria-controls");F=m.find(".js-admin-widget-tab[id='"+
F+"']");F.length&&F.data("tab-number",x)});m.tabs("refresh");n.tab_data=aa(b);a.isEmptyObject(n)||ma(b,n);ea();V=!0}})},!0);return!1});var y=function(q,h,g,t,n){"undefined"==typeof q&&(q="Untitled Tab");"undefined"==typeof h&&(h=[]);"undefined"==typeof g&&(g=b.find(".js-admin-widget-tab").length);var u=[];for(J in h)h.hasOwnProperty(J)&&u.push(J);u.sort(function(A,D){return A-D});var w=u.length,x=r.clone().uniqueId().removeClass("h-hide").data("tab-number",g).data("tab-title",q),F=x.find(".js-admin-widget-list");
J=x.attr("id");var N=v.clone(!0).removeClass("h-hide");N.children("a.js-tab-header-link").attr("href","#"+J);N.find("span.js-tab-title").text(q);for(j=0;j<w;j++){var J=u[j],I=h[J],K=I.widgetid||wa[I.guid],l=I.widgetinstanceid||"";q=a('<div data-widget-id="'+K+'" />');q.attr("data-tab-number",g);q.attr("data-widget-order",J);q.attr("data-widget-instance-id",l);q.append(a('<img src="images/loader-box-blue.gif" /> '));F.append(q);K&&(J=function(A,D,z,G){return function(E){E=E.filter(function(){return this.nodeType===
Node.ELEMENT_NODE});if(z)E.attr("data-widget-instance-id",z);else{var B=A.adminconfig||{},C=sa(G),H=ta(G);va(d,D,B,function(U){E.attr("data-widget-instance-id",U);Ba(b)},C,H)}if(!n){B=E.find(".js-move-button");C=E.find(".js-edit-button");H=E.find(".js-remove-button");var L=E.find(".js-edit-tab-button"),M=E.find(".js-remove-tab-button");B.hide();C.hide();H.hide();L.hide();M.hide();E.addClass("js-widget-non-sortable")}G.replaceWith(E);E.filter(":not(.container-widget)").find(".toggle-button").trigger("click",
[!0]);oa(E)}}(I,K,l,q),Sa(q,J))}f.before(N);m.append(x);m.tabs("refresh");m.tabs("option","active",t);F.prepend('<div class="canvas-widget dummy-widget dummy-widget--no-fixed-height"><span>{0}</span></div>'.format(vBulletin.phrase.get("drag_and_drop_modules_below")))};ca(b,function(q){var h=ka(q.config),g=h.tab_data,t=g.length,n=h.default_tab;q=q.isusereditable.tab_data||!1;for(h=0;h<t;h++)y(g[h].title,g[h].widgets,h,n,q);q?p.sortable({helper:"clone",opacity:1,axis:"x",items:"li:not('.js-tab-add')",
cancel:".js-edit-tab-button, .js-remove-tab-button",start:function(){old_numidx_to_controls={};new_controls_to_numidx={};m.find(".js-admin-widget-tab").each(function(u,w){old_numidx_to_controls[u]=a(this).attr("id")})},stop:function(){p.find("li:not('.js-tab-add')").each(function(u,w){w=a(this).attr("aria-controls");var x=m.find(".js-admin-widget-tab[id='"+w+"']");x.length&&(x.data("tab-number",u),m.append(x));new_controls_to_numidx[w]=u});m.tabs("refresh");ca(b,function(u){n=new_controls_to_numidx[old_numidx_to_controls[n]];
u.default_tab=n;var w={},x;for(x in u.display_tabs)w[new_controls_to_numidx[old_numidx_to_controls[x]]]=u.display_tabs[x];u.display_tabs=w;u.tab_data=aa(b);a.isEmptyObject(u)||ma(b,u)})}}):f.hide()},!0);b.data("tabbed-container-initialized",!0)}}}function Ta(b,d){var c=a(".js-canvas-layout-container > .canvas-layout").attr("id");S.tempModuleHTMLCache||(S.tempModuleHTMLCache={},a(".js-canvas-layout-container .canvas-widget").each(function(){var k=a(this).data("widget-instance-id");S.tempModuleHTMLCache["widgetinstance_"+
k]=this.outerHTML}));let e=a(".js-canvas-layout-container");e.text("");vBulletin.AJAX({call:"/admin/get-layouts-for-sitebuilder",data:{pagetemplateid:pageData.pagetemplateid,channelid:pageData.channelid},success:function(k){e.html(k.screenlayoutlist);if(k.widgets&&0<k.widgets.length){let r=a("#"+c);a.each(k.widgets,function(v,p){v=r.find(".canvas-widget-list.section-"+v);for(let f of p)v.append(f.rendered_template),p=v.find(".canvas-widget").filter(function(){return a(this).data("widget-instance-id")==
f.widgetinstanceid}),"undefined"!=typeof f.subModules&&pb(p,f.subModules),oa(p)})}a(".js-section-global").each((r,v)=>{a("<div />").addClass("global-section-notice").html(vBulletin.phrase.get("global_section_notice")).prependTo(v)});vBulletin.ensureFun(d)()},title_phrase:"sitebuilder",error_phrase:"unable_to_load_layouts"})}function W(b,d){var c=d.enableButtons;b=a(".js-top-menu-sitebuilder--list .js-top-menu-link");c?(a(".js-top-menu-user").removeClass("h-hide"),b.removeClass("b-top-menu__item-link--selected b-top-menu__item-link--disabled")):
(d=a(d.currentButton),b.removeClass("b-top-menu__item-link--selected").addClass("b-top-menu__item-link--disabled"),d.addClass("b-top-menu__item-link--selected"),a(".js-top-menu-user").addClass("h-hide"))}function Ua(b,d){a(".js-top-menu-sitebuilder .js-top-menu-link");W(null,{enableButtons:!d,currentButton:b});a(document.body).toggleClass("edit-mode "+b.id,d).toggleClass("view-mode",!d);a(".js-top-menu-user").toggleClass("h-hide",d)}function Y(){a(this).hasClass("selected")||a(document.body).hasClass("edit-mode")||
Ua(this,!0);return!1}function Va(){Ua(this,!1);return!1}function Wa(b,d){b=a("<div />").append(b.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,'<span class="axd-placeholder">{0}'.format(vBulletin.phrase.get("x_will_show_up_here_when_saved",d))).replace(/<vb:/g,"&lt;vb:").replace(/<\/vb:/g,"&lt;/vb:"));b.find("span.axd-placeholder").not(":first").remove();b.find("iframe").remove();return b.html()}function qb(){function b(l,A={}){let D=a("<div />").addClass("nav-item-controls h-right"),
z=a("<li />").append("<label>{0}</label>".format(l.label));A={showDelete:!0,showEdit:!0,...A};A.showDelete&&D.append('<i>|</i><span class="navbar-item-delete b-icon b-icon__trash b-icon--active" title="{0}"></span>'.format(Q("delete")));A.showEdit&&D.append('<i>|</i><span class="navbar-item-edit b-icon b-icon__pencil b-icon--active" title="{0}"></span>'.format(Q("edit")));D.append('<i>|</i><span class="navbar-item-opensubnav b-icon b-icon__arrow-right-m" title="{0}"></span>'.format(Q("expand")));
z.append(D).data({"item-phrase":l.phrase,"item-name":l.label,"item-name-translations":l.labelTranslations,"item-url":l.url,"item-routeid":l.routeid,"item-newwindow":l.newWindow,"item-usergroups":l.userGroups,"item-attr":l.attr,...(l.special&&{"item-special":l.special})});return z}function d(){return new Promise((l,A)=>{R.AJAX({call:"/ajax/api/site/loadHeaderNavbar",data:{siteId:1,url:location.pathname+location.search,edit:0,channelId:pageData.channelid||pageData.nodeid||0},success:function(D){l(D)}})})}
function c(l=!1){let A="navbar"==h,D=A?a("#channel-tabbar ul"):a("#footer-tabbar ul.nav-list"),z=A?a("#channel-subtabbar ul"):a(),G={};const E=new Promise((C,H)=>{l?d().then(L=>{L.forEach(M=>{0<M.routeid&&(G[M.routeid]=M.normalizedUrl)});C()}):C()});D.html("");z.html("");var B=function(C,H,L){var M=(H.data("item-newwindow")?' target="_blank" ':" ")+(H.data("item-attr")||"");L=H.hasClass("selected")&&L?' class="current"':"";var U="<li{0}><a {1}>{2}</a></li>".format;{var pa=H.data("item-name");const Ca=
H.data("item-name-translations"),Da=pageData.languageid;pa=Ca[Da]&&""!=Ca[Da]?Ca[Da]:pa}M=a(U.call("<li{0}><a {1}>{2}</a></li>",L,M,pa));L=H.data("item-routeid");H=H.data("item-url");0<L&&G.hasOwnProperty(L)&&(H=G[L]);M.find("a").prop("href",g(H));C.append(M)};E.then(()=>{a("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var C=a(this);B(D,C,A);C.hasClass("selected")&&a(C.data("subnav-element")).find("li").each(function(){B(z,a(this),!0)})})})}function e(l){var A=l.closest("li"),D=a("#edit-navbar"),
z=D.find(".subnavbar-ui-wrapper");D.find("li").removeClass("h-disabled selected");D.find(".navbar-item-opensubnav").removeClass("b-icon--active");A.addClass("selected");l.addClass("b-icon--active");z.find("ul").hide();a(A.data("subnav-element")).show();z.show()}function k(l){return a(".js-sitenav-translations",N).filter((A,D)=>l?a(D).data("languageid")==l:!0).find("input")}function r(l=null){let A="url",D="",z=0,G="",E="",B=!1;k(void 0).val("");if(l){D=l.data("item-url")||"";G=l.data("item-attr")||
"";E=l.data("item-name")||"";B=l.data("item-newwindow")||!1;z=parseInt(l.data("item-routeid")||0,10);0<z&&(D="",A="routeid");l=l.data("item-name-translations");for(const [C,H]of Object.entries(l))l=H,k(C).val(l)}a("#navbar-edit-name").val(E);a("#navbar-edit-url").val(D);a("#navbar-edit-attr").val(G);a("#navbar-edit-newwindow").prop("checked",B);a(`.js-navbar-pagelist option[value="${z}"]`).prop("selected",!0);a(`#navbar-edit-item input[name="navitem_type"][value="${A}"]`).prop("checked",!0)}function v(l){if("markchannelsread"==
l)return l=new n("navbar_mark_channels_read"),l.label=Q("navbar_mark_channels_read"),l.special="markchannelsread",b(l,{showEdit:!1});throw Error("Unknown special navbar item type: "+l);}var p=null,f=null,m="",y="",q="",h="",g=function(l){l||(l="");return l.match(/^(https?:\/\/|mailto:)/i)?l:"/"==l.substr(0,1)?pageData.baseurl+l:pageData.baseurl+"/"+l},t=function(l,A,D,z,G,E,B){l=new n(l,A,D,z,G,E,B);return b(l)};class n{constructor(l="",A=[],D="#",z=!1,G=[],E="",B="",C=""){this.phrase=l;this.labelTranslations=
A;this.url=D;this.newWindow=z;this.userGroups=G||[];this.attr=E;this.routeid=B;this.special=C;this.label=JShtmlEncode(this.labelTranslations[0]||"")}}var u=function(l,A,D,z,G,E,B,C){l=t(l,A,D,z,G,B,C);l.appendTo(f);var H=a("<ul />").addClass("sub-navbar-list navbar-list sortable");for(const L in E)if(E.hasOwnProperty(L)){A=E[L];D=A.phrase?A.phrase:"";z=A.title_translations||[];G=A.url?A.url:"";B=A.newWindow?A.newWindow:!1;C=A.usergroups?A.usergroups:[];let M=A.attr?A.attr:"",U=A.routeid?A.routeid:
0;(A.special&&""!=A.special?v(A.special):t(D,z,G,B,C,M,U)).appendTo(H)}(function(){H.sortable({start:function(L,M){M.placeholder.html(vBulletin.phrase.get("drop_page_here")).height(M.item.height()-2)},stop:function(L,M){c()},receive:function(L,M){L=M.item.data("subnav-element")||a();L.is(":visible")?(M.sender.sortable("cancel"),vBulletin.warning("move_not_allowed","moving_main_nav_to_own_sub_nav_error")):0<L.find("li").length&&(M.sender.sortable("cancel"),vBulletin.warning("move_not_allowed","moving_main_nav_with_sub_nav_error"))},
connectWith:".sortable",placeholder:"sortable-highlight",forcePlaceholderSize:!0}).disableSelection()})();H.hide();H.appendTo("#navbar-ui-container .subnavbar-list-container");l.data("subnav-element",H);return l},w=function(l,A,D,z,G,E,B){$newItem=t(l.data("item-phrase"),A,D,z,G,E,B);l.data("subnav-element")&&$newItem.data("subnav-element",l.data("subnav-element"));l.hasClass("selected")&&$newItem.addClass("selected");l.replaceWith($newItem)},x=function(l){h=l;"navbar"==h?(m=a("#channel-tabbar ul").html(),
y=a("#channel-subtabbar ul").html(),q=a("#channel-tabbar ul li.current a").attr("href"),a("#channel-subtabbar.h-hide").toggleClass("h-hide default-hide")):(m=a("#footer-tabbar ul.nav-list").html(),q=a("#footer-tabbar ul.nav-list li.current a").attr("href"));a("#admin-navbar-strip-gutter").removeClass().addClass("navbar-"+h);a("#header").add("#header-axd").hide();a("#navbar-ui-container").find(".navbar-ui-wrapper, .subnavbar-ui-wrapper").remove();var A=a("#edit-navbar");A.find(".panel-header-text").hide();
a("#edit-navbar #panel-header-"+h).show();vBulletin.AJAX({call:"/ajax/api/site/"+("navbar"==h?"loadHeaderNavbar":"loadFooterNavbar"),data:{siteId:1,edit:1},success:function(D){var z=a("<ul />").addClass("main-navbar-list navbar-list sortable "+h),G=a("<div />").addClass("new-nav-item main-nav js-new-nav").html(vBulletin.phrase.get("new_navigation_item")),E=a("<h4 />").text(vBulletin.phrase.get("main_navigation_bar"));G=a("<div />").addClass("navbar-ui-wrapper").append(E).append(z).append(G).appendTo("#navbar-ui-container");
z.sortable({start:function(H,L){L.placeholder.html(vBulletin.phrase.get("drop_page_here")).height(L.item.height()-2)},stop:function(H,L){c()},connectWith:".sortable",placeholder:"sortable-highlight",forcePlaceholderSize:!0}).disableSelection();f=z;z=a("<div />").addClass("subnavbar-list-container");E=a("<div />").addClass("new-nav-item sub-nav js-new-nav").html(vBulletin.phrase.get("new_subnavigation_item"));var B=a("<div />").addClass("new-nav-item sub-nav js-add-mark-channels").html(vBulletin.phrase.get("add_subnavigation_markchannelread")),
C=a("<h4 />").text(vBulletin.phrase.get("sub_navigation_bar"));a("<div />").addClass("subnavbar-ui-wrapper").append(C).append(z).append(E).append(B).appendTo("#navbar-ui-container").hide();if(D){for(const H in D)D.hasOwnProperty(H)&&(z=D[H],u(z.phrase?z.phrase:"",z.title_translations||[],z.url?z.url:"",z.newWindow?!0:!1,z.usergroups?z.usergroups:[],z.subnav?z.subnav:[],z.attr?z.attr:"",z.routeid?z.routeid:0));"navbar"==h&&e(G.find(".navbar-item-opensubnav").first());c();A.slideDown("slow")}},error_phrase:"error_retrieving_navigation_bar_configuration"})};
a(document).on("vb-sitebuilder-panel--navbar",function(){var l=a(".js-top-menu-tab--navbar").get(0);a("#edit-navbar").is(":hidden")&&vBulletin.assertUserHasAdminPermission("canusesitebuilder",l,function(){Y.apply(l);x("navbar")});return!1});a(document).on("vb-sitebuilder-panel--footer",function(){var l=a(".js-top-menu-tab--footer").get(0);a("#edit-navbar").is(":hidden")&&vBulletin.assertUserHasAdminPermission("canusesitebuilder",l,function(){Y.apply(l);x("footer")});return!1});var F=function(l){a("#navbar-edit-item").dialog({autoOpen:!0,
modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:400,dialogClass:"dialog-container navbar-item-dialog-container",open:function(){a("#navbar-edit-name").trigger("focus")}}).dialog("option","title",l||vBulletin.phrase.get("edit_navigation_item")).dialog("open")};const N=a("#navbar-edit-item");a("#edit-navbar").on("click",".js-new-nav",function(){p=null;f=0<a(this).closest(".navbar-ui-wrapper").length?a(this).closest(".navbar-ui-wrapper").find("ul"):a(this).closest(".subnavbar-ui-wrapper").find("ul").filter(":visible");
r();F(a(this).html());return!1});let J=null;a("#edit-navbar").on("click",".js-add-mark-channels",function(){const l=a(this).closest(".subnavbar-ui-wrapper").find("ul").filter(":visible"),A=l.find("li").filter((D,z)=>"markchannelsread"==a(z).data("item-special"));0==A.length?v("markchannelsread").appendTo(l):(clearTimeout(J),A.addClass("flash"),J=setTimeout(()=>A.removeClass("flash"),1500));return!1});a(document).on("click","#navbar-edit-save",function(){var l=a("#navbar-edit-name"),A=a("#navbar-edit-url"),
D=a('input[name="navitem_type"]:checked').val(),z=l.val(),G=A.val(),E=a(".js-navbar-pagelist option:selected").val();let B=[];k().each((C,H)=>B[H.dataset.languageid]=H.value);null!=B[0]||(B[0]=z);"routeid"!=D&&(E=0);""==B[0]?vBulletin.warning("edit_navigation_item","input_navigation_item_name",l):""==G&&"url"==D?vBulletin.warning("edit_navigation_item","input_target_url",A):(l=a("#navbar-edit-newwindow").prop("checked"),A=a("#navbar-edit-item").data("edit-usergroups"),D=a("#navbar-edit-attr").val(),
p?w(p,B,G,l,A,D,E):(G=u("",B,G,l,A,[],D,E),f.is(".main-navbar-list.navbar")&&e(G)),c(),f=p=null,a("#navbar-edit-item").dialog("close"));return!1});a(document).on("click","#navbar-edit-cancel",function(){a("#navbar-edit-item").dialog("close");return!1});var I=!1;a(document).on("click","#navbar-edit-usergroups",function(){var l=a("#navbar-edit-usergroups-dialog"),A=function(){var z=l.find(".select_all"),G=l.find(".navbar-usergroup-checkbox");G.prop("checked",!1);var E=function(){var C=G.filter(":checked").length==
G.length&&G.eq(0).is(":checked");z.prop("checked",C)};G.off("change").on("change",E);z.off("change").on("change",function(){G.prop("checked",a(this).prop("checked"))});if(!p)return!1;var B=p.data("item-usergroups-temp");B||(B=p.data("item-usergroups"));a.each(B,function(C,H){a("#navbar-usergroup-checkbox-"+H).prop("checked",!0)});E()},D=function(){var z=[];l.find(".dialog-body input[type=checkbox]").each(function(){a(this).prop("checked")&&z.push(a(this).val())});a("#navbar-edit-item").data("edit-usergroups",
z);p&&p.data("item-usergroups-temp",z)};I?l.dialog("open"):(l.dialog({title:vBulletin.phrase.get("user_group_settings"),autoOpen:!0,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:500,dialogClass:"dialog-container pagemap-dialog-container input-dialog",create:function(){var z=a(this);z.find(".cancel-button").on("click",function(){z.dialog("close")});z.find(".save-button").on("click",function(){D();z.dialog("close")});vBulletin.AJAX({call:"/ajax/api/usergroup/fetchUsergroupList",success:function(G){var E=
[];a(G).each(function(){E.push('<div class="blockrow"><label><input type="checkbox" class="navbar-usergroup-checkbox" id="navbar-usergroup-checkbox-{0}" value="{0}"><span>{1}</span></label></div>'.format(this.usergroupid,this.title))});z.find(".dialog-body").html(E.join(""));z.dialog("option","position",{of:window});A()},error_phrase:"error_retrieving_list_user_groups",after_error:function(){z.dialog("close")}})},open:function(){A()}}),I=!0);return!1});a("#edit-navbar").on("click",".navbar-item-delete",
function(){var l=a(this).closest("li");l.is(".selected")&&(a("#edit-navbar .subnavbar-ui-wrapper").hide(),a(l.data("subnav-element")).remove());l.remove();c();return!1});a("#edit-navbar").on("click",".navbar-item-edit",function(){var l=a(this).closest("li");p=l;f=l.closest("ul");p.data("item-usergroups-temp",null);r(p);F(a(this).html());return!1});a(".js-onclick-set-navitem-type").on("click",l=>{a("#edit-navbar input[name='navitem_type']").prop("checked",!1);a(l.currentTarget).find("input[name='navitem_type']").prop("checked",
!0)});a("#edit-navbar").on("click",".navbar-item-opensubnav",function(){e(a(this));c();return!1});a(document).on("click",".navbar-navbar #admin-navbar-strip .lnkExitWithoutSaving, .navbar-footer #admin-navbar-strip .lnkExitWithoutSaving",function(){a("#edit-navbar").slideUp();a("#header").add("#header-axd").show();"navbar"==h?(a("#channel-tabbar ul").html(m),a("#channel-subtabbar ul").html(y).parent(".default-hide").toggleClass("h-hide default-hide")):a("#footer-tabbar ul.nav-list").html(m)});var K=
function(){var l=[];a("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var A=a(this),D=function(G){return{phrase:G.data("item-phrase"),title:G.data("item-name"),title_translations:G.data("item-name-translations"),url:G.data("item-url"),routeid:G.data("item-routeid"),special:G.data("item-special")||"",newWindow:G.data("item-newwindow"),usergroups:G.data("item-usergroups"),attr:G.data("item-attr")}},z=[];A.data("subnav-element").find("li").each(function(){$subLi=a(this);z.push(D($subLi))});
A=D(A);A.subnav=z;l.push(A)});R.AJAX({call:"/ajax/api/site/"+("navbar"==h?"saveHeaderNavbar":"saveFooterNavbar"),data:{siteId:1,data:l},success:function(A){a("#edit-navbar").slideUp();a("#header").add("#header-axd").show();a("#admin-navbar-strip-gutter").addClass("h-hide");a(document.body).removeClass("edit-mode lnkEditPage lnkNewPage lnkHeader lnkNavBar lnkFooter").addClass("view-mode");W(null,{enableButtons:!0,currentButton:null});if("navbar"==h){var D=!1;a("#edit-navbar .navbar-ui-wrapper ul li").each(function(){var z=
a(this);if(g(z.data("item-url"))==g(q))return D=!0,a("#edit-navbar .navbar-ui-wrapper ul li").removeClass("selected"),z.addClass("selected"),!1});D?c(!0):(a("#channel-tabbar ul li").removeClass("current"),a("#channel-subtabbar ul").html(""))}},error_phrase:"error_saving_navigation_bar_configuration"})};a(document).on("click",".navbar-navbar #admin-navbar-strip .lnkSaveChanges, .navbar-footer #admin-navbar-strip .lnkSaveChanges",function(){K()})}function rb(b){return a(b).on("reset",function(d,c){R.ensureFun(c)()})}
function sb(){function b(){var f=a(".js-sbpanel-pagelist-wrapper");f.find(".tab-item a").on("click",function(m){m.preventDefault()});f.tabs({beforeActivate:(m,y)=>{y.oldPanel.removeClass("js-panel-active");y.newPanel.addClass("js-panel-active");a(".js-sbpanel-pagelist-wrapper .js-sb-sethomepage-btn").prop("disabled",y.newPanel.is("#sb-pagelist-tab-orphans"))}})}function d(){var f=a(".js-pagelist-filter:checked").val();c(f,!0)}function c(f="all",m=!1){var y=a(".js-sbpanel-pagelist-wrapper"),q=y.find(".js-delayed-template-render-insert-here"),
h=y.find(".js-loading-placeholder"),g={};y.find(".js-simple-pagination-wrapper").each(function(){var t=a(this);g[t.attr("id")]=t.find(".js-pagenum").val()||0});y.tabs("disable");q.html("");h.removeClass("h-hide");vBulletin.AJAX({call:"/ajax/render/admin_sbpanel_pagelist_content_wrapper",data:{urlOptions:{type:f},isAjaxTemplateRenderWithData:!0},success:function(t){q.html(t.template);y.tabs("refresh");y.tabs("enable");y.find(".js-simple-pagination-wrapper").each(function(){var n=a(this),u=m?0:g[n.attr("id")];
r(n,u);e(n);k(n)});y.tabs({active:1});y.tabs({active:0})},error_phrase:"error_fetching_dialog",complete:function(){h.addClass("h-hide")}})}function e(f){f.data("select-all-checkboxes-initialized")||(f.data("select-all-checkboxes-initialized",!0),f.find(".js-checkbox--checkall").each(function(){var m=a(this),y=m.data("group-id"),q=f.find(".js-checkbox[data-group-id='"+y+"']"),h=q.length;m.on("change",function(g){g=a(this).prop("checked");m.prop("indeterminate",!1);g?q.prop("checked",!0):q.prop("checked",
!1)});q.on("change",function(g){a(this).prop("checked");g=q.filter(":checked").length;h>g?(m.prop("checked")&&0<g&&m.prop("indeterminate",!0),m.prop("checked",!1)):(m.prop("indeterminate",!1),m.prop("checked",!0))})}))}function k(f){f.data("actions-initialized")||(f.data("actions-initialized",!0),f.find(".js-delete-orphaned-pagetemplates").on("click",function(m){m=a(this).data("group-id");let y=f.find(".js-checkbox[data-group-id='"+m+"']:checked");1>y.length?O.error("error","delete_orphaned_pagetemplates_please_select_one"):
O.openConfirmDialogSimple({title:"delete",message:["delete_orphaned_pagetemplates_prompt_x",y.length],iconType:"warning",onClickYes:()=>{R.AJAX({call:"/ajax/api/page/deleteOrphanedPagetemplates",data:y.serializeArray(),success:d})}})}))}function r(f,m){function y(w){1>w&&(w=1);w>u&&(w=u);t.addClass("h-hide");n[w]&&n[w].removeClass("h-hide");g.val(w)}if(!f.data("pagination-initialized")){f.data("pagination-initialized",!0);var q=f.find(".js-pagenav-goprev"),h=f.find(".js-pagenav-gopost"),g=f.find(".js-pagenum");
m=m&&parseInt(m,10)||parseInt(g.val(),10);var t=f.find(".js-paginated-page"),n={},u=0;t.each(function(){u++;n[u]=a(this)});g.on("blur keyup",function(w){if("blur"==w.type||"13"==w.keyCode)w=parseInt(g.val(),10),y(w)});q.on("click",function(w){w=parseInt(g.val(),10);w--;y(w)});h.on("click",function(w){w=parseInt(g.val(),10);w++;y(w)});y(m)}}function v(f,m,y,q){var h=vBulletin.phrase.get(q.titlephrase),g=vBulletin.phrase.get(q.subtitlephrase),t=f.closest(".header-edit-box");a(".header-edit-box.selected").removeClass("selected");
t.addClass("selected");y.removeData(["styleselection","fileid"]).data("orig-src",y.attr("src"));m.dialog({autoOpen:!0,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:520,dialogClass:"dialog-container site-logo-dialog-container input-dialog",title:h,create:function(n,u){n=m.closest(".ui-dialog").find(".ui-dialog-title");n.append('<span class="dialog-subtitle"></span>');n.children("span.dialog-subtitle").text(g);m.find(".js-cancel-edit").on("click",function(){var w=y.data("orig-src");
w&&y.removeData(["styleselection","fileid"]).attr("src",w);m.dialog("close")});m.find(".js-save-edit").on("click",q.onClickSave);m.find(".styleselection").on("change",function(){y.data("styleselection",a(this).val())});m.fileupload({dropZone:"vb-self",dataType:"json",add:function(w,x){a("body").css("cursor","wait");a(w.target).find(".js-upload-progress:first").removeClass("h-hide");x.submit()},done:function(w,x){if(x.result&&x.result.filedataid)q.onLocalUploadSuccess(x);else vBulletin.error("error",
q.errorphrase)},fail:function(w,x){vBulletin.error("error",q.errorphrase)},always:function(w,x){a("body").css("cursor","auto");a(w.target).find(".js-upload-progress:first").addClass("h-hide")}});m.find(".js-upload-from-url").offon("click",function(){var w=m.find("#imageUrl"),x=a.trim(w.val()),F=a(this).closest(".dialog-content").find(".js-upload-progress:last");x?(a("body").css("cursor","wait"),F.removeClass("h-hide"),vBulletin.AJAX({call:"/uploader/Url",data:{urlupload:x},complete:function(){a("body").css("cursor",
"auto");F.addClass("h-hide")},success:q.onUploadFromUrlSuccess,title_phrase:q.titlephrase,error_phrase:q.errorphrase,after_error:function(){w.trigger("focus")}})):w.trigger("focus")})},close:(n,u)=>{t.removeClass("selected")}})}rb("#edit-page-dropdown form").trigger("reset",function(){a("input[type=hidden]",this).each((f,m)=>{m.value=m.defaultValue})});a(".js-top-menu-sitebuilder--list .js-top-menu-link").removeClass("b-top-menu__item-link--disabled");a(document).on("click","#sitebuilder-wrapper .lnkExitWithoutSaving",
function(){0==a(this).closest("#edit-page-dropdown").length&&W(null,{enableButtons:!0,currentButton:null})});a(document).on("vb-sitebuilder-panel--channels",function(){var f=a(".js-top-menu-tab--channels").get(0);vBulletin.assertUserHasAdminPermission("canusesitebuilder",f,function(){Y.apply(f);Xa(!1);a(".edit-mode .canvas-widget-list .canvas-widget").addClass("shadow");a("#header, #header-axd, #save-content").hide();a("#manage-page").show();a("#edit-page-dropdown .lnkDeletePage").removeClass("h-hide");
a("#manage-page-dropdown").removeClass("h-hide").slideDown("slow",tb)});return!1});a(document).on("click",".js-sb-delete-page",f=>{var m=a(f.currentTarget),y=parseInt(m.data("pageid")||0,10);f=m.data("url")||"";m=m.data("label")||"";O.openConfirmDialogSimple({title:"confirm_deletion_gcpglobal",message:["delete_page_x_confirm",m,f],yesPhrase:"delete_page",noPhrase:"cancel",iconType:"warning",onClickYes:()=>{R.AJAX({call:"/ajax/api/page/delete",data:{pageid:y},success:()=>d()})}})});a(document).on("click",
".js-pagelist-filter",f=>{d()});a(document).on("vb-sitebuilder-panel--pages",function(){var f=a(".js-top-menu-tab--pages").get(0),m=a(".js-sbpanel-pagelist-wrapper");m.data("panel-initialized")||(m.data("tabspanel-initialized",!0),b());vBulletin.assertUserHasAdminPermission("canusesitebuilder",f,function(){m.hasClass("h-hide")?(Y.apply(f),m.removeClass("h-hide").slideDown("slow"),c()):(Va.apply(f),m.slideUp("fast",function(){m.addClass("h-hide")}))});return!1});a(document).on("click",".js-clickarea--target",
f=>{f.stopPropagation()});a(document).on("click",".js-clickarea",f=>{a(f.currentTarget).find(".js-clickarea--target").click()});a(document).on("click",".js-sbpanel-pagelist-wrapper .js-button--close-panel",function(){var f=a("#lnkPageList")[0],m=a(".js-sbpanel-pagelist-wrapper");m.hasClass("h-hide")||(Va.apply(f),m.slideUp("fast",function(){m.addClass("h-hide")}))});a(document).on("submit",".js-ignoreform",()=>!1);a(document).on("click",".js-sbpanel-pagelist-wrapper .js-sb-sethomepage-btn",f=>{function m(h){return h.length?
{pageid:h.val()||"",url:h.data("url")||"",label:h.data("label")||""}:null}function y(h,g){O.openConfirmDialogSimple({title:"change_homepage",message:g,iconType:"warning",onClickYes:()=>{R.AJAX({call:"/ajax/api/page/setAsHomePage",data:{pageid:h},success:function(t){d();O.alert("change_homepage","hompage_updated_reload")}})}})}f=a(".js-panel-active");var q=a("input.js-sb-page-sethompage-chk:checked",f);f=m(a(".js-sb-page-prev-homepage"));q=m(q);!f&&q?y(q.pageid,["change_homepage_confirm_x",q.label,
q.url]):f&&q&&q.pageid!=f.pageid?y(q.pageid,["change_homepage_confirm_x_to_y",f.label,f.url,q.label,q.url]):O.error("change_homepage","change_homepage_please_select")});a(document).on("vb-sitebuilder-panel--editpage",function(){var f=a(".js-top-menu-tab--editpage").get(0);a("#edit-page-dropdown-gutter").is(":hidden")&&vBulletin.assertUserHasAdminPermission("canusesitebuilder",f,function(){function m(){T=!1;y();ea();Xa(!1,".container-widget");a(".edit-mode .canvas-widget-list .canvas-widget").addClass("shadow");
xa.tabs("option","active",0);a("#header, #header-axd, #save-content").hide();a("#edit-content").show();a("#edit-page-dropdown .lnkSaveChanges .label").text(vBulletin.phrase.get("save_page"));a("#edit-page-dropdown .lnkDeletePage").removeClass("h-hide");a("#edit-page-dropdown-gutter").removeClass("h-hide").slideDown("slow",Ya);a(".canvas-widget.axd-widget .widget-content").each(function(){a(this).html(Wa(a(this).html(),vBulletin.phrase.get("ad")))})}function y(){var q=[];a(".hidden-widget-placeholder").each(function(){q.push(a(this).attr("data-widget-instance-id"))});
1>q.length||vBulletin.AJAX({call:"/ajax/fetch-hidden-modules",data:{modules:q},complete:function(){m()},success:function(h){0<h.length&&a.each(h,function(g,t){g=a(t.template).addClass("hidden-widget");a('.hidden-widget-placeholder[data-widget-instance-id="'+t.widgetinstanceid+'"]').replaceWith(g)})}})}Y.apply(f);Ta(!1,m)});return!1});a(document).on("vb-sitebuilder-panel--newpage",function(){var f=a(".js-top-menu-tab--newpage").get(0);a("#edit-page-dropdown-gutter").is(":hidden")&&vBulletin.assertUserHasAdminPermission("canusesitebuilder",
f,function(){Y.apply(f);Ta(!0,function(){T=!0;a(".canvas-widget-list:not(.js-section-global)").empty();xa.tabs("option","active",0);a("#change-layout .layout-border.selected").removeClass("selected");a("#layout-wide-narrow").prev().trigger("click");V=!1;a("#header, #header-axd, #save-content").hide();a("#edit-content").show();a("#edit-page-dropdown .lnkSaveChanges .label").text(vBulletin.phrase.get("save_new_page"));a("#edit-page-dropdown .lnkDeletePage").addClass("h-hide");a("#edit-page-dropdown-gutter").removeClass("h-hide").slideDown("slow",
Ya)})});return!1});var p=!1;a(document).on("vb-sitebuilder-panel--header",function(){var f=a(".js-top-menu-tab--header").get(0);a("#admin-navbar-strip-gutter").is(":hidden")&&vBulletin.assertUserHasAdminPermission("canusesitebuilder",f,function(){Y.apply(f);p=!1;a("#admin-navbar-strip-gutter").addClass("navbar-header").removeClass("h-hide").find(".prompt-text").text(vBulletin.phrase.get("select_edit_link_header"));var m=a("#header"),y=a(".header-cell",m),q=a("> .admin-only",y).addClass("h-hide-imp");
y=y.outerWidth();a(".disable-overlay",m).width(m.innerWidth()-y).height(m.innerHeight()).show();q.width(y-(parseInt(q.css("padding-left"),10)+parseInt(q.css("padding-right"),10))).removeClass("h-hide-imp");a(document).on("focus click mousedown",".edit-mode.lnkHeader #header .site-logo > a",function(h){this.blur();h.stopPropagation();return!1})});return!1});qb();a(".js-top-menu-sitebuilder").removeClass("h-hide");a(document).on("click",".lnkHeader #admin-navbar-strip .lnkSaveChanges",function(){0<
Number(a("#header .site-logo img").data("fileid"))?Za(p?function(){location.reload(!0)}:null):p?location.reload(!0):(a("#admin-navbar-strip-gutter").addClass("h-hide").find(".prompt-text").text(""),a(document.body).removeClass("edit-mode lnkHeader").addClass("view-mode"),a("#header .disable-overlay").hide(),W(null,{enableButtons:!0,currentButton:null}))});a(document).on("click",".lnkHeader #admin-navbar-strip .lnkExitWithoutSaving",function(f){if(p)return f.stopImmediatePropagation(),location.reload(!0),
!1;f=a("#header .site-logo img");f.attr("src")!=f.attr("data-orig-src")&&f.attr("src",f.attr("data-orig-src")).removeData("fileid");a("#admin-navbar-strip-gutter").find(".prompt-text").text("");a("#header .disable-overlay").hide();W(null,{enableButtons:!0,currentButton:null})});a(document).on("click","#admin-navbar-strip .lnkExitWithoutSaving",function(){a("#admin-navbar-strip-gutter").addClass("h-hide");a(document.body).removeClass("edit-mode lnkEditPage lnkNewPage lnkHeader lnkNavBar lnkFooter").addClass("view-mode");
a("#header").add("#header-axd").show();a("#edit-navbar").hide();W(null,{enableButtons:!0,currentButton:null})});a("#header-axd .axdnum").on("change",function(){var f=a(this),m=parseInt(f.val());vBulletin.AJAX({call:"/ajax/api/ad/saveNumberOfHeaderAds",data:{number:m},success:function(y){y=1==m;a("#header-axd").toggleClass("axdnum_1",y).toggleClass("axdnum_2",!y)}})});a(document).offon("click",".axd-edit-button",function(){function f(n){n=n||!1;vBulletin.AJAX({call:"/ajax/api/ad/listAdsByLocation",
data:{adlocation:g},cache:!1,success:function(u){vBulletin.isEmptyList(u)&&!n?y({adlocation:g}):m(u)}})}function m(n){"undefined"==typeof qa.axd_list_dialog?vBulletin.AJAX({call:"/ajax/render/dialog_axd_list",success(u){qa.axd_list_dialog=u;a("body").append(u);m(n)},error_phrase:"error_fetching_dialog"}):a("#axd-list-dialog").dialog({title:Q("manage_ads"),autoOpen:!0,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:600,dialogClass:"dialog-container ad-list-dialog-container input-dialog",
open(){let u=a(this),w=[],x=function(){u.dialog("close");u.dialog("destroy")},F=a(".axdtable",u),N;for(var J in n)w.push([n[J].title,n[J].otherlocationscount,n[J].active,n[J].displayorder,n[J].adid]);a(".title",u).text(Q("ad_list_description"));N=F.dataTable({bPaginate:!0,bLengthChange:!0,aLengthMenu:[5,10,25,50,100],sPaginationType:"full_numbers",bInfo:!1,bAutoWidth:!1,bDestroy:!0,aaSorting:[[2,"desc"],[3,"asc"]],aoColumns:[{sTitle:Q("title")+'<span class="sort-icon"></span>',sClass:"axdtable-title axd-cell"},
{sTitle:Q("ad_otherlocations")+'<span class="sort-icon"></span>',sClass:"axdtable-others axd-cell",bSearchable:!1,bUseRendered:!1,fnRender(I,K){return 1>K?K:`<span class="others-tooltip js-other-ad-locations-qtip" data-id="${I.aData[4]}">${K}</span>`}},{sTitle:Q("active")+'<span class="sort-icon"></span>',sClass:"axdtable-active axd-cell",bSearchable:!1,bUseRendered:!1,fnRender:function(I,K){return'<input type="checkbox" class="isactive" data-id="{0}"{1} />'.format(I.aData[4],"1"==K?' checked="checked"':
"")}},{sTitle:Q("display_order")+'<span class="sort-icon"></span>',sClass:"axdtable-display-order axd-cell",bSearchable:!1,bUseRendered:!1,fnRender:function(I,K){return'<input type="text" class="displayorder textbox" value="{0}" data-id="{1}" />'.format(I.aData[3],I.aData[4])}},{sTitle:Q("action"),sClass:"axdtable-action axd-cell",bSearchable:!1,bSortable:!1,bUseRendered:!1,fnRender:function(I,K){return'<a href="#" class="editlink" data-id="{0}" title="{1}"><span></span></a> <a href="#" class="deletelink" data-id="{0}" title="{2}"><span></span></a>'.format(I.aData[4],
Q("edit"),Q("delete"))}}],aaData:w});F.offon("mouseover",".js-other-ad-locations-qtip",function(){const I=a(this);"object"!==typeof I.data("qtip")&&R.qtip.apply(I,"qtip-ad-otherlocations",{position:{viewport:a(window),adjust:{method:"shift flip"}},content:{text:function(K,l){K=a(l.target).data("id");K=n[K]&&n[K].otherlocations||[];l="<ul>";for(var A in K){let D=R.htmlEntities(K[A]);l+=`<li>${D}</li>`}return l+"</ul>"}},show:{event:"mouseover",ready:!0},hide:{event:"mouseout"}})});a(".dataTables_filter input[type=text]",
u).addClass("axdfilter textbox").on("keyup",function(){a(this).next()[""!=this.value?"removeClass":"addClass"]("h-hide")}).after('<button type="button" class="axdSearchBtn b-button b-button--secondary b-button--sitebuilder h-hide">{0}</button>'.format(Q("reset")));a(".axdSearchBtn",u).on("click",function(){a(this).addClass("h-hide").prev().val("").trigger("keyup")});F.offon("click",".editlink",function(){const I=a(this).attr("data-id");x();y(n[I]);return!1});F.offon("click",".deletelink",function(){let I=
a(this).attr("data-id"),K=a(this).closest("tr").find(".isactive").prop("checked"),l=parseInt(n[I].otherlocationscount,10),A=Q("are_you_sure_want_to_delete_ad_x",n[I].title,"adid",I);1==l?A+="<br />"+Q("ad_used_one_other_location",l):1<l&&(A+="<br />"+Q("ad_used_x_other_locations",l));x();O.openConfirmDialog({title:Q("confirm_deletion_x",n[I].title),message:A,iconType:"warning",onClickYes(){a("body").css("cursor","wait");R.AJAX({call:"/ajax/api/ad/delete",data:{adid:I},success(D){f(!0);K&&(p=!0)}})},
onClickNo(){f()}});return!1});a(".axdlist",u).show();a(".btnAddAxd",u).offon("click",function(){x();y({adlocation:g});return!1});a(".btnCancelAxd",u).offon("click",function(){x()});a(".btnSaveAxd",u).offon("click",function(){let I={},K=[];var l=N&&N.$(".isactive"),A=N&&N.$(".displayorder");let D={};if(0==l.length)return x(),!1;for(var z of A){var G=a(z);A=G.data("id");G=G.val();D[A]=G}for(const E of l)z=a(E),l=z.data("id"),z=z.is(":checked")?1:0,I[l]={displayorder:D[l]||1,active:z},z&&(z={...I[l]},
z.snippet=n[l].snippet,z.title=n[l].title,K.push(z));vBulletin.AJAX({call:"/ajax/api/ad/quickSave",data:{data:I,adlocation:g},success(E){E=a(".axd_"+g,t);0==E.length&&(E=a(".widget-content",t));if(0<K.length){K.sort(function(H,L){return H.displayorder-L.displayorder});let B="",C="";a.map(K,function(H,L){H.snippet&&(C+=Wa(H.snippet,H.title),B+=H.snippet)});E.html(C);p=h(B)}else E.html("");E.show();x();a("html,body").animate({scrollTop:0},"slow")}})})}})}function y(n){vBulletin.AJAX({call:"/ajax/render/dialog_axd_config",
data:{isAjaxTemplateRenderWithData:!0},success:function(u){qa.axd_config_dialog=u.template;a("body").append(u.template);q(n)},error_phrase:"error_fetching_dialog"})}function q(n){var u=n.adlocation;Aa(a("#axd-config-dialog").dialog({title:vBulletin.phrase.get(n.adid?["edit_ad_x",n.title]:"create_ad"),autoOpen:!0,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:720,dialogClass:"dialog-container axd-dialog-container input-dialog",open:function(){function w(I){I=I||!1;a(":checkbox",x).prop("checked",
!1);a("select",x).val("");x.dialog("close");x.dialog("destroy");a("#axd-config-dialog").remove();f(I)}var x=a(this);if(n.adid){a(".title",x).val(n.title);a(".axd_html",x).val(n.snippet);a(".active",x).prop("checked","1"==n.active);a(".axdid",x).val(n.adid);for(var F in n.criterias){var N=n.criterias[F],J=N.criteriaid;a("[name=data\\[criteria\\]\\["+J+"\\]\\[active\\]]",x).prop("checked",!0);a("."+J,x).each(function(){var I=a(this),K=I.attr("name").match(/condition\d/);K&&I.val(N[K[0]])})}}else a(".axdid",
x).val(0),a(".configform",x).trigger("reset");a(".axd_location",x).val(u);a(".blockrow select.custom-dropdown",x).selectBox();a(".blockrow a.custom-dropdown, .blockrow input[type=text]",x).on("click",function(I){return!1});a(".btnAttachHtmlAxd",x).off("click").on("click",function(){var I=a(".configform",x).serialize();a("body").css("cursor","wait");vBulletin.AJAX({call:"/ajax/api/ad/save",data:I,success:function(K){w();p=h(a(".configform .axd_html",x).val())},complete:function(){a("body").css("cursor",
"default")}})});a(".btnCancelEditHtmlAxd",x).off("click").on("click",function(){w(!0)})}}))}function h(n){var u=a("<div>"+n+"</div>");return 0<u.filter("script").length?!0:0<u.find("*").filter(function(){return 0==this.nodeName.toLowerCase().indexOf("vb:")?this:null}).length||/\{vb\s*:\s*[a-z]+\s+.*\}/.test(n)}var g=a(this).attr("data-location"),t=a(this).closest(".axd-container");0==t.length&&(t=a('.axd-container[data-widget-instance-id="'+g+'"]'));f();return!1});a("#header .header-cell .js-edit-logo").on("click",
f=>{var m=a("#edit-site-logo-dialog"),y=a("#header .site-logo img");v(a(f.currentTarget),m,y,{titlephrase:"edit_site_logo",subtitlephrase:"choose_options_site_logo",errorphrase:"error_processing_site_logo",onClickSave:()=>{0<Number(y.data("fileid"))?Za(function(){m.dialog("close")}):m.dialog("close")},onUploadFromUrlSuccess:q=>{y.attr("src",q.imageUrl).data({fileid:q.filedataid,styleselection:m.find(".styleselection:checked").val()})},onLocalUploadSuccess:q=>{y.attr("src",q.result.imageUrl).data({fileid:q.result.filedataid,
styleselection:m.find(".styleselection:checked").val()})}})});a(".favicon-editor .js-edit-favicon").offon("click",f=>{var m=a("#edit-favicon-dialog"),y=a(".js-sitebuilder-favicon");v(a(f.currentTarget),m,y,{titlephrase:"edit_favicon",subtitlephrase:"choose_options_favicon",errorphrase:"error_processing_favicon",onClickSave:()=>{vBulletin.AJAX({call:"/uploader/setfavicon",data:{filedataid:y.data("fileid"),styleselection:y.data("styleselection")},complete:function(){a("body").css("cursor","auto")},
success:function(q){"true"===a.trim(q)&&(a("#admin-navbar-strip-gutter").addClass("h-hide").find(".prompt-text").text(""),a(document.body).removeClass("edit-mode lnkHeader").addClass("view-mode"),a("#header .disable-overlay").hide(),W(null,{enableButtons:!0,currentButton:null}),m.dialog("close"),a('link[rel="Shortcut Icon"]').attr("href",y.attr("src")))},error_phrase:"error_saving_favicon"})},onUploadFromUrlSuccess:q=>{y.attr("src",q.imageUrl).data({fileid:q.filedataid,styleselection:m.find(".styleselection:checked").val()})},
onLocalUploadSuccess:q=>{y.attr("src",q.result.imageUrl).data({fileid:q.result.filedataid,styleselection:m.find(".styleselection:checked").val()})}})});a(".admin-button-flat").disableSelection();xa=a("#edit-content .tabs").tabs({beforeActivate:function(f,m){a("#save-content").hide();1==m.newTab.index()&&fa&&(a("#edit-page-dropdown .layout-list .layout-border.selected").removeClass("selected"),f=a("#edit-page-dropdown .layout-list input[type=radio][value={0}]".format(a(".canvas-layout:visible").attr("data-layout-id"))),
f.prev().addClass("selected"),X="canvas-"+f.attr("id"))},create:function(f,m){m.tab.index();ra()},activate:function(f,m){m.newTab.index();ra()}});a("#lnkAddModules").on("click",function(){xa.tabs("option","active",0);return!1});ub();a(document).on("click",".module-buttons .hide-icon input",function(){var f=a(this);f.closest(".canvas-widget")[this.checked?"addClass":"removeClass"]("hidden-widget");var m=f.attr("title");f.attr("title",f.data("toggle-title")).data("toggle-title",m)});a(".canvas-layout-container .canvas-layout").each(function(){$a[this.id]=
a("#"+this.id+' div[class*="section-"]').length});T||(X="canvas-"+a("#edit-page-dropdown .layout-list input[type=radio][value={0}]".format(a(".canvas-layout:visible").attr("data-layout-id"))).prop("checked",!0).attr("id"));ab=a("#edit-page-dropdown .layout-list input[type=radio]").thumbnailRadioCheckbox({thumbnailClass:"layout-border"});ab.thumbnailRadioCheckbox("option","select",function(f,m){a(".canvas-layout").addClass("h-hide");a("#canvas-"+m.attr("id")).removeClass("h-hide");vb("canvas-"+m.attr("id"));
ya();V=!0});a(".js-toggle-controller").offon("click.sitebuilder",f=>{let m=a(f.currentTarget),y=m.data("toggleid"),q=m.closest(`.js-toggle-context[data-toggleid="${y}"]`),h=q.find(`.js-toggle-worker[data-toggleid="${y}"]`);f.preventDefault();h.toggleClass("h-hide");console.log({$toggle:m,id:y,$context:q,$workers:h})})}function vb(b){if(X){if(X!=b){a(".canvas-layout.h-hide input[type=hidden]").prop("disabled",!0);a("#"+b+" input[type=hidden]").prop("disabled",!1);var d=$a[b],c=!1,e=0;a("#"+X+" > .canvas-layout-row > .canvas-widget-list").each(function(){var k=
a(this);c=wb(k,a("#"+b+" > .canvas-layout-row > .canvas-widget-list"));c.length||(e=bb(this),c=a("#"+b+" > .canvas-layout-row > div.section-"+e));if(!c.length){for(var r=d;0<=r&&0==a("#"+b+" > .canvas-layout-row > div.section-"+r).length;)r--;c=a("#"+b+" > .canvas-layout-row > div.section-"+r)}k=k.children(".canvas-widget");var v=parseInt(Math.ceil(k.length/c.length),10);if(0<v){var p=0,f=0;k.each(function(){a(this).appendTo(c.eq(f));++p;p>=v&&(p=0,++f)})}});X=b}}else a(".canvas-layout.h-hide input[type=hidden]").prop("disabled",
!0),a("#"+b+" input[type=hidden]").prop("disabled",!1),X=b}function wb(b,d){var c="js-sectiontype-notice js-sectiontype-primary js-sectiontype-secondary js-sectiontype-extra js-sectiontype-global_after_breadcrumb js-sectiontype-global_before_footer".split(" "),e;for(e in c)if(b.is("."+c[e])){var k=c[e];break}return d.filter(function(){return a(this).is("."+k)})}function bb(b){var d=/section-(\d+)/gi,c=null;a(a(b).attr("class").split(" ")).each(function(e,k){(e=d.exec(k))&&!isNaN(e[1])&&(c=e[1])});
return c}function xb(b){if(a.isArray(b)&&0!=b.length)return vBulletin.AJAX({call:"/ajax/admin-template/widget",data:{widgets:b,pagetemplateid:a("#save-page-form #pagetemplateid-yes").val()},success:function(d){a.isArray(d.widgets)&&a.each(d.widgets,function(c,e){if(!e.widgetid||1>Number(e.widgetid)||!a.trim(e.template))return!0;c=e.displaysection&&0<Number(e.displaysection)?e.displaysection:0;e=a(e.template);e.appendTo(a(".canvas-layout:not(.h-hide) .canvas-widget-list.section-"+c).height("auto")).filter(":not(.container-widget)").find(".toggle-button").trigger("click",
[!0]);e.find(".tabs").tabs()})},error_phrase:"error_adding_widgets"}),!1}function Ea(b,d){var c=b.closest(".channel-item-container").children(".sub-channel-container").children(".channel-item-container");b=b.find(".b-icon");b.is(".b-icon__arrow-right-m")?(b.removeClass("b-icon__arrow-right-m").addClass("b-icon__arrow-down-m"),c.slideDown(150)):"undefined"!==typeof d&&d||(c.slideUp(150),b.addClass("b-icon__arrow-right-m").removeClass("b-icon__arrow-down-m"))}function Fa(){a(".channel-config-dialog .channel-list").sortable({placeholder:"main-channel-container-highlight drag-highlight h-clear",
update:function(b,d){P=ba=!0},start:function(b,d){d.placeholder.height(d.item.outerHeight())},handle:".grip-icon-main",items:".main-channel-container"})}function cb(b){b.find(".main-channel-container").sortable({connectWith:".sub-channel-container",placeholder:"channel-item-highlight drag-highlight",revert:!0,update:function(d,c){c.item.closest(".main-channel-container");c.sender&&c.sender.hasClass("main-channel-container")&&0==a("> .channel-item-container",c.sender).length&&c.sender.slideUp("fast",
function(){a(this).remove()});P=ba=!0},stop:function(d,c){a(".main-channel-container, .sub-channel-container").height("auto")},handle:".channel-item-inner > .grip-icon-item",items:".channel-item-container"})}function db(b){b.find(".sub-channel-container").sortable({connectWith:".sub-channel-container",revert:!0,placeholder:"channel-item-highlight drag-highlight",update:function(d,c){c.sender&&c.sender.hasClass("main-channel-container")&&0==a("> .channel-item-container",c.sender).length&&c.sender.slideUp("fast",
function(){a(this).remove()});P=ba=!0},sort:function(d,c){},start:function(d,c){},stop:function(d,c){a(".main-channel-container, .sub-channel-container").height("auto")},over:function(d,c){d=a(this).closest(".channel-item-container").children(".channel-item").find(".toggle-button");Ea(d,!0)},receive:function(d,c){},out:function(d,c){},handle:".channel-item-inner > .grip-icon-item",items:".channel-item-container"})}function eb(b,d,c,e,k,r,v){k='<div class="'+(k?"category-to-channel":"channel-to-category")+
'"><a href="#">'+vBulletin.phrase.get(k?"make_forum":"make_category")+"</a></div>";b=a(('<div class="main-channel-container">\t\t\t\t<div class="grip-icon grip-icon-main h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>\t\t\t\t<div class="channel-item-container">\t\t\t\t\t<div class="channel-item shadow" data-channel-id="{0}" data-parent-id="{2}">\t\t\t\t\t\t<div class="channel-item-inner">\t\t\t\t\t\t\t<div class="grip-icon grip-icon-item h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>\t\t\t\t\t\t\t<div class="channel-title"><div title="'+
vBulletin.phrase.get("click_text_edit_title")+'">{1}</div><input type="text" name="channeltitle" value="{1}" /></div>\t\t\t\t\t\t\t<div class="close-button" title="'+vBulletin.phrase.get("remove_forum")+'">x</div>\t\t\t\t\t\t\t<div class="toggle-button"><div class="b-icon b-icon__arrow-right-m"></div></div>\t\t\t\t\t\t\t<div class="num-subchannels">'+v+'</div>\t\t\t\t\t\t\t<div class="add-subchannel-button h-right" title="'+vBulletin.phrase.get("add_subforum")+'"><a href="#">+</a></div>\t\t\t\t\t\t\t'+
k+'\t\t\t\t\t\t\t<div class="h-clear"></div>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t\t<div class="sub-channel-container"></div>\t\t\t\t</div>\t\t </div>').format(d,e,c)).appendTo(b);r&&(r=a("#top-level-forum .channel-config-dialog .channel-list").find(".main-channel-container").last(),a("html, body").animate({scrollTop:r.offset().top},"fast"));P=ba=!0;return b}function fb(b,d,c,e,k,r){e='<div class="'+(e?"category-to-channel":"channel-to-category")+'"><a href="#">'+vBulletin.phrase.get(e?"make_forum":
"make_category")+"</a></div>";k=k.hasClass("main-channel-container")?a("> .channel-item-container > .sub-channel-container",k):a("> .sub-channel-container",k);b=a(('<div class="channel-item-container">\t\t\t\t<div class="channel-item shadow" data-channel-id="{0}" data-parent-id="{2}">\t\t\t\t\t<div class="channel-item-inner">\t\t\t\t\t\t<div class="grip-icon grip-icon-item h-left"><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div><div>&uml;</div></div>\t\t\t\t\t\t<div class="channel-title"><div title="Click text to edit title">{1}</div><input type="text" name="channeltitle" value="{1}" /></div>\t\t\t\t\t\t<div class="close-button" title="'+
vBulletin.phrase.get("remove_forum")+'">x</div>\t\t\t\t\t\t<div class="toggle-button"><div class="b-icon b-icon__arrow-right-m"></div></div>\t\t\t\t\t\t<div class="num-subchannels">'+r+'</div>\t\t\t\t\t\t<div class="add-subchannel-button h-right" title="'+vBulletin.phrase.get("add_subforum")+'"><a href="#">+</a></div>\t\t\t\t\t\t'+e+'\t\t\t\t\t\t<div class="h-clear"></div>\t\t\t\t\t</div>\t\t\t </div>\t\t\t <div class="sub-channel-container"></div>\t\t\t</div>').format(b,c,d)).hide().appendTo(k);
P=ba=!0;return b}function yb(){vBulletin.AJAX({call:"/ajax/fetch-widget-admin-template-list",complete:function(){ra();a(window).resize(ra)},success:function(b){gb=!0;if(a.isArray(b))if(0<b.length){var d={},c=0;a.each(b,function(k,r){if(!r.widgetid||1>Number(r.widgetid))return!0;c++;d[r.category]?d[r.category].count++:d[r.category]={count:1,title:r.category_title};k=a("#edit-page-dropdown .module-list .module-icon-template").clone();k.attr("data-widget-id",r.widgetid).attr("data-title",a.trim(r.title).toLowerCase()).data("canbemultiple",
r.canbemultiple).removeClass("module-icon-template").addClass(("module-item category-{0}"+("1"==r.cloneable?" module-cloneable":"")).format(r.category));a(".module-icon",k).html(a("<img />").attr("src",pageData.baseurl+"/images/sitebuilder/"+a.trim(r.icon)).attr("height",60).attr("width",60).attr("alt",vBulletin.phrase.get("module_icon")));a(".module-title .main-title",k).html(a.trim(r.title));k.appendTo("#edit-page-dropdown .module-list").removeClass("h-hide")});a(('<div class="module-categories-scroller-container">\t\t\t\t\t\t\t<div class="category-arrow-left h-left" title="'+
vBulletin.phrase.get("previous")+'">&lsaquo;</div>\t\t\t\t\t\t\t<div class="scroller category h-left">\t\t\t\t\t\t\t\t<div class="categories h-left">\t\t\t\t\t\t\t\t\t<div id="category-all" class="category selected">'+vBulletin.phrase.get("all")+' ({0})</div>\t\t\t\t\t\t\t\t\t<div id="category-result" class="category h-hide">'+vBulletin.phrase.get("search_results")+' (<span></span>)</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="category-arrow-right h-left" title="'+vBulletin.phrase.get("next")+
'">&rsaquo;</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="h-clear"></div>').format(c)).insertBefore("#edit-page-dropdown .module-list-container .scroller");a.each(d,function(k,r){a('<div id="category-{0}" class="category">{1} ({2})</div>'.format(k,r.title,r.count)).insertBefore("#category-result")});Z();hb=a("#edit-page-dropdown .module-list .module-item").not(".non-module-item");hb.draggable({connectToSortable:".canvas-layout-row > .canvas-widget-list:visible",helper:"clone",revert:"invalid",
appendTo:"#add-modules .module-list-container",zIndex:2E3,start:function(k,r){if("0"==a(this).data("canbemultiple")&&0<a("#content .canvas-layout .canvas-widget[data-widget-id={0}]".format(a(this).attr("data-widget-id"))).length)return vBulletin.warning("move_not_allowed",["adding_multiple_modules_not_allowed",a(".main-title",this).html()]),!1;Ga=!0},stop:function(k,r){Ga=!1}}).disableSelection();a("#search-module-keyword").on("keyup",function(k,r){var v=a("#add-modules"),p=a("#category-result"),
f=a(".categories",v);k=a(".scroller.category",v);var m=!1;a(".module-item",v).hide();r||a(".category.selected",v).removeClass("selected");(r=a.trim(this.value.toLowerCase()))?(a('.module-item[data-title*="{0}"]'.format(r),v).show(),p.removeClass("h-hide").addClass("selected")):(a(".module-item",v).show(),a("#category-all").removeClass("h-hide").addClass("selected"),p.addClass("h-hide").removeClass("selected"),m=!0);r=a(".module-item:visible",v).length;a("span",p).text(r);Z();0==r?a(".empty-module",
v).show():a(".empty-module",v).hide();f.width()<=k.width()?(a(".category-arrow-left, .category-arrow-right",v).css("visibility","hidden"),k.scrollLeft(0)):m?(a(".category-arrow-left",v).css("visibility","hidden"),a(".category-arrow-right",v).css("visibility","visible"),k.scrollLeft(0)):(a(".category-arrow-left",v).css("visibility","visible"),a(".category-arrow-right",v).css("visibility","hidden"),v=k.get(0),k.scrollLeft(v.scrollWidth-v.clientWidth));return!0});a("#add-modules .categories .category").on("click",
function(k){k.stopPropagation();if(a(this).hasClass("selected"))return!1;k=a(this).closest(".module-list-container");var r=a(".module-item",k);a(".category.selected",k).removeClass("selected");a(this).addClass("selected");r.hide();a(".empty-module",k).hide();var v=this.id;"category-all"==v?(r.show(),a(".non-module-item",k).hide()):"category-result"==v?a("#search-module-keyword").triggerHandler("keyup",[!0]):a(".module-item.{0}".format(v),k).show();Z();return!1}).disableSelection();var e;a(".category-arrow-left").on({mousedown:function(){a(".category-arrow-right").css("visibility",
"visible");e=setInterval(function(){var k=a(".scroller.category");k.scrollLeft(k.scrollLeft()-20);0==k.scrollLeft()&&(a(".category-arrow-left").css("visibility","hidden"),clearInterval(e))},50)},mouseup:function(){clearInterval(e)}}).disableSelection();a(".category-arrow-right").on({mousedown:function(){a(".category-arrow-left").css("visibility","visible");e=setInterval(function(){var k=a(".scroller.category"),r=k.get(0);r=r.scrollWidth-r.clientWidth;var v=Math.min(k.scrollLeft()+20,r);k.scrollLeft(v);
1>Math.abs(r-k.scrollLeft())&&(a(".category-arrow-right").css("visibility","hidden"),clearInterval(e))},50)},mouseup:function(){clearInterval(e)}}).disableSelection()}else a('<div class="empty-module">'+vBulletin.phrase.get("no_modules")+"</div>").appendTo("#edit-page-dropdown .module-list")},error_phrase:"error_retrieving_modules"})}function Ra(b,d){vBulletin.AJAX({call:"/ajax/api/widget/fetchWidgetGuidToWidgetidMap",success:function(c){wa=c.map?c.map:{error_result:c};"function"==typeof b&&b.apply(this,
d)}})}function zb(){a("#edit-page-dropdown .template-list").empty();vBulletin.AJAX({call:"/ajax/api/pagetemplate/fetchPageTemplateList",data:{pagetemplateid:a("#save-page-form #pagetemplateid-yes").val()},success:function(b){ib=!0;if(a.isArray(b)&&0<b.length){var d=!1;a.each(b,function(c,e){a('<div class="template-item">\t\t\t\t\t\t\t\t<input type="radio" id="pagetemplateid-{0}" name="pagetemplateid" value="{0}" data-thumbnail="{1}/images/sitebuilder/icon-layout-{4}.png"{2} />\t\t\t\t\t\t\t\t<label class="label">{3}</label>\t\t\t\t\t\t\t</div>'.format(e.pagetemplateid,
pageData.baseurl,T||a("#save-page-form #pagetemplateid-yes").val()!=e.pagetemplateid?"":' checked="checked"',e.title,e.screenlayoutvarname)).appendTo("#edit-page-dropdown .template-list").data({screenlayoutid:e.screenlayoutid,widgetinstances:e.widgetinstances});a("#save-page-form #pagetemplateid-yes").val()==e.pagetemplateid&&(d=!0,""==e.title&&console.warn("The page template for this page does not have a title."))});T||d||console.error("The page template for this page was not in the list returned by fetchPageTemplateList! Expected pagetemplateid: {0}. Please ensure that this page template has a title.".format(a("#save-page-form #pagetemplateid-yes").val()));
a(".template-item",a("#edit-page-dropdown .template-list")).each(function(c){a(this).attr("data-title",a(".label",a(this)).text().toLowerCase())});a("#search-template-keyword").on("keyup",function(c){if(13==c.keyCode)return c.preventDefault(),!1;c=a("#select-template");a(".scroller",c);a(".template-item",c).hide();var e=a.trim(this.value.toLowerCase());e?a('.template-item[data-title*="{0}"]'.format(e),c).show():a(".template-item",c).show();e=a(".template-item:visible",c).length;Z();a(".empty-template",
c).toggle(0==e);return!0});a("#search-template-keyword").on("keydown",function(c){if(13==c.keyCode)return c.preventDefault(),!1});Ha=a("#edit-page-dropdown .template-list .template-item input[type=radio]").thumbnailRadioCheckbox({thumbnailClass:"template-border",preselect:function(c,e){return e.is(":checked")?!1:V||P?(O.openConfirmDialogSimple({title:"switch_template",message:"template_changes_will_be_lost",iconType:"warning",onClickYes:()=>{P=V=!1;fa=!0;Ha.thumbnailRadioCheckbox("check",e,!0)}}),
!1):fa=!0},select:function(c,e){a(".canvas-layout").addClass("h-hide");c=e.closest(".template-item").data("screenlayoutid");a(".canvas-layout[data-layout-id="+c+"]").removeClass("h-hide");ya();a("#save-page-form #pagetemplateid-yes, #config_pagetemplateid").val(e.val());c=e.closest(".template-item").find(".label").html();a("#save-page-form .page-template-name").html(vBulletin.phrase.get("page_template_name_id",c,e.val()));if(fa)if(a(".canvas-widget-list").empty(),e=e.closest(".template-item").data("widgetinstances"),
a.isArray(e)&&0<e.length){var k=[];a.each(e,function(r,v){k.push({widgetid:v.widgetid,widgetinstanceid:v.widgetinstanceid})});xb(k,!0);ea()}else window.vBulletin.loadingIndicator.hide();a("body").removeClass("lnkNewPage").addClass("lnkEditPage");a("#save-page-form .new-page-template input").prop("disabled",!0);a("#save-page-form .edit-page-template input").prop("disabled",!1);fa=!0},unselect:function(){}});Z()}}})}function Za(b){var d=a("#header .site-logo img");vBulletin.AJAX({call:"/uploader/setlogo",
data:{filedataid:d.data("fileid"),styleselection:d.data("styleselection")},success:function(c){"true"===a.trim(c)&&(d.removeData(["styleselection","fileid"]).data("orig-src",d.attr("src")),a("#admin-navbar-strip-gutter").addClass("h-hide").find(".prompt-text").text(""),a(document.body).removeClass("edit-mode lnkHeader").addClass("view-mode"),a("#header .disable-overlay").hide(),W(null,{enableButtons:!0,currentButton:null}),R.ensureFun(b)())},error_phrase:"error_saving_site_logo"})}function jb(b,d){a.each(b,
function(c,e){c=a.map(e.subchannels,function(k,r){return r}).length;c=fb(e.nodeid,e.parentid,e.title,e.category,d,c);jb(e.subchannels,c)})}function Xa(b,d){d=d&&0<d.length?a(".canvas-layout .canvas-widget").not(d).find(".widget-content"):a(".canvas-layout .canvas-widget .widget-content");b?d.each(function(){a(this).is(":hidden")&&a(this).closest(".canvas-widget").find(".widget-header .toggle-button").trigger("click",[!0])}):d.each(function(){a(this).is(":hidden")||a(this).closest(".canvas-widget").find(".widget-header .toggle-button").trigger("click",
[!0])})}function ea(){if(!T){var b=a(".canvas-layout:visible .canvas-widget.subchannel-widget");1==b.length?b.find(".close-button").hide():b.find(".close-button").show()}}function Sa(b,d){var c=b.attr("data-widget-id");null==Ia[c]?vBulletin.AJAX({call:"/ajax/fetch-widget-template",data:{widgetid:c},success:function(e){if(e=a.trim(e)){var k=a(e.replace(/<\s*script[^>]*>(.*?)<\s*\/\s*script>/g,""));k.attr("data-title",function(){var r=a(".module-title",k).clone();r.find(".hide-on-viewmode").children().unwrap();
r.find("*:hidden").remove();return a.trim(r.text()).toLowerCase()});Ia[c]=k;"function"==typeof d&&d(k.clone(!0))}},error_phrase:"error_retrieving_cloned_widget_template"}):"function"==typeof d&&d(Ia[c].clone(!0))}function ha(b,d){a(".edit-mode .canvas-widget.youtube-widget .widget-content").css("visibility",b);d&&d.find(".widget-content").css("visibility","hidden"==b?"visible":"hidden")}function Ab(b,d){let c;switch(b.name){case "tab_data":c=a("<div />");b=aa(d);a.each(b,function(e,k){var r="[tab_data]["+
e+"][title]",v=k.title,p=a('<input type="text" name="data{0}" id="data{0}" />'.format(r)).addClass("textbox config-textbox").attr("value",v);c.append(p);a.each(k.widgets,function(f,m){a.each(m,function(y,q){r="[tab_data]["+e+"][widgets]["+f+"]["+y+"]";v=q;p=a('<input type="text" name="data{0}" id="data{0}" />'.format(r)).addClass("textbox config-textbox").attr("value",v);c.append(p)})})});break;case "module_viewpermissions":c=kb(b)}return c}function kb(b){var d=a(".js-sb-module-config--viewpermissions--template");
if(!d.length)return"";b.hasOwnProperty("defaultvalue")||(b.defaultvalue={show:"all"});d=d.clone().removeClass("js-sb-module-config--viewpermissions--template h-hide");b=b.defaultvalue.show;var c=!Array.isArray(b),e=d.find("input.js-module_viewpermissions__key"),k=d.find(".js-module_viewpermissions_ugchecklist");e.filter("[value='show_all']").prop("checked",c);e.filter("[value='show']").prop("checked",!c);c?k.addClass("h-hide"):a.each(b,function(r,v){k.find("input.js-module_viewpermissions__value[value='"+
v+"']").prop("checked",!0)});e.on("change",function(){k.toggleClass("h-hide","show_all"==this.value)});return d}function ub(){function b(d){return a("ul.widget-tabs-nav li, .widget-header ul.ui-tabs-nav li, .widget-tabs-nav ul.ui-tabs-nav li",d).map((c,e)=>{c=a(e);$link=a("a",c);return{selector:$link.attr("href"),label:$link.text(),displayed:c.is(":not(.h-hide, h-hide-imp), .js-tab-hidden-this-page")}}).get()}a(document).offon("click",".canvas-widget.default-widget:not(.js-search-widget) .edit-button",
function(){var d=a(this).closest(".canvas-widget"),c=d,e=a("> .widget-header .module-title",d);(function(){var v=d.data("widget-instance-id");if(S.tempModuleHTMLCache["widgetinstance_"+v]){0==a("#sb-temp-module-cache").length&&a('<div id="sb-temp-module-cache" class="h-hide"></div>').appendTo("body");var p=a(S.tempModuleHTMLCache["widgetinstance_"+v]);if(0<p.find(".widget-tabs").length||p.is(".widget-tabs"))a("#sb-temp-module-cache").append(p),delete S.tempModuleHTMLCache["widgetinstance_"+v]}p=a("#sb-temp-module-cache .canvas-widget").filter(function(){return a(this).data("widget-instance-id")==
v});1==p.length&&(0<p.find(".widget-tabs").length||p.is(".widget-tabs"))&&(d=p)})();if(!d.is(".js-search-widget")){var k=d.attr("data-widget-id");e=0<a("span.admin-only",e).length?a("span.admin-only",e).text():0<a(".hide-on-viewmode",e).length?a(".hide-on-viewmode",e).text():e.text();a("#config-dialog .loader").show();a("#config-dialog .widget-name h1").html(e);a("#config-dialog .dialog-content .widget-config-container").hide().empty().removeClass("error notice");a("#config-dialog").data("selected-module",
c);ha("hidden");a("#config-dialog").dialog("open");var r=c.attr("data-widget-instance-id")||"";vBulletin.AJAX({call:"/ajax/api/widget/fetchConfigSchema",data:{widgetid:k,widgetinstanceid:r,pagetemplateid:la(),configtype:"admin"},success:function(v){a("#config_widgetid").val(v.widgetid);a("#config_widgetinstanceid").val(v.widgetinstanceid);Na(v.pagetemplateid);c.attr("data-widget-instance-id",v.widgetinstanceid);r||na(c);var p=a("#config-dialog .dialog-content .widget-config-container");if(v.configs&&
0!=v.configs.length){var f=!1,m=!1,y=!1,q=!1,h=!1,g=c.data("is-tabbed-container"),t=!1,n=!1;a("#debug-information");var u=vBulletin.isRtl();const E=["Select","ChannelSelect","ContentTypeSelect","ProfileFieldSelect","ChannelIncludeExclude"];a.each(v.configs,function(B,C){!h&&E.includes(C.type)&&(h=!0);"Custom"==C.type&&(C.customValue=Ab(C,c));if(B=S.renderModuleConfig(C))p.append(B),"default_tab"==C.name&&(g?n=C:f=!0),"display_tabs"==C.name&&(g?t=C:m=!0),"tab_order"==C.name&&(g||(y=!0)),"axd"==C.name&&
(q=!0)});S.attachTranslatableToggleEvent(p);var w=function(){function B(U){return a('input:checkbox[value="'+U+'"]',N).is(":checked")}F=b(d);var C=a('select[name="data[default_tab]"]',p),H=C.val();H&&B(H)||(H=v.configs.default_tab.defaultvalue);C.selectBox("destroy");C.empty();for(var L in F){var M=F[L].selector;B(M)&&(M=a('<option value="'+M+'">'+F[L].label+"</option>").prop("selected",H==M),C.append(M))}C.selectBox()},x=function(){F=b(d);var B=a(".config-value.tab_order",p);B.empty().append("<ul>");
for(var C in F){if(m){if(!a('input:checkbox[value="'+F[C].selector+'"]',N).is(":checked"))continue}else if(!F[C].displayed)continue;var H=a('<li id="'+F[C].selector+'">'+F[C].label+"</li>");a("ul",B).append(H);var L=a('<input name="data[tab_order]['+F[C].selector.substring(1)+']" value="'+C+'" type="hidden">');B.append(L)}a("ul",B).sortable({stop:function(){var M=a(this).sortable("toArray");B.find("input:hidden").remove();for(C in M)L=a('<input name="data[tab_order]['+M[C].substring(1)+']" value="'+
C+'" type="hidden">'),B.append(L)}});a("ul",B).disableSelection()};if(m){var F=b(d);var N=a(".config-value.display_tabs",p),J;for(J in F){var I=a('<label><input type="checkbox" name="data[display_tabs][]" value="'+F[J].selector+'">'+F[J].label+"</label>");F[J].displayed&&I.find("input:checkbox").prop("checked",!0);N.append(I)}if(f)a("input:checkbox",N).on("click",function(){w();x()})}y&&x();f&&w();(I=ua(c))&&a("<input type='hidden' name='data[containerinstanceid]' value='"+I+"' />").appendTo(p);if(g){var K=
aa(c),l=a('select[name="data[default_tab]"]',p),A=a(".config-value.display_tabs",p),D=t&&t.defaultvalue||"";""==D&&(D={},a.each(K,function(B,C){D[B]="1"}));var z=function(){var B;l.empty();a.each(K,function(C,H){B=a('<option value="'+C+'">'+H.title+"</option>");"0"==D[C]?B.prop("disabled",!0):n.defaultvalue==C&&B.prop("selected",!0);l.append(B)});l.is(".selectBox")&&l.selectBox("refresh")};n&&z();if(t){var G;A.empty();a.each(D,function(B,C){var H="data[display_tabs]["+B+"]";G=a("<label />").append(a('<input type="hidden" name="'+
H+"\" value='0'/>")).append(a('<input type="checkbox" name="'+H+"\" value='1' data-tab-number=\""+B+'" />')).append(document.createTextNode(K[B].title));"1"==C&&G.find("input:checkbox").prop("checked",!0);A.append(G)});a("input:checkbox",A).on("click",function(){var B=a(this),C=B.prop("checked");B=B.data("tab-number");var H=l.find("option[value='"+B+"']").prop("disabled")!=!C;D[B]=C;H&&z()})}}q&&a(".config-value.axd",p).append('<button class="axd-edit-button b-button b-button--secondary b-button--sitebuilder" data-location="'+
v.widgetinstanceid+'">'+vBulletin.phrase.get("edit")+"</button>")}else a("#config-dialog .widget-config-container").html(vBulletin.phrase.get("no_configurations_found")).addClass("notice"),a("#btnSaveConfig").prop("disabled",!0),a("#btnCloseConfig").trigger("focus");p.show();a("#config-dialog .loader").hide();h&&p.find("select").selectBox();p.find(".js-module-config-slider").each(function(E){E=a(this);var B=E.find("input"),C=E.parent().find(".js-slider-output"),H=E.data("min"),L=E.data("max"),M=E.data("interval");
B.length&&E.slider({min:H,max:L,step:M,value:B.val(),isRTL:u,change:function(U,pa){U=pa.value;C.length&&C.val(U);B.val(U)}})});(function(){function E(){var B=a(this),C=B.next(".js-checkbox-always-send-hidden");0!=C.length||B.prop("checked")?C.remove():a('<input type="hidden" name="{0}" class="js-checkbox-always-send-hidden" value="0" />'.format(B.prop("name"))).insertAfter(B)}a(".js-checkbox-always-send").off("click").on("click",E);a(".js-checkbox-always-send").each(E)})();a("#config-dialog .dialog-content .widget-config-container").find("input, textarea, select, button").filter(":visible").first().trigger("focus")},
error_phrase:["error_retrieving_configuration",e],after_error:function(){a("#config-dialog .loader").hide();a("#config-dialog").dialog("close")}});return!1}})}function ya(){a(".edit-mode .canvas-layout:visible > .canvas-widget-list").width("").each(function(){a(this).width(a(this).width())})}function Bb(){vBulletin.AJAX({call:"/ajax/api/widget/fetchPageManagerForums",complete:function(){a("#config-dialog .loader").hide()},success:function(b){lb=!0;var d=a("<div>").addClass("channel-list");a.each(b,
function(c,e){c=a.map(e.subchannels,function(k,r){return r}).length;c=eb(d,e.nodeid,e.parentid,e.title,e.category,!1,c);jb(e.subchannels,c)});b=a("#top-level-forum .channel-config-dialog");b.find(".channel-list").remove();cb(d);db(d);b.append(d);a(document).on("mousedown",".main-channel-container > .channel-item-container > .channel-item .grip-icon",function(){a(this).closest(".main-channel-container").height(a(this).closest(".main-channel-container").height())});a(document).on("mousedown",".sub-channel-container > .channel-item-container > .channel-item .grip-icon",
function(){a(this).closest(".sub-channel-container").height(a(this).closest(".sub-channel-container").height())});P=!1;Fa()},error_phrase:"error_fetching_channels"});a(document).on("click keydown",".channel-config-dialog .add-channel-fieldset .add-button, .channel-config-dialog .add-channel-fieldset input",function(b){if(("click"==b.type||13!=b.which)&&"text"==this.type||"keydown"==b.type&&"button"==this.type&&13!=b.which)return!0;var d="text"==this.type?a(this):a(this).prev();if((b=a.trim(d.val()))&&
b!=d.prop("defaultValue")){var c=a("#top-level-forum .channel-config-dialog .channel-list");eb(c,"","",vBulletin.htmlEntities(b),0,!0,0);cb(c);Fa();d.val("");"button"==this.type&&d.trigger("focus")}else vBulletin.warning("warning_gcpuser","please_enter_channel_title",function(){d.trigger("focus")})});a(document).on("click",".channel-config-dialog .main-channel-container .channel-item .channel-title div",function(){a(this).hide().next().show().trigger("select").trigger("focus")});a(document).on("keydown blur",
".channel-config-dialog .main-channel-container .channel-item .channel-title input",function(b){if("focusout"==b.type||"keydown"==b.type&&13==b.which)a.trim(this.value)||"focusout"!=b.type||(this.value=this.defaultValue),a.trim(this.value)&&a(this).hide().prev().text(this.value).show()});a(document).on("click",".channel-config-dialog .channel-item .category-to-channel a",function(){var b=a(this);b.closest(".channel-item").attr("data-switch-category",0);b.parent().removeClass("category-to-channel").addClass("channel-to-category");
b.html(vBulletin.phrase.get("make_category"));return!1});a(document).on("click",".channel-config-dialog .channel-item .channel-to-category a",function(){var b=a(this);b.closest(".channel-item").attr("data-switch-category",1);b.parent().removeClass("channel-to-category").addClass("category-to-channel");b.html(vBulletin.phrase.get("make_forum"));return!1});a(document).on("click",".channel-config-dialog .channel-item .toggle-button",function(){Ea(a(this));return!1});a(document).on("click",".channel-config-dialog .channel-item .add-subchannel-button a",
function(){var b=a(this).parent().siblings(".toggle-button");Ea(b,!0);var d=a(this).closest(".channel-item-container"),c=fb("","",vBulletin.phrase.get("new_channel"),0,d,0);db(d);c.slideDown(100,function(){var e=d.find(".channel-item-inner").first().find(".num-subchannels");e.text(parseInt(e.text())+1);a(".channel-title div",c).trigger("click");a(".channel-title input",c).get(0).scrollIntoView(!1);Fa()});return!1});a(document).on("click",".channel-config-dialog .channel-list .channel-item .close-button",
function(){var b=a(this),d=0<a("> .sub-channel-container > .channel-item-container",b.closest(".channel-item-container")).length,c=vBulletin.htmlEntities(b.prev().text());O.openConfirmDialogSimple({title:"remove_forum_q",message:["do_you_want_to_remove_forum",c,d?" "+ia.get("subchannels_will_be_deleted"):""],iconType:"warning",onClickYes:function(){var e=b.closest(".channel-item-container"),k=e.parent(),r=b.closest(".channel-item").attr("data-channel-id"),v=function(){e.remove();k.hasClass("main-channel-container")&&
k.slideUp("fast",function(){a(this).remove()})};r?vBulletin.AJAX({call:"/ajax/api/content_channel/delete",data:{nodeid:r},success:function(p){v()}}):v()}})})}function Cb(b){function d(c,e,k){vBulletin.AJAX({call:"/ajax/render/{0}_list".format(c),data:{page:e,isAjaxTemplateRenderWithData:!0},complete:function(){a("#config-dialog .loader").hide();a("body").css("cursor","auto")},success:function(r){a("#top-level-{0} .channel-config-dialog".format(c)).html(r.template);k&&vBulletin.pagination({context:"#top-level-{0} .channel-config-dialog".format(c),
onPageChanged:function(v,p){d(c,v)}})},error_phrase:"error_fetching_channels"})}d(b,1,!0);a(document).on("click",".page_manager_table .channel_name div",function(){a(this).hide().next().show().trigger("select").trigger("focus")});a(document).on("keydown blur",".page_manager_table .channel_name input",function(c){if("focusout"==c.type||"keydown"==c.type&&13==c.which){a.trim(this.value)||"focusout"!=c.type||(this.value=this.defaultValue);var e=a.trim(this.value),k=a(this);e&&k.prev().html()!=e&&(a("body").css("cursor",
"wait"),vBulletin.AJAX({call:"/ajax/api/Content_Channel/update",data:{nodeid:k.parents(".channel_row").data("nodeid"),data:{title:e}},complete:function(){a("#config-dialog .loader").hide();a("body").css("cursor","auto")},success:function(r){k.hide();k.prev().html(e);k.prev().show()},error_phrase:"error_saving_page"}))}});a(document).on("click",".page_manager_table .delete",function(){let c=a(this).parents(".channel_row");O.openConfirmDialogSimple({title:"remove_channel_q",message:["do_you_want_to_remove_channel",
c.find(".channel_name_val").html()],iconType:"warning",onClickYes:()=>{vBulletin.AJAX({call:"/ajax/api/content_channel/delete",data:{nodeid:c.data("nodeid")},success:()=>{c.remove()}})}})})}function tb(){a("body").css("cursor","wait");var b=function(d,c){d=d.index();0!=d||lb||Bb();1!=d&&2!=d||Cb(a(c).data("top-level"))};Ja=a("#manage-pages").tabs({beforeActivate:function(d,c){var e=c.newTab.index();if(0!=e&&P)return O.openConfirmDialogSimple({title:"exit_without_saving_page",message:"forum_changes_will_be_lost",
iconType:"warning",onClickYes:()=>{P=!1;Ja.tabs("option","active",e)}}),!1},create:function(d,c){b(c.tab,d.currentTarget)},activate:function(d,c){b(c.newTab,d.currentTarget)}});Ja.tabs("option","active",0);a("#manage-page-dropdown .lnkSaveChanges").on("click",function(){function d(k,r,v){k=a("> .channel-item-container",k);0<k.length&&k.each(function(p){var f=a("> .channel-item",this),m=f.attr("data-channel-id"),y=f.attr("data-parent-id");subchannelObj={nodeid:m||"0",previousParentId:y,title:a(".channel-title div",
f).html(),displayorder:p+1,parentid:v||"0",subchannels:[]};null!=f.attr("data-switch-category")&&(subchannelObj.switchCategory=f.attr("data-switch-category"));r.subchannels.push(subchannelObj);d(f.next(".sub-channel-container"),r.subchannels[p],m)})}var c=a(this);if(c.hasClass("h-disabled"))console.log("We are busy saving already. Try again later.");else{c.addClass("h-disabled");var e=[];ba?(a(".channel-config-dialog .channel-list .main-channel-container").each(function(k){var r=a("> .channel-item-container > .channel-item",
this),v=r.attr("data-channel-id"),p=r.attr("data-parent-id");k={nodeid:v,previousParentId:p,title:a(".channel-title div",r).html(),displayorder:k+1,subchannels:[]};null!=r.attr("data-switch-category")&&(k.switchCategory=r.attr("data-switch-category"));d(r.next(".sub-channel-container"),k,v);e.push(k)}),vBulletin.AJAX({call:"/ajax/api/widget/saveForums",data:{data:JSON.stringify(e)},complete:function(){c.removeClass("h-disabled")},success:function(k){ba=P=!1;ja()},title_phrase:"error_saving_forums"})):
c.removeClass("h-disabled")}});a(document).on("click","#manage-page-dropdown .lnkExitWithoutSaving",function(){Ma(P,"exit_without_saving_page","do_you_want_to_exit_without_saving_page").then(ja)})}function Ya(){function b(h){let g=a("#save-page-form");g.find(".template-name").toggleClass("h-hide",h);g.find(".page-template-name").toggleClass("h-hide",!h);g.find("#templatetitle-edit").prop("disabled",h)}function d(h){"undefined"==typeof qa.search_config_dialog?vBulletin.AJAX({call:"/ajax/render/dialog_search_config",
success:function(g){qa.search_config_dialog=g;a("body").append(g);d(h)},error_phrase:"error_fetching_dialog"}):(h&&a("#search-config-dialog").data("search-widget",h),Aa(a("#search-config-dialog").dialog({title:vBulletin.phrase.get("edit_search_module"),autoOpen:!0,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,width:800,dialogClass:"dialog-container search-config-dialog-container input-dialog",close:function(){ha("visible");a(this).trigger("vb-deinstrument")},open:function(){var g=this;
a("#customSearchDialog",g).addClass("h-invisible");a("body").css("cursor","wait");vBulletin.search=vBulletin.search||{};var t=function(){za=new vBulletin.search.SearchControl("#customSearchDialog");Db(za)},n=a("#search-config-dialog").data("search-widget");n.attr("data-widget-id");n.attr("data-widget-instance-id");if("undefined"==typeof vBulletin.search.SearchControl){var u=["/js/tag-editor.js","/js/sb_search.js"],w=function(){if(0==u.length)a("body").css("cursor","auto"),a("#customSearchDialog",
g).removeClass("h-invisible"),t();else{var x=u.shift();a.getScript(vBulletin.getAjaxBaseurl()+x+"?c="+pageData.cachebuster,w).fail(function(F,N,J){F=J&&J.message?"{0}: {1}".format(vBulletin.phrase.get("error"),J.message):"HTTP {0}: {1}".format(F.status,F.statusText);a("#search-config-dialog").dialog("close");openAlertDialog({title:vBulletin.phrase.get("error"),message:"{0}<br /><br />({1})".format(vBulletin.phrase.get("error_loading_search_config_script"),F),iconType:"error"})})}};w()}else a("#customSearchDialog",
g).removeClass("h-invisible"),t();P=!1},create:function(){a("#btnSaveSearchConfig").on("click",function(){a("body").css("cursor","wait");var g=a("#search-config-dialog");let t=g.data("search-widget");var n=t.attr("data-widget-id"),u=t.attr("data-widget-instance-id");let w={pageid:pageData.pageid,widgetid:n,widgetinstanceid:u,pagetemplateid:a("#select-template input[type=radio]:checked").val(),searchJSON:{}};n=a("#searchTitle");0<n.length&&0<a.trim(n.val()).length&&(w.searchTitle=a.trim(n.val()),n.data("defaultValue",
w.searchTitle));let x={};a('input[name^="data[searchTitle]"]',g).each((J,I)=>{if(J=/data\[searchTitle\]\[(\d+)\]/.exec(I.name))x[J[1]]=I.value});Object.keys(x).length&&(w.searchTitle=x);g=a("#resultsPerPage");0<g.length&&0<a.trim(g.val()).length&&(w.resultsPerPage=a.trim(g.val()),g.data("defaultValue",w.resultsPerPage));g=["hide_avatars","hide_module_when_empty","hide_usernames","displayFooter"];for(n=0;n<g.length;n++){u=g[n];var F=a("input[name='"+u+"'][value='1']");0<F.length&&F.prop("checked")?
(w[u]="1",F.data("defaultValue","1")):(w[u]="0",F.data("defaultValue","0"))}g=a(".js-searchmodule-show-at-breakpoints");0<g.length&&(w.show_at_breakpoints={desktop:1,small:1,xsmall:1},g.find("input").each(function(){var J=a(this);switch(J.prop("name")){case "show_at_breakpoints[desktop]":w.show_at_breakpoints.desktop=J.prop("checked")?1:0;break;case "show_at_breakpoints[small]":w.show_at_breakpoints.small=J.prop("checked")?1:0;break;case "show_at_breakpoints[xsmall]":w.show_at_breakpoints.xsmall=
J.prop("checked")?1:0}}),g.data("defaultValue",w.show_at_breakpoints));u=a("#search-config-dialog .js-sb-module-config--viewpermissions");if(0<u.length){w.module_viewpermissions={};g=u.find("input.js-module_viewpermissions__key:checked");n="show_all";u=u.find("input.js-module_viewpermissions__value:checked");var N="all";g.length&&(n=g.prop("value"));u.length&&(N=[],a.each(u,function(J,I){N.push(a(I).prop("value"))}));w.module_viewpermissions={key:n,value:N}}g=a("#search-config-dialog .js-sb-module-config--filter_nodes");
0<g.length&&(g=Eb(g.find(":input")),w.module_filter_nodes="data"in g&&"module_filter_nodes"in g.data?g.data.module_filter_nodes:{});w.searchJSON=za.load();vBulletin.AJAX({call:"/ajax/api/widget/saveSearchWidgetConfig",data:{data:JSON.stringify(w)},complete:function(){a("body").css("cursor","auto")},success:function(J){0<J.widgetinstanceid&&J.searchJSON&&(t.attr("data-widget-instance-id",J.widgetinstanceid),t.find(".main-title").text(w.searchTitle),a("#config_widgetinstanceid").val(J.widgetinstanceid),
a("#config_pagetemplateid").val(J.pagetemplateid),a("#pagetemplateid-new").val(J.pagetemplateid),a("#search-config-dialog").dialog("close"),t.find(".widget-content").is(":hidden")&&t.find(".toggle-button").trigger("click",[!0]),P=!0)},error_phrase:"error_saving_search_config"})});a("#btnCancelSearchConfig").on("click",function(){function g(){a("#search-config-dialog").dialog("close");za.set("{}");var t=a("#search-config-dialog #searchTitle");t.val(t.data("defaultValue"));t=a("#search-config-dialog #resultsPerPage");
t.val(t.data("defaultValue"));t=["hide_avatars","hide_module_when_empty","hide_usernames","displayFooter"];for(var n=0;n<t.length;n++){var u=t[n],w=a("#search-config-dialog input[name='"+u+"'][value='1']");u=a("#search-config-dialog input[name='"+u+"'][value='0']");"1"==w.data("defaultValue")?w.prop("checked",!0):u.prop("checked",!0)}t=a("#search-config-dialog .js-searchmodule-show-at-breakpoints");if(0<t.length){var x=t.data("defaultValue");"undefined"!=typeof x&&t.find("input").each(function(){var F=
a(this);switch(F.prop("name")){case "show_at_breakpoints[desktop]":F.prop("checked",x.desktop);break;case "show_at_breakpoints[small]":F.prop("checked",x.small);break;case "show_at_breakpoints[xsmall]":F.prop("checked",x.xsmall)}})}}P?O.openConfirmDialogSimple({title:"cancel_edit",message:"do_you_want_to_cancel_editing_search_module",iconType:"warning",onClickYes:g}):g()})}})))}a(document).on("focus click",".edit-mode .widget-content a, .edit-mode #channel-tabbar a, .edit-mode #btnSearch, .edit-mode #q",
function(h){this.blur();return!1});gb||yb();ib?(Ha.thumbnailRadioCheckbox("check",a("#select-template .template-border.selected").next("input"),!1),T||a("#select-template .template-item input[value={0}]".format(a("#pagetemplateid-yes").val())).prev().trigger("click")):zb();a.isEmptyObject(wa)&&Ra();Z();a("#config_pagetemplateid").val("");da=void 0;if(T){var c=a("#save-page-form");c.find("#pageurl, #pagetitle").val("");c.find("#pageid").val(0);c.find("#ishomeroute").prop({disabled:!1,checked:!1})}a("#edit-page-dropdown .lnkDeletePage").on("click",
()=>{O.openConfirmDialogSimple({title:"confirm_deletion_gcpglobal",message:"confirm_remove_page_desc",yesPhrase:"delete_page",noPhrase:"cancel",iconType:"warning",onClickYes:()=>{vBulletin.AJAX({call:"/ajax/api/page/delete",data:{pageid:pageData.pageid},success:()=>{location.href=pageData.baseurl}})}})});a("#edit-page-dropdown .lnkSaveChanges").on("click",function(){var h=a("#save-page-form");let g=h.find(".new-page-template");h=h.find(".edit-page-template");var t=a("#edit-page-dropdown .tabs");t.find("li").removeClass("ui-tabs-active ui-state-active");
t.find(".tab").addClass("ui-tabs-hide");a("#save-content").show();let n=(t=a("body").hasClass("lnkNewPage"))||!T||V||P?"":"none";h.css("display",n).prev("label").css("display",n);g.find("input").prop("disabled",!t);h.find("input").prop("disabled",t);t||(a("#pagetemplateid-yes").prop("checked")||a("#pagetemplateid-no").prop("checked")||a("#pagetemplateid-yes").prop("checked",!0),b(a("#pagetemplateid-yes").prop("checked")))});a(document).on("click","#edit-page-dropdown .lnkExitWithoutSaving",function(){V||
P||fa||!(T||La(a("#pagetitle"))&&La(a("#pageurl")))||T&&(""!=a("#pagetitle").val()||""!=a("#pageurl").val())?O.openConfirmDialogSimple({title:"exit_without_saving_page",message:"do_you_want_to_exit_without_saving_page",iconType:"warning",onClickYes:()=>{let h=parseInt(a("input#pagetemplateid-new").val(),10);!isNaN(h)&&0<h?R.AJAX({call:"/ajax/api/page/deleteOrphanedPagetemplates",data:{pagetemplateids:[h]},complete:ja}):ja()}}):ja()});var e=0;a(window).on("resize.canvas",function(){clearTimeout(e);
e=setTimeout(ya,200)});var k=function(h){return'<label class="hide-icon module-button-item"><input type="checkbox" title="{0}" data-toggle-title="{1}"{2} /></label>'.format(ia.get("check_to_hide_module"),ia.get("uncheck_to_unhide_module"),h?' checked="checked"':"")};a(".canvas-widget.container-widget .canvas-widget:not(.dummy-widget)").each(function(){var h=a(this).hasClass("hidden-widget");a(".module-buttons .admin-only",this).prepend(k(!1));h&&a(".module-buttons .admin-only .hide-icon input",this).trigger("click")});
var r=function(h,g,t){t=g.item.hasClass("module-item");h=a("> .canvas-widget.container-widget {0}".format(t?".module-item":".canvas-widget.container-widget"),this);return 0<h.length&&h.closest(".canvas-widget.container-widget").attr("data-widget-id")==h.attr("data-widget-id")?(t?h.remove():g.sender?g.sender.sortable("cancel"):a(this).sortable("cancel"),p=!0,openAlertDialog({title:vBulletin.phrase.get("move_not_allowed"),message:vBulletin.phrase.get("dropping_container_module_into_container_module_not_allowed"),
iconType:"warning"}),!0):!1},v=function(h){0<h.parents(".canvas-widget.container-widget").length?0==a(".module-buttons .admin-only .hide-icon",h).length&&a(".module-buttons .admin-only",h).prepend(k()):h.removeClass("hidden-widget").find("> .widget-header .module-buttons .admin-only .hide-icon").remove()},p=!1;mb=a(".edit-mode .canvas-layout .canvas-widget-list:not(.js-draggable-module-target)");mb.sortable({revert:200,addWidthAnimation:!0,tolerance:"pointer",connectWith:".edit-mode .canvas-layout:visible .canvas-widget-list",
placeholder:"canvas-widget canvas-widget-highlight drag-highlight",create:function(){ya()},update:function(h,g){var t=this;if(Ka)p||Sa(g.item,function(x){x=x.filter(function(){return this.nodeType===Node.ELEMENT_NODE});g.item.replaceWith(x);x.filter(":not(.container-widget)").find(".toggle-button").trigger("click",[!0]);if(!r.apply(t,[h,g])){v(x);x.addClass("shadow").find(".widget-tabs").addBack().filter(".widget-tabs").tabs();ea();x.parents(".canvas-widget.container-widget").find(".canvas-widget.dummy-widget").remove();
var F=x.parents(".canvas-widget.container-widget");1==F.length&&(F.find(".canvas-widget-highlight").remove(),F.find(".module-item").remove())}F=x.data("widget-id");var N=ua(x),J=function(l){x.attr("data-widget-instance-id",l);N&&na(x);oa(x)};if(F){var I=a(t).data("section"),K=0;a(t.children).filter(".canvas-widget").each(function(){a(this);var l=a(this).attr("data-widget-instance-id");if(!l)return!1;K=l});va(N,F,{},J,I,K)}});else if(r.apply(t,[h,g])||(v(g.item),ea()),a.contains(this,g.item[0])){var n=
g.item.closest(".canvas-widget"),u=ua(n),w=n.data("widget-instance-id")||0;na(n);w&&vBulletin.AJAX({call:"/ajax/api/widget/saveWidgetinstanceContainerinstanceid",data:{widgetinstanceid:w,containerinstanceid:u,pagetemplateid:la(),displaysection:sa(n),displayafterwidgetinstanceid:ta(n)}})}g.sender&&(n=g.sender.closest(".canvas-widget"),n.length&&na(n));V=!0},out:function(h,g){a(this).css("overflow","")},sort:function(h,g){Ga&&(Ka=!0)},start:function(h,g){ha("hidden",g.item)},stop:function(h,g){a(this).css("overflow",
"");Ka=p=!1;g.item.height("auto");ha("visible");a(".canvas-layout .canvas-widget-list .canvas-widget-highlight").remove();a(".canvas-layout > .canvas-layout-row .canvas-widget-list > .canvas-widget.container-widget");a(".canvas-layout > .canvas-layout-row .canvas-widget-list > .canvas-widget.container-widget").each(function(){var t=a(".canvas-widget-list",this);0==t.children().length?t.append('<div class="canvas-widget dummy-widget"><span>{0}</span></div>'.format(vBulletin.phrase.get("you_can_also_drag_and_drop_modules_here"))):
0<t.find(".canvas-widget.dummy-widget").length&&0<t.find(".canvas-widget:not(.dummy-widget,.canvas-widget-highlight)").length&&t.find(".canvas-widget.dummy-widget").remove()})},receive:function(h,g){g.item.hasClass("module-item")&&r.apply(this,[h,g,!0])},handle:".move-icon",items:".canvas-widget:not(.js-widget-non-sortable,.js-widget-pinned-sortable)"}).find(".canvas-widget .widget-header").disableSelection();var f=a.ui.sortable.prototype._mouseStop,m=a.ui.sortable.prototype._clear,y=!1,q=jQuery.fn.animate;
a.ui.sortable.prototype._mouseStop=function(h,g){if(y=h&&this.options.revert&&this.options.addWidthAnimation){var t=this.placeholder.outerWidth();jQuery.fn.animate=function(){y&&t&&(arguments[0].width=t);return q.apply(this,arguments)}}return f.apply(this,arguments)};a.ui.sortable.prototype._clear=function(h){y&&q&&(jQuery.fn.animate=q);return m.apply(this,arguments)};a(document).on("click",".edit-mode .canvas-widget .js-pin-module-button",function(){var h=a(this),g=h.closest(".canvas-widget");g.find("js-move-button");
var t=g.hasClass("js-widget-pinned-sortable");g.toggleClass("js-widget-pinned-sortable",!t);h.toggleClass("pin-icon--pinned",!t)});a(document).on("click",".edit-mode .canvas-widget .close-button",function(){var h=a(this);O.openConfirmDialogSimple({title:"remove_module_q",message:["do_you_want_to_remove_module",h.closest(".widget-header").find(".module-title").text()],iconType:"warning",onClickYes:function(){var g=h.closest(".canvas-widget"),t=g.data("widget-instance-id"),n=g.parent(),u=g.parents(".canvas-widget.container-widget");
g.remove();ea();V=!0;Oa([t]);na(n);0==u.find(".canvas-widget").length&&u.find(".canvas-widget-list").append('<div class="canvas-widget dummy-widget"><span>{0}</span></div>'.format(vBulletin.phrase.get("you_can_also_drag_and_drop_modules_here")))}})});a(document).on("click",".edit-mode .js-search-widget .edit-button",function(){ha("hidden");d(a(this).closest(".js-search-widget"));a("#search-config-dialog").dialog("open");return!1});a(document).on("click","#save-page-form #btnOK",function(h,g){function t(u){var w=
{widgetId:u.attr("data-widget-id"),widgetInstanceId:u.attr("data-widget-instance-id")||"0"};if(u.is(".container-widget")){var x=[],F=[];a("div.canvas-widget-list > div.canvas-widget",u).each(function(J){a(this).hasClass("hidden-widget")||F.push(a(this).attr("data-widget-instance-id"));x.push(t(a(this)))});w.subModules=x;w.displaySubModules=F}if(u.data("is-tabbed-container")){var N=[];u.find("> .js-admin-widget-content > .js-admin-widget-tab").each(function(){a(this).find("> .widget-content > .canvas-layout-row > .canvas-widget-list > .canvas-widget:not(.dummy-widget)").each(function(){var J=
a(this);N.push(t(J))})});w.tabbedContainerSubModules=N}return w}h=a("#edit-page-dropdown .lnkSaveChanges .label").text();var n=a("#save-page-form");if(!g){function u(w,x){O.openConfirmDialogSimple({title:["phrase_passthrough",w],message:x,yesPhrase:"save_page",noPhrase:"cancel",iconType:"warning",onClickYes:()=>{a("#save-page-form #btnOK").trigger("click",!0)}})}g=n.find("#pagetitle");if(!a.trim(g.val()))return O.warning(h,"please_enter_page_name",g),!1;if(a("body").hasClass("lnkEditPage"))if(g=n.find("#pagetemplateid-yes"),
noChecked=n.find("#pagetemplateid-no").prop("checked"),yesChecked=g.prop("checked"),noChecked||yesChecked){if(noChecked){n=n.find("#templatetitle-edit");g=a.trim(n.val());if(!g||g==n.prop("defaultValue"))return O.warning(h,"please_enter_new_template_name",n),!1;u(h,["applying_new_template",g]);return!1}if(yesChecked)return!T||V||P?u(h,"overwrite_template_continue"):a("#save-page-form #btnOK").trigger("click",!0),!1}else return O.warning(h,"please_choose_overwrite_template_options",g),!1;else if(n=
n.find("#templatetitle-new"),g=a.trim(n.val()),!g||g==n.prop("defaultValue"))return vBulletin.warning(h,"please_enter_new_template_name",n),!1}h=a(".canvas-layout:visible");X=h.attr("id");n=parseInt(h.attr("data-layout-id"),10);a("#save-page-form #screenlayoutid").val(n);a('input[type=hidden][name*="displaysections"]',h).clone().appendTo(a("#moduleData").empty());a("#"+X+" > .canvas-layout-row > div.canvas-widget-list").each(function(){var u=[],w=bb(this);a(this).children("div.canvas-widget").each(function(){u.push(t(a(this)))});
a('#save-page-form input[name="displaysections['+w+']"]').val(JSON.stringify(u))});h="vbulletin-screenlayout-bare-full-57433eecd10803.93763070"==a("input[name='screenlayoutid'][value='"+n+"']").attr("data-guid");Ma(h,"warning","you_cannot_revert_this_layout_confirm").then(()=>{vBulletin.AJAX({call:"/admin/savepage",data:{input:R.getFormData(a("#save-page-form"),0),url:location.href},success:function(u){u.viewControlEligible?O.alert("page_saved","page_view_perm_admincp","",()=>{location.href=u.url}):
location.href=u.url},error_phrase:"error_saving_page"})})});Aa(a("#config-dialog").dialog({title:vBulletin.phrase.get("module_configuration"),autoOpen:!1,modal:!0,resizable:!1,closeOnEscape:!1,showCloseButton:!1,height:500,width:800,dialogClass:"dialog-container config-dialog-container input-dialog",open:function(){a("#config-dialog .loader").show()},create:function(){a(document).on("submit",".sitebuilder-widget-form",function(){(function(h){a("#config-dialog .js-button").prop("disabled",!0);var g=
a("#config-dialog").data("selected-module");vBulletin.AJAX({url:h.action,type:h.method,data:a(h).serializeArray(),success:function(t){if(t.data){if(t=t.data.title||t.data.searchResultTitle||t.data.searchTitle)t.match(/^widget_[\d]+_title$/)&&(t=ia.get(t,0)),t=vBulletin.phrase.get("x_module",t),g.find(".module-title .admin-only").html(t);t=a('select[name="data[default_tab]"]',a(h));0<t.length&&g.attr("data-widget-default-tab",t.val());P=!0}a("#config-dialog").dialog("close")},after_error:function(){a("#config-dialog .loader").hide();
a("#config-dialog .js-button").prop("disabled",!1)},error_phrase:["error_saving_configuration_module",a("#config-dialog .widget-name h1").text()]})})(this);return!1});a("#btnCloseConfig").on("click",function(){a("#config-dialog").dialog("close")})},close:function(){ha("visible");a("#config-dialog .js-button").prop("disabled",!1)}}));if(T){c=a("#pagetitle");let h=a("#pageurl"),g=!0;c.on("focus",t=>{var n=h.val();g=""==n||n==t.currentTarget.value.replace(/[^\w-]+/g,"")});c.on("keyup blur",t=>{g&&h.val(t.currentTarget.value.replace(/[^\w-]+/g,
""))})}a("#pagetemplateid-yes").on("click",()=>b(!0));a("#pagetemplateid-no").on("click",()=>b(!1))}function Eb(b){if(1>b.length)return{};var d={};b.serializeArray().forEach(function(c){var e=c.value;var k=c.name,r=k.indexOf("[");c=0<=r&&k.substring(0,r)||k;k=0<=r&&k.substring(r)||"";r=/\[([^\]]*)\]/g;var v=5,p=[c];if(0<k.length){do(c=r.exec(k))&&"1"in c&&p.push(c[1]);while(null!==c&&0<v--)}e=nb(p,e);d=ob(d,e)});return d}function ob(b,d){if(Array.isArray(d))d.forEach(function(e){b.push(e)});else{if("object"!=
typeof d)return d;for(var c in d)d.hasOwnProperty(c)&&(b[c]=c in b?ob(b[c],d[c]):d[c])}return b}function nb(b,d){var c=b.shift(),e={};0<b.length&&(d=nb(b,d));if(""==c)return[d];e[c]=d;return e}function Db(b){let d=a("#search-config-dialog"),c=d.data("search-widget");var e=c.attr("data-widget-id"),k=c.attr("data-widget-instance-id");let r=a("#searchTitle",d),v=r.closest(".js-config-row");vBulletin.AJAX({call:"/ajax/api/widget/fetchSearchConfig",data:{widgetid:e,widgetinstanceid:k||"",pagetemplateid:la(),
configtype:"admin"},success(p){v.removeClass("h-hide-imp");p.hasOwnProperty("searchTitle")&&r.val(p.searchTitle);p.hasOwnProperty("resultsPerPage")&&a("#resultsPerPage").val(p.resultsPerPage);for(var f=["hide_avatars","hide_module_when_empty","hide_usernames","displayFooter"],m=0;m<f.length;m++){var y=f[m];value=p[y]&&1==parseInt(p[y],10)?1:0;a("input[name='"+y+"'][value='"+value+"']").prop("checked",!0)}p.hasOwnProperty("show_at_breakpoints")&&(f=a("#search-config-dialog .js-searchmodule-show-at-breakpoints"),
0<f.length&&f.find("input").each(function(){var q=a(this);switch(q.prop("name")){case "show_at_breakpoints[desktop]":q.prop("checked",p.show_at_breakpoints.desktop);break;case "show_at_breakpoints[small]":q.prop("checked",p.show_at_breakpoints.small);break;case "show_at_breakpoints[xsmall]":q.prop("checked",p.show_at_breakpoints.xsmall)}}));p.hasOwnProperty("module_viewpermissions")&&(m=a("#search-config-dialog .js-searchmodule-module_viewpermissions--replaceme"),f=kb({defaultvalue:p.module_viewpermissions}),
m.replaceWith(f));if(p.hasOwnProperty("searchJSON")&&("string"==typeof p.searchJSON&&(p.searchJSON=JSON.parse(p.searchJSON||"{}")),p.searchJSON.channel&&0<p.searchJSON.channel.length))if("param"in p.searchJSON.channel)p.module_filter_nodes={include:["current"]},p.module_filter_nodes.include_children=!0;else{p.module_filter_nodes={include:[]};p.module_filter_nodes.include_children=!0;if("number"==typeof p.searchJSON.channel||"string"==typeof p.searchJSON.channel)p.searchJSON.channel=[p.searchJSON.channel];
p.searchJSON.channel&&0<p.searchJSON.channel.length&&p.searchJSON.channel.forEach(function(q){p.module_filter_nodes.include.push(q)})}p.hasOwnProperty("module_filter_nodes")&&(m=a("#search-config-dialog .js-searchmodule-module_filter_nodes--replaceme"),f=S.generateConfigInputs__Module_Filter_Nodes({defaultvalue:p.module_filter_nodes}),m.replaceWith(f),a("#search-config-dialog select.js-module_filter_nodes-values").selectBox());b.set(p.searchJSON||{},p.contentTypes||{},p.channels||{});a("#config-dialog .dialog-content .widget-config-container").show();
a("#search-config-dialog .form_layout .form_row .field_column select").selectBox()},after_error:function(){a("#config-dialog .loader").hide();a("#config-dialog").dialog("close")}}).then(p=>k?vBulletin.AJAX({call:"/ajax/api/widget/fetchModuleTranslatableConfigs",data:{widgetinstanceid:k},success(f){if(f.translatables)for(const [m,y]of Object.entries(f.translatables)){f=a("#"+m);f=f.closest(".js-config-row")||f.parent();let q=S.generateTranslatableForSearchModuleConfig(y);q&&(f.addClass("h-hide-imp"),
f.after(q),S.attachTranslatableToggleEvent(q.parent()),d.on("vb-deinstrument",h=>{S.detachTranslatableToggleEvent(q.parent());q.remove()}))}}}):a.Deferred().resolve()).then(()=>{a("#config-dialog .loader").hide()})}const Q=ia.get,S=R.sitebuilder;let xa,Ja,X,ab,Ha,$a=[],V=!1,P=!1;var ba=void 0;let ib=!1,gb=!1,fa=!1,Ga=!1,Ka=!1,za=!1,T=!1,qa={},Ia={},wa={},hb,mb,da,Pa={saveNewWidgetInstance:!1},Qa=a("<div>");a(document).on("vb-toggle-sitebuilder-menu",W);a(document).on("click",".js-top-menu-sitebuilder--list .js-top-menu-link:not(.js-top-menu-tab--admincp)",
function(b){var d=a(b.target),c=d.data("panel-name");if(d.is(".b-top-menu__item-link--disabled"))return this.blur(),b.stopPropagation(),!1;b="vb-sitebuilder-panel--"+c;a(document).trigger(b);return!1});S.activateSB=Y;var lb=!1;a(()=>{sb();vBulletin.ready("sb_page").resolve()})})(jQuery,vBulletin,vBulletin.dialogtools,vBulletin.phrase);
;

// ***************************
// js.compressed/admin-sbpanel-style.js
// ***************************
vBulletin.precache("cancel changed_extra_css_warning confirm_action css_reverted css_saved error_loading_css error_setting_theme loading_themes no_preview_available revert revert_extra_css_warning save_and_continue style_changed success there_are_no_themes_installed".split(" "),["styleid"]);vBulletin.ensureObj("sitebuilder");
$.extend(vBulletin.sitebuilder,function(c,U,x,p){function I(b){vBulletin.assertUserHasAdminPermission("canusesitebuilder",this,()=>{y.call(this)});return!1}function y(b,a){var d=c(this);c(document.body);var e=!d.hasClass("selected"),g=!0;"undefined"!=typeof b&&(e=!!b);"undefined"!=typeof a&&(g=!!a);e?(c(document.body).addClass("js-edit-mode-style"),J(),c(".js-style-panel").css("display","none").removeClass("h-hide").slideDown("400",z)):(K(!e,d),c(".js-style-panel").slideUp("fast",function(){c(document.body).removeClass("js-edit-mode-style");
var f=new URL(location.href);f.searchParams.delete("adminAction");g?location.replace(f.href):history.replaceState({},"",f.href)}))}function u(b){y(!1,b);return!1}function K(b,a){c(document).trigger("vb-toggle-sitebuilder-menu",{enableButtons:b,currentButton:a})}function A(b,a,d){var e=c(".js-theme-selector__list:visible .js-theme-selector__theme-radio:checked").val();vBulletin.AJAX({call:"/ajax/api/style/setDefaultStyle",data:{styleid:e},error_phrase:"error_setting_theme",success:function(){x.setCookie("userstyleid",
e,!0);("undefined"==typeof a||a)&&u(!0);"undefined"!=typeof d&&d&&vBulletin.flashMessage(vBulletin.phrase.get("style_changed"))}});return!1}function L(){B(null)}function M(b){p.openConfirmDialogSimple({title:"revert",message:"revert_extra_css_warning",iconType:"warning",onClickYes:()=>{vBulletin.AJAX({call:"/ajax/api/template/revertCssTemplateSbEditor",data:{styleid:q,templateName:n},success:function(){p.alert("success","css_reverted","",v)},error_phrase:"error_saving_css"})}});return!1}function N(b){r(t,
C)}function D(b,a,d){!a&&b&&b.target&&(a=c(b.target).closest(".js-theme-selector__theme").data("preview-url"));d||(d=c(b.target).closest(".js-theme-selector__list"));b=d.closest(".js-panel").find(".js-theme-selector__theme-preview");d=b.find("> img, > p");1==b.length&&(a=a?c("<img />").prop("src",a):c("<p />").addClass("b-theme-selector__theme-preview-message").text(vBulletin.phrase.get("no_preview_available")),d.is("p")&&a.is("p")?d.fadeTo(200,"0.5",function(){c(this).fadeTo(400,1)}):(d.css("zIndex",
"2"),a.css("zIndex","1").hide(),b.append(a),d.fadeOut({duration:300,queue:!1,complete:function(){c(this).remove()}}),a.fadeIn({duration:600,queue:!1})))}function O(b,a,d){d="js-theme-selector__theme b-theme-selector__theme h-margin-right-xl";var e=c('<input type="radio" name="styleid" value="'+this.styleid+'" />').addClass("js-theme-selector__theme-radio b-theme-selector__theme-radio h-margin-none h-margin-right-s"),g=c("<label />").prop("title",this.title),f=c("<div />").addClass("h-margin-s h-margin-bottom-none b-theme-selector__theme-title").text(30<
this.title.length?this.title.substr(0,20)+" ...":this.title),h=c("<img />").addClass("h-margin-s h-margin-bottom-m").prop("src",this.iconurl),m=c("<div />").addClass("b-theme-selector__theme-thumbnail"),l=this.iconurl;(new Image).src=l;l=this.previewurl;(new Image).src=l;a==this.styleid&&(e.prop("checked",!0),D({},this.previewurl,b),d+=" b-theme-selector__theme--selected js-theme-selector__theme--selected js-vbscroller-selected-item");m.append(h);f.prepend(e);g.append(m).append(f);c("<div />").addClass(d).data("preview-url",
this.previewurl||"").append(g).appendTo(b);w.call(h.get(0),2)}function w(b){var a=c(this);a.css({maxWidth:"none",maxHeight:"none"});var d=a.outerWidth()||0,e=a.outerHeight()||0,g=d>e?"height":"width",f=!1;if(0<d&&0<e){var h=!1;if("width"==g&&100<d){var m=100/d;h=!0}else"height"==g&&100<e&&(m=100/e,h=!0);h&&(a.removeClass("h-margin-s h-margin-bottom-m").css({maxWidth:d*m,maxHeight:e*m}),d=a.parent(),e=c("<div />").addClass("b-theme-selector__image-resize-wrapper h-margin-s h-margin-bottom-m").css({width:100,
height:100,overflow:"hidden"}),e.append(a),d.append(e),f=!0)}if(!f)if(a.css({maxWidth:"100px",maxHeight:"100px"}),0<b){var l=this;window.setTimeout(function(){w.call(l,--b)},100)}else l=this,a.off("load").on("load",function(){w.call(l,--b)})}function P(b,a){var d=0,e=vBulletin.options.get("styleid");a.html("");b&&b.themes&&c.each(b.themes,function(){O.apply(this,[a,e,d]);++d});d?Q(a):c("<div />").addClass("b-theme-selector__message").text(vBulletin.phrase.get("there_are_no_themes_installed")).appendTo(a)}
function Q(b){vBulletin.vBScroller&&vBulletin.vBScroller.initializeScroller&&(b=b.closest(".js-vbscroller-wrapper"),vBulletin.vBScroller.initializeScroller(b))}function E(b){function a(e){var g=b,f=c(this).closest(".js-theme-selector__theme"),h=f.find(".js-theme-selector__theme-radio");f.is(".js-theme-selector__theme--selected")||(h.prop("checked",!0),f=c(this),f.closest(".js-theme-selector__list").find(".js-theme-selector__theme").removeClass("b-theme-selector__theme--selected js-theme-selector__theme--selected js-vbscroller-selected-item"),
f.closest(".js-theme-selector__theme").addClass("b-theme-selector__theme--selected js-theme-selector__theme--selected js-vbscroller-selected-item"),D.call(this,e),g.liveUpdate&&A.call(this,e,!1,!0))}b=c.extend({},{liveUpdate:!1,container:document},b);var d=c(".js-theme-selector__list",b.containerSelector);d.off("change",".js-theme-selector__theme-radio").on("change",".js-theme-selector__theme-radio",a);d.off("click",".js-theme-selector__theme label img").on("click",".js-theme-selector__theme label img",
a);vBulletin.AJAX({call:"/ajax/api/style/getThemeInfo",success:function(e){P.apply(this,[e,d])},error:function(){var e=c("<div />").addClass("b-theme-selector__message").text(vBulletin.phrase.get("error_fetching_themes"));d.html(e)}})}function R(b){b=c(b.target);if(b.is(".js_stylepanel_selectStyle")&&isNaN(parseFloat(b.val()))||b.is(".js_stylepanel_selectTemplate")&&""==b.val())return!1;currentText=k.getValue();t!=k.getValue()?S():v()}function F(){var b=new Date,a=c(".js_stylepanel_selectStyle").val(),
d=c(".js-sb-sprite-icon-preview-img"),e=d.attr("src");e=e.replace(/styleid=\d+/,"styleid="+a);e=e.replace(/ts=\d+/,"ts="+b.getTime());d.attr("src",e)}function T(b){var a=c(".js-sb-sprite-icon-preview");a.data("preview-initialized")||(c(".js-sb-sprite-icon-preview-bg-btn").css("background-color",function(){return c(this).data("bgcolor")}).on("click",function(){var d=c(this);c(".js-sb-sprite-icon-preview-img-wrapper").css("background-color",d.data("bgcolor"));c(".js-sb-sprite-icon-preview-bg-btn").removeClass("sb-sprite-icon-preview-bg-btn--selected");
d.addClass("sb-sprite-icon-preview-bg-btn--selected");return!1}).eq(1).trigger("click"),a.data("preview-initialized","1"));b&&"css_sprite_icons_general.css"==b?(a.removeClass("h-hide"),F()):a.addClass("h-hide")}function r(b,a){let d=c(".js_stylepanel_selectStyle"),e=c(".js_stylepanel_selectTemplate"),g=c(".js_stylepanel_selecttype");k.setValue(b);t=k.getValue();q=d.val();n=e.val();C=a;g.selectBox("value",a);g.val()!=a&&(console.log("fred",c(".js-default-compiletype"),c(".js-default-compiletype").val()),
g.selectBox("value",c(".js-default-compiletype").val()));T(n)}function v(){let b=c(".js_stylepanel_selectStyle"),a=c(".js_stylepanel_selectTemplate");if(!G){let d=x.getCookie("userstyleid");d&&b.val(d);G=!0}vBulletin.AJAX({call:"/ajax/api/template/getCssTemplateSbEditor",data:{styleid:b.val(),templateName:a.val()},success:d=>{d=d.template;r(d.template,d.compiletype)},api_error:()=>{r("","full")},error_phrase:"error_loading_css"})}function S(){p.openConfirmDialogSimple({title:"confirm_action",message:"changed_extra_css_warning",
yesPhrase:"save_and_continue",noPhrase:"cancel",iconType:"warning",onClickYes:()=>{B(v)},onClickNo:()=>{c(".js_stylepanel_selectStyle").selectBox("value",q);c(".js_stylepanel_selectTemplate").selectBox("value",n)}})}function B(b){let a=k.getValue(),d=c(".js_stylepanel_selecttype").val();vBulletin.AJAX({call:"/ajax/api/template/saveCssTemplateSbEditor",data:{text:a,styleid:q,templateName:n,compiletype:d},success:()=>{r(a,d);F();p.alert("success","css_saved","",b)},error_phrase:"error_saving_css"})}
function z(){function b(){if("undefined"==typeof k){var e=c(".sb-style-panel_cssextraedit").get(0);k=CodeMirror.fromTextArea(e,{mode:"css",lineNumbers:!0});(e=c(e).attr("dir"))&&c(k.display.wrapper).attr("dir",e);t="";a.find(".js_stylepanel_selectStyle").change();d.off("click",b);c(".js-select-box",a).selectBox()}}var a=c(".js-style-panel .js-admin-stylepanel-csseditor"),d=c(".sb-style-panel .tab-item a");d.off("click",b).on("click",b);a.is(":visible")&&b()}function J(){if(!H){c(".js-style-panel .tabs").tabs();
var b=c(document);var a=".js-style-panel #admin-stylepanel-themes .js-button--save";b.off("click",a).on("click",a,A);a=".js-style-panel #admin-stylepanel-themes .js-button--cancel";b.off("click",a).on("click",a,u.bind(null,!1));a=c("#admin-stylepanel-csseditor");a.find(".js-button--revert").offon("click",M);a.find(".js-button--cancel").offon("click",N);a.find(".js-button--close").offon("click",u.bind(null,!0));a.find(".js-button--save").offon("click",L);a.find(".js_stylepanel_selectStyle, .js_stylepanel_selectTemplate").offon("change",
R);1==c(".js-style-panel .js-theme-selector__container").length&&E({liveUpdate:!1,containerSelector:".js-style-panel"});1==c(".js-style-panel .js-admin-stylepanel-csseditor").length&&z();H=!0}}let H=!1,k,t="",q=0,n="",C="",G=!1;c(function(){c(document).on("vb-sitebuilder-panel--style",I);vBulletin.ready("sb_page_style").resolve()});return{initThemesInQuickConfig:function(){E({liveUpdate:!0,containerSelector:".js-config-site-panel"})}}}(jQuery,vBulletin,vBulletin.storagetools,vBulletin.dialogtools));
;

// ***************************
// js.compressed/jquery/datatables/js/jquery.dataTables.min.js
// ***************************
/*
 @summary     DataTables
 @description Paginate, search and sort HTML tables
 @version     1.9.1
 @file        jquery.dataTables.js
 @author      Allan Jardine (www.sprymedia.co.uk)
 @contact     www.sprymedia.co.uk/contact

 @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.

 This source file is free software, under either the GPL v2 license or a
 BSD style license, available at:
   http://datatables.net/license_gpl2
   http://datatables.net/license_bsd

 This source file is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.

 For details please refer to: http://www.datatables.net
*/
(function(h,R,q,p){var k=function(e){function r(a,b){var c=k.defaults.columns,d=a.aoColumns.length;b=h.extend({},k.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:q.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mDataProp:c.mDataProp?c.oDefaults:d});a.aoColumns.push(b);a.aoPreSearchCols[d]===p||null===a.aoPreSearchCols[d]?a.aoPreSearchCols[d]=h.extend({},k.models.oSearch):(b=a.aoPreSearchCols[d],
b.bRegex===p&&(b.bRegex=!0),b.bSmart===p&&(b.bSmart=!0),b.bCaseInsensitive===p&&(b.bCaseInsensitive=!0));u(a,d,null)}function u(a,b,c){b=a.aoColumns[b];c!==p&&null!==c&&(c.sType!==p&&(b.sType=c.sType,b._bAutoType=!1),h.extend(b,c),t(b,c,"sWidth","sWidthOrig"),c.iDataSort!==p&&(b.aDataSort=[c.iDataSort]),t(b,c,"aDataSort"));b.fnGetData=Z(b.mDataProp);b.fnSetData=ya(b.mDataProp);a.oFeatures.bSort||(b.bSortable=!1);!b.bSortable||-1==h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting)?(b.sSortingClass=
a.oClasses.sSortableNone,b.sSortingClassJUI=""):b.bSortable||-1==h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting)?(b.sSortingClass=a.oClasses.sSortable,b.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",b.asSorting)&&-1==h.inArray("desc",b.asSorting)?(b.sSortingClass=a.oClasses.sSortableAsc,b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==h.inArray("asc",b.asSorting)&&-1!=h.inArray("desc",b.asSorting)&&(b.sSortingClass=a.oClasses.sSortableDesc,b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}
function m(a){if(!1===a.oFeatures.bAutoWidth)return!1;fa(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function K(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,c==b)return d;return null}function G(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,d==b)return!0===a.aoColumns[d].bVisible?c:null;return null}function H(a){for(var b=0,c=0;c<a.aoColumns.length;c++)!0===a.aoColumns[c].bVisible&&
b++;return b}function B(a){for(var b=k.ext.aTypes,c=b.length,d=0;d<c;d++){var g=b[d](a);if(null!==g)return g}return"string"}function F(a,b){b=b.split(",");for(var c=[],d=0,g=a.aoColumns.length;d<g;d++)for(var f=0;f<g;f++)if(a.aoColumns[d].sName==b[f]){c.push(f);break}return c}function L(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function za(a,b,c,d){var g,f,e;if(b)for(g=b.length-1;0<=g;g--){var l=b[g].aTargets;h.isArray(l)||I(a,
1,"aTargets must be an array of targets, not a "+typeof l);var n=0;for(f=l.length;n<f;n++)if("number"===typeof l[n]&&0<=l[n]){for(;a.aoColumns.length<=l[n];)r(a);d(l[n],b[g])}else if("number"===typeof l[n]&&0>l[n])d(a.aoColumns.length+l[n],b[g]);else if("string"===typeof l[n]){var k=0;for(e=a.aoColumns.length;k<e;k++)("_all"==l[n]||h(a.aoColumns[k].nTh).hasClass(l[n]))&&d(k,b[g])}}if(c)for(g=0,a=c.length;g<a;g++)d(g,c[g])}function y(a,b){var c=h.isArray(b)?b.slice():h.extend(!0,{},b);b=a.aoData.length;
var d=h.extend(!0,{},k.models.oRow);d._aData=c;a.aoData.push(d);d=0;for(var g=a.aoColumns.length;d<g;d++)if(c=a.aoColumns[d],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mDataProp?M(a,b,d,V(a,b,d)):M(a,b,d,z(a,b,d)),c._bAutoType&&"string"!=c.sType){var f=z(a,b,d,"type");null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string"))}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||ha(a,b);return b}function Aa(a){var b,c,d;if(a.bDeferLoading||null===
a.sAjaxSource){var g=a.nTBody.childNodes;var f=0;for(b=g.length;f<b;f++)if("TR"==g[f].nodeName.toUpperCase()){var e=a.aoData.length;g[f]._DT_RowIndex=e;a.aoData.push(h.extend(!0,{},k.models.oRow,{nTr:g[f]}));a.aiDisplayMaster.push(e);var l=g[f].childNodes;var n=d=0;for(c=l.length;n<c;n++){var w=l[n].nodeName.toUpperCase();if("TD"==w||"TH"==w)M(a,e,d,h.trim(l[n].innerHTML)),d++}}}g=W(a);l=[];f=0;for(b=g.length;f<b;f++)for(n=0,c=g[f].childNodes.length;n<c;n++)d=g[f].childNodes[n],w=d.nodeName.toUpperCase(),
"TD"!=w&&"TH"!=w||l.push(d);c=0;for(g=a.aoColumns.length;c<g;c++){w=a.aoColumns[c];null===w.sTitle&&(w.sTitle=w.nTh.innerHTML);d=w._bAutoType;e="function"===typeof w.fnRender;var r=null!==w.sClass,m=w.bVisible;if(d||e||r||!m)for(f=0,b=a.aoData.length;f<b;f++){n=a.aoData[f];var u=l[f*g+c];if(d&&"string"!=w.sType){var p=z(a,f,c,"type");""!==p&&(p=B(p),null===w.sType?w.sType=p:w.sType!=p&&"html"!=w.sType&&(w.sType="string"))}"function"===typeof w.mDataProp&&(u.innerHTML=z(a,f,c,"display"));e&&(p=V(a,
f,c),u.innerHTML=p,w.bUseRendered&&M(a,f,c,p));r&&(u.className+=" "+w.sClass);m?n._anHidden[c]=null:(n._anHidden[c]=u,u.parentNode.removeChild(u));w.fnCreatedCell&&w.fnCreatedCell.call(a.oInstance,u,z(a,f,c,"display"),n._aData,f,c)}}if(0!==a.aoRowCreatedCallback.length)for(f=0,b=a.aoData.length;f<b;f++)n=a.aoData[f],E(a,"aoRowCreatedCallback",null,[n.nTr,n._aData,f])}function N(a,b){return b._DT_RowIndex!==p?b._DT_RowIndex:null}function ia(a,b,c){b=O(a,b);var d=0;for(a=a.aoColumns.length;d<a;d++)if(b[d]===
c)return d;return-1}function aa(a,b,c){for(var d=[],g=0,f=a.aoColumns.length;g<f;g++)d.push(z(a,b,g,c));return d}function z(a,b,c,d){var g=a.aoColumns[c];if((c=g.fnGetData(a.aoData[b]._aData,d))===p)return a.iDrawError!=a.iDraw&&null===g.sDefaultContent&&(I(a,0,"Requested unknown parameter "+("function"==typeof g.mDataProp?"{mDataprop function}":"'"+g.mDataProp+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),g.sDefaultContent;if(null===c&&null!==g.sDefaultContent)c=g.sDefaultContent;
else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function M(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Z(a){if(null===a)return function(a,b){return null};if("function"===typeof a)return function(b,d){return a(b,d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a,d){d=0;for(var c=b.length;d<c;d++)if(a=a[b[d]],a===p)return p;return a}}return function(b,d){return b[a]}}function ya(a){if(null===a)return function(a,b){};if("function"===
typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a,d){for(var c=0,f=b.length-1;c<f;c++)if(a=a[b[c]],a===p)return;a[b[b.length-1]]=d}}return function(b,d){b[a]=d}}function ba(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ja(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);C(a)}function ka(a,b){for(var c=
-1,d=0,g=a.length;d<g;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function V(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mDataProp},z(a,b,c,"display"))}function ha(a,b){var c=a.aoData[b];if(null===c.nTr){c.nTr=q.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&h(c.nTr).addClass(c._aData.DT_RowClass);for(var d=0,g=a.aoColumns.length;d<g;d++){var f=a.aoColumns[d];
var e=q.createElement(f.sCellType);e.innerHTML="function"!==typeof f.fnRender||f.bUseRendered&&null!==f.mDataProp?z(a,b,d,"display"):V(a,b,d);null!==f.sClass&&(e.className=f.sClass);f.bVisible?(c.nTr.appendChild(e),c._anHidden[d]=null):c._anHidden[d]=e;f.fnCreatedCell&&f.fnCreatedCell.call(a.oInstance,e,z(a,b,d,"display"),c._aData,b,d)}E(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function Ba(a){var b;if(0!==a.nTHead.getElementsByTagName("th").length){var c=0;for(b=a.aoColumns.length;c<b;c++){var d=
a.aoColumns[c].nTh;d.setAttribute("role","columnheader");a.aoColumns[c].bSortable&&(d.setAttribute("tabindex",a.iTabIndex),d.setAttribute("aria-controls",a.sTableId));null!==a.aoColumns[c].sClass&&h(d).addClass(a.aoColumns[c].sClass);a.aoColumns[c].sTitle!=d.innerHTML&&(d.innerHTML=a.aoColumns[c].sTitle)}}else{var g=q.createElement("tr");c=0;for(b=a.aoColumns.length;c<b;c++)d=a.aoColumns[c].nTh,d.innerHTML=a.aoColumns[c].sTitle,d.setAttribute("tabindex","0"),null!==a.aoColumns[c].sClass&&h(d).addClass(a.aoColumns[c].sClass),
g.appendChild(d);h(a.nTHead).html("")[0].appendChild(g);X(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI)for(c=0,b=a.aoColumns.length;c<b;c++){d=a.aoColumns[c].nTh;g=q.createElement("div");g.className=a.oClasses.sSortJUIWrapper;h(d).contents().appendTo(g);var f=q.createElement("span");f.className=a.oClasses.sSortIcon;g.appendChild(f);d.appendChild(g)}if(a.oFeatures.bSort)for(c=0;c<a.aoColumns.length;c++)!1!==a.aoColumns[c].bSortable?la(a,a.aoColumns[c].nTh,c):h(a.aoColumns[c].nTh).addClass(a.oClasses.sSortableNone);
""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot)for(d=S(a,null,a.aoFooter),c=0,b=a.aoColumns.length;c<b;c++)d[c]&&(a.aoColumns[c].nTf=d[c],a.aoColumns[c].sClass&&h(d[c]).addClass(a.aoColumns[c].sClass))}function Y(a,b,c){var d,g,f=[],e=[],h=a.aoColumns.length;c===p&&(c=!1);var n=0;for(d=b.length;n<d;n++){f[n]=b[n].slice();f[n].nTr=b[n].nTr;for(g=h-1;0<=g;g--)a.aoColumns[g].bVisible||c||f[n].splice(g,1);e.push([])}n=0;for(d=f.length;n<
d;n++){if(a=f[n].nTr)for(;g=a.firstChild;)a.removeChild(g);g=0;for(b=f[n].length;g<b;g++){var k=h=1;if(e[n][g]===p){a.appendChild(f[n][g].cell);for(e[n][g]=1;f[n+h]!==p&&f[n][g].cell==f[n+h][g].cell;)e[n+h][g]=1,h++;for(;f[n][g+k]!==p&&f[n][g].cell==f[n][g+k].cell;){for(c=0;c<h;c++)e[n+c][g+k]=1;k++}f[n][g].cell.rowSpan=h;f[n][g].cell.colSpan=k}}}}function A(a){var b=[],c=0,d=a.asStripeClasses.length;var g=a.aoOpenRows.length;var f=E(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,f))J(a,
!1);else{a.bDrawing=!0;a.iInitDisplayStart!==p&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,C(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(!a.oFeatures.bServerSide)a.iDraw++;else if(!a.bDestroying&&!Ca(a))return;if(0!==a.aiDisplay.length){var e=a._iDisplayStart;f=a._iDisplayEnd;a.oFeatures.bServerSide&&(e=0,f=a.aoData.length);for(;e<f;e++){var l=a.aoData[a.aiDisplay[e]];
null===l.nTr&&ha(a,a.aiDisplay[e]);var n=l.nTr;if(0!==d){var k=a.asStripeClasses[c%d];l._sRowStripe!=k&&(h(n).removeClass(l._sRowStripe).addClass(k),l._sRowStripe=k)}E(a,"aoRowCallback",null,[n,a.aoData[a.aiDisplay[e]]._aData,c,e]);b.push(n);c++;if(0!==g)for(l=0;l<g;l++)if(n==a.aoOpenRows[l].nParent){b.push(a.aoOpenRows[l].nTr);break}}}else b[0]=q.createElement("tr"),a.asStripeClasses[0]&&(b[0].className=a.asStripeClasses[0]),g=a.oLanguage,d=g.sZeroRecords,1!=a.iDraw||null===a.sAjaxSource||a.oFeatures.bServerSide?
g.sEmptyTable&&0===a.fnRecordsTotal()&&(d=g.sEmptyTable):d=g.sLoadingRecords,g=q.createElement("td"),g.setAttribute("valign","top"),g.colSpan=H(a),g.className=a.oClasses.sRowEmpty,g.innerHTML=ma(a,d),b[c].appendChild(g);E(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],ba(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);E(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],ba(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);c=q.createDocumentFragment();g=q.createDocumentFragment();
if(a.nTBody){d=a.nTBody.parentNode;g.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;g=a.nTBody.firstChild;)a.nTBody.removeChild(g);g=0;for(f=b.length;g<f;g++)c.appendChild(b[g]);a.nTBody.appendChild(c);null!==d&&d.appendChild(a.nTBody)}E(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(J(a,!1),a._bInitComplete||ca(a))}}function da(a){a.oFeatures.bSort?T(a,a.oPreviousSearch):a.oFeatures.bFilter?P(a,a.oPreviousSearch):
(C(a),A(a))}function Da(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),g,f,e,l,n,w,r,m=0;m<d.length;m++){f=0;e=d[m];if("<"==e){l=h("<div></div>")[0];n=d[m+1];if("'"==n||'"'==n){w="";for(r=2;d[m+r]!=n;)w+=d[m+r],r++;"H"==w?w="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix":
"F"==w&&(w="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");-1!=w.indexOf(".")?(n=w.split("."),l.id=n[0].substr(1,n[0].length-1),l.className=n[1]):"#"==w.charAt(0)?l.id=w.substr(1,w.length-1):l.className=w;m+=r}c.appendChild(l);c=l}else if(">"==e)c=c.parentNode;else if("l"==e&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)g=Ea(a),f=1;else if("f"==e&&a.oFeatures.bFilter)g=Fa(a),f=1;else if("r"==e&&a.oFeatures.bProcessing)g=Ga(a),f=1;else if("t"==e)g=Ha(a),f=
1;else if("i"==e&&a.oFeatures.bInfo)g=Ia(a),f=1;else if("p"==e&&a.oFeatures.bPaginate)g=Ja(a),f=1;else if(0!==k.ext.aoFeatures.length)for(l=k.ext.aoFeatures,r=0,n=l.length;r<n;r++)if(e==l[r].cFeature){(g=l[r].fnInit(a))&&(f=1);break}1==f&&null!==g&&("object"!==typeof a.aanFeatures[e]&&(a.aanFeatures[e]=[]),a.aanFeatures[e].push(g),c.appendChild(g))}b.parentNode.replaceChild(a.nTableWrapper,b)}function X(a,b){b=h(b).children("tr");var c,d,g,f;a.splice(0,a.length);var e=0;for(g=b.length;e<g;e++)a.push([]);
e=0;for(g=b.length;e<g;e++){var l=0;for(f=b[e].childNodes.length;l<f;l++){var n=b[e].childNodes[l];if("TD"==n.nodeName.toUpperCase()||"TH"==n.nodeName.toUpperCase()){var k=1*n.getAttribute("colspan"),r=1*n.getAttribute("rowspan");k=k&&0!==k&&1!==k?k:1;r=r&&0!==r&&1!==r?r:1;for(c=0;a[e][c];)c++;var m=c;for(d=0;d<k;d++)for(c=0;c<r;c++)a[e+c][m+d]={cell:n,unique:1==k?!0:!1},a[e+c].nTr=b[e]}}}}function S(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],X(c,b)));b=0;for(var g=c.length;b<g;b++)for(var f=0,e=c[b].length;f<
e;f++)!c[b][f].unique||d[f]&&a.bSortCellsTop||(d[f]=c[b][f].cell);return d}function Ca(a){if(a.bAjaxDataGet){a.iDraw++;J(a,!0);var b=Ka(a);na(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){La(a,b)},a);return!1}return!0}function Ka(a){var b=a.aoColumns.length,c=[],d,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:L(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:!1!==a.oFeatures.bPaginate?
a._iDisplayLength:-1});for(d=0;d<b;d++){var f=a.aoColumns[d].mDataProp;c.push({name:"mDataProp_"+d,value:"function"===typeof f?"function":f})}if(!1!==a.oFeatures.bFilter)for(c.push({name:"sSearch",value:a.oPreviousSearch.sSearch}),c.push({name:"bRegex",value:a.oPreviousSearch.bRegex}),d=0;d<b;d++)c.push({name:"sSearch_"+d,value:a.aoPreSearchCols[d].sSearch}),c.push({name:"bRegex_"+d,value:a.aoPreSearchCols[d].bRegex}),c.push({name:"bSearchable_"+d,value:a.aoColumns[d].bSearchable});if(!1!==a.oFeatures.bSort){var e=
0;f=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(d=0;d<f.length;d++){var h=a.aoColumns[f[d][0]].aDataSort;for(g=0;g<h.length;g++)c.push({name:"iSortCol_"+e,value:h[g]}),c.push({name:"sSortDir_"+e,value:f[d][1]}),e++}c.push({name:"iSortingCols",value:e});for(d=0;d<b;d++)c.push({name:"bSortable_"+d,value:a.aoColumns[d].bSortable})}return c}function na(a,b){E(a,"aoServerParams","serverParams",[b])}function La(a,b){if(b.sEcho!==p){if(1*b.sEcho<a.iDraw)return;a.iDraw=
1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ja(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=L(a);c=b.sColumns!==p&&""!==c&&b.sColumns!=c;var d;c&&(d=F(a,b.sColumns));b=Z(a.sAjaxDataProp)(b);for(var g=0,f=b.length;g<f;g++)if(c){for(var e=[],h=0,n=a.aoColumns.length;h<n;h++)e.push(b[g][d[h]]);y(a,e)}else y(a,b[g]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;A(a);a.bAjaxDataGet=!0;J(a,!1)}
function Fa(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch;c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />';var d=q.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(c){c=a.aanFeatures.f;for(var d=""===this.value?"":this.value,
g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&P(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(13==a.keyCode)return!1});return d}function P(a,b,c){var d=a.oPreviousSearch,g=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);
else{Ma(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Na(a,g[b].sSearch,b,g[b].bRegex,g[b].bSmart,g[b].bCaseInsensitive);Oa(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;C(a);A(a);oa(a,0)}function Oa(a){for(var b=k.ext.afnFiltering,c=0,d=b.length;c<d;c++)for(var g=0,f=0,e=a.aiDisplay.length;f<e;f++){var h=a.aiDisplay[f-g];b[c](a,aa(a,h,"filter"),h)||(a.aiDisplay.splice(f-g,1),g++)}}function Na(a,b,c,d,g,f){if(""!==b){var e=
0;b=pa(b,d,g,f);for(d=a.aiDisplay.length-1;0<=d;d--)g=qa(z(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(g)||(a.aiDisplay.splice(d,1),e++)}}function Ma(a,b,c,d,g,f){d=pa(b,d,g,f);g=a.oPreviousSearch;c||(c=0);0!==k.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||g.sSearch.length>b.length||1==c||0!==b.indexOf(g.sSearch))for(a.aiDisplay.splice(0,a.aiDisplay.length),
oa(a,1),b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b]);else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function oa(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch.splice(0,a.asDataSearch.length);b=b&&1===b?a.aiDisplayMaster:a.aiDisplay;for(var c=0,d=b.length;c<d;c++)a.asDataSearch[c]=ra(a,aa(a,b[c],"filter"))}}function ra(a,b){var c="";a.__nTmpFilter===p&&(a.__nTmpFilter=q.createElement("div"));
for(var d=a.__nTmpFilter,g=0,f=a.aoColumns.length;g<f;g++)a.aoColumns[g].bSearchable&&(c+=qa(b[g],a.aoColumns[g].sType)+"  ");-1!==c.indexOf("&")&&(d.innerHTML=c,c=d.textContent?d.textContent:d.innerText,c=c.replace(/\n/g," ").replace(/\r/g,""));return c}function pa(a,b,c,d){if(c)return a=b?a.split(" "):sa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",new RegExp(a,d?"i":"");a=b?a:sa(a);return new RegExp(a,d?"i":"")}function qa(a,b){return"function"===typeof k.ext.ofnSearch[b]?k.ext.ofnSearch[b](a):
null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function sa(a){return a.replace(/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^)/g,"\\$1")}function Ia(a){var b=q.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Pa,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Pa(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=
a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),g=a.fnRecordsTotal(),f=a.fnRecordsDisplay();var e=0===f&&f==g?b.sInfoEmpty:0===f?b.sInfoEmpty+" "+b.sInfoFiltered:f==g?b.sInfo:b.sInfo+" "+b.sInfoFiltered;e+=b.sInfoPostFix;e=ma(a,e);null!==b.fnInfoCallback&&(e=b.fnInfoCallback.call(a.oInstance,a,c,d,g,f,e));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(e)}}function ma(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd();d=a.fnFormatNumber(d);var g=a.fnRecordsDisplay();
g=a.fnFormatNumber(g);var f=a.fnRecordsTotal();f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace("_START_",c).replace("_END_",d).replace("_TOTAL_",g).replace("_MAX_",f)}function ea(a){var b,c=a.iInitDisplayStart;if(!1===a.bInitialised)setTimeout(function(){ea(a)},200);else{Da(a);Ba(a);Y(a,a.aoHeader);a.nTFoot&&Y(a,a.aoFooter);J(a,!0);a.oFeatures.bAutoWidth&&fa(a);var d=0;for(b=a.aoColumns.length;d<b;d++)null!==a.aoColumns[d].sWidth&&(a.aoColumns[d].nTh.style.width=
v(a.aoColumns[d].sWidth));a.oFeatures.bSort?T(a):a.oFeatures.bFilter?P(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),C(a),A(a));null===a.sAjaxSource||a.oFeatures.bServerSide?a.oFeatures.bServerSide||(J(a,!1),ca(a)):(b=[],na(a,b),a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){var f=""!==a.sAjaxDataProp?Z(a.sAjaxDataProp)(b):b;for(d=0;d<f.length;d++)y(a,f[d]);a.iInitDisplayStart=c;a.oFeatures.bSort?T(a):(a.aiDisplay=a.aiDisplayMaster.slice(),C(a),A(a));J(a,!1);ca(a,b)},a))}}
function ca(a,b){a._bInitComplete=!0;E(a,"aoInitComplete","init",[a,b])}function ta(a){var b=k.defaults.oLanguage;!a.sEmptyTable&&a.sZeroRecords&&"No data available in table"===b.sEmptyTable&&t(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&a.sZeroRecords&&"Loading..."===b.sLoadingRecords&&t(a,a,"sZeroRecords","sLoadingRecords")}function Ea(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" name="'+(a.sTableId+'_length">'),c,d=a.aLengthMenu;if(2==d.length&&"object"===typeof d[0]&&
"object"===typeof d[1]){var g=0;for(c=d[0].length;g<c;g++)b+='<option value="'+d[0][g]+'">'+d[1][g]+"</option>"}else for(g=0,c=d.length;g<c;g++)b+='<option value="'+d[g]+'">'+d[g]+"</option>";b+="</select>";d=q.createElement("div");a.aanFeatures.l||(d.id=a.sTableId+"_length");d.className=a.oClasses.sLength;d.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',d).prop("selected",!0);h("select",d).bind("change.DT",function(b){b=
h(this).val();var d=a.aanFeatures.l;g=0;for(c=d.length;g<c;g++)d[g]!=this.parentNode&&h("select",d[g]).val(b);a._iDisplayLength=parseInt(b,10);C(a);a.fnDisplayEnd()==a.fnRecordsDisplay()&&(a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength,0>a._iDisplayStart&&(a._iDisplayStart=0));-1==a._iDisplayLength&&(a._iDisplayStart=0);A(a)});h("select",d).attr("aria-controls",a.sTableId);return d}function C(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||
-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Ja(a){if(a.oScroll.bInfinite)return null;var b=q.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;k.ext.oPagination[a.sPaginationType].fnInit(a,b,function(a){C(a);A(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){k.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){C(a);A(a)})},sName:"pagination"});return b}function ua(a,b){var c=a._iDisplayStart;"number"===typeof b?(a._iDisplayStart=
b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0)):"first"==b?a._iDisplayStart=0:"previous"==b?(a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=0)):"next"==b?0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0:"last"==b?0<=a._iDisplayLength?(b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1,a._iDisplayStart=(b-1)*
a._iDisplayLength):a._iDisplayStart=0:I(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Ga(a){var b=q.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function J(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,g=c.length;d<g;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",
[a,b])}function Ha(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=q.createElement("div"),c=q.createElement("div"),d=q.createElement("div"),g=q.createElement("div"),f=q.createElement("div"),e=q.createElement("div"),l=a.nTable.cloneNode(!1),n=a.nTable.cloneNode(!1),k=a.nTable.getElementsByTagName("thead")[0],r=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(e);g.appendChild(a.nTable);b.appendChild(c);
b.appendChild(g);d.appendChild(l);l.appendChild(k);null!==r&&(b.appendChild(f),e.appendChild(n),n.appendChild(r));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner;g.className=m.sScrollBody;f.className=m.sScrollFoot;e.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",g.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?
a.oScroll.sXInner:"100%";l.removeAttribute("id");l.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==r&&(n.removeAttribute("id"),n.style.marginLeft="0");d=h(a.nTable).children("caption");0<d.length&&(d=d[0],"top"===d._captionSide?l.appendChild(d):"bottom"===d._captionSide&&r&&n.appendChild(d));""!==a.oScroll.sX&&(c.style.width=v(a.oScroll.sX),g.style.width=v(a.oScroll.sX),null!==r&&(f.style.width=v(a.oScroll.sX)),h(g).scroll(function(a){c.scrollLeft=this.scrollLeft;null!==r&&(f.scrollLeft=
this.scrollLeft)}));""!==a.oScroll.sY&&(g.style.height=v(a.oScroll.sY));a.aoDrawCallback.push({fn:Qa,sName:"scrolling"});a.oScroll.bInfinite&&h(g).scroll(function(){!a.bDrawing&&0!==h(this).scrollTop()&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()&&(ua(a,"next"),C(a),A(a))});a.nScrollHead=c;a.nScrollFoot=f;return b}function Qa(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,
g,f,e,l=[],n=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,k=null!==a.nTFoot?n.getElementsByTagName("table")[0]:null;h(a.nTable).children("thead, tfoot").remove();var r=h(a.nTHead).clone()[0];a.nTable.insertBefore(r,a.nTable.childNodes[0]);if(null!==a.nTFoot){var m=h(a.nTFoot).clone()[0];a.nTable.insertBefore(m,a.nTable.childNodes[1])}""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width="100%");var u=S(a,r);var p=0;for(g=u.length;p<g;p++){var t=K(a,p);u[p].style.width=
a.aoColumns[t].sWidth}null!==a.nTFoot&&Q(function(a){a.style.width=""},m.getElementsByTagName("tr"));a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");p=h(a.nTable).outerWidth();""===a.oScroll.sX?a.nTable.style.width="100%":""!==a.oScroll.sXInner?a.nTable.style.width=v(a.oScroll.sXInner):p==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=v(p-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>p-a.oScroll.iBarWidth&&(a.nTable.style.width=
v(p))):a.nTable.style.width=v(p);p=h(a.nTable).outerWidth();g=a.nTHead.getElementsByTagName("tr");r=r.getElementsByTagName("tr");Q(function(a,b){f=a.style;f.paddingTop="0";f.paddingBottom="0";f.borderTopWidth="0";f.borderBottomWidth="0";f.height=0;e=h(a).width();b.style.width=v(e);l.push(e)},r,g);h(r).height(0);if(null!==a.nTFoot){var q=m.getElementsByTagName("tr");m=a.nTFoot.getElementsByTagName("tr");Q(function(a,b){f=a.style;f.paddingTop="0";f.paddingBottom="0";f.borderTopWidth="0";f.borderBottomWidth=
"0";f.height=0;e=h(a).width();b.style.width=v(e);l.push(e)},q,m);h(q).height(0)}Q(function(a){a.innerHTML="";a.style.width=v(l.shift())},r);null!==a.nTFoot&&Q(function(a){a.innerHTML="";a.style.width=v(l.shift())},q);h(a.nTable).outerWidth()<p?(q=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?p+a.oScroll.iBarWidth:p,d.style.width=v(q),b.parentNode.style.width=v(q),null!==a.nTFoot&&(n.parentNode.style.width=v(q)),""===a.oScroll.sX?I(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):
""!==a.oScroll.sXInner&&I(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")):(d.style.width=v("100%"),b.parentNode.style.width=v("100%"),null!==a.nTFoot&&(n.parentNode.style.width=v("100%")));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=v(a.oScroll.sY),q=""!==a.oScroll.sX&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=
v(a.nTable.offsetHeight+q)));q=h(a.nTable).outerWidth();c.style.width=v(q);b.style.width=v(q);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(k.style.width=v(q),n.style.width=v(q),n.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function Q(a,b,c){for(var d=0,g=b.length;d<g;d++)for(var f=0,e=b[d].childNodes.length;f<e;f++)1==b[d].childNodes[f].nodeType&&
(c?a(b[d].childNodes[f],c[d].childNodes[f]):a(b[d].childNodes[f]))}function Ra(a,b){if(!a||null===a||""===a)return 0;b||(b=q.getElementsByTagName("body")[0]);var c=q.createElement("div");c.style.width=v(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function fa(a){var b=0,c=0,d=a.aoColumns.length,g,f=h("th",a.nTHead),e=a.nTable.getAttribute("width");for(g=0;g<d;g++)if(a.aoColumns[g].bVisible&&(c++,null!==a.aoColumns[g].sWidth)){var l=Ra(a.aoColumns[g].sWidthOrig,a.nTable.parentNode);
null!==l&&(a.aoColumns[g].sWidth=v(l));b++}if(d==f.length&&0===b&&c==d&&""===a.oScroll.sX&&""===a.oScroll.sY)for(g=0;g<a.aoColumns.length;g++)l=h(f[g]).width(),null!==l&&(a.aoColumns[g].sWidth=v(l));else{b=a.nTable.cloneNode(!1);g=a.nTHead.cloneNode(!0);c=q.createElement("tbody");l=q.createElement("tr");b.removeAttribute("id");b.appendChild(g);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),Q(function(a){a.style.width=""},b.getElementsByTagName("tr")));b.appendChild(c);c.appendChild(l);c=
h("thead th",b);0===c.length&&(c=h("tbody tr:eq(0)>td",b));f=S(a,g);for(g=c=0;g<d;g++){var n=a.aoColumns[g];n.bVisible&&null!==n.sWidthOrig&&""!==n.sWidthOrig?f[g-c].style.width=v(n.sWidthOrig):n.bVisible?f[g-c].style.width="":c++}for(g=0;g<d;g++)a.aoColumns[g].bVisible&&(c=Sa(a,g),null!==c&&(c=c.cloneNode(!0),""!==a.aoColumns[g].sContentPadding&&(c.innerHTML+=a.aoColumns[g].sContentPadding),l.appendChild(c)));d=a.nTable.parentNode;d.appendChild(b);""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=
v(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<d.offsetWidth&&(b.style.width=v(d.offsetWidth))):""!==a.oScroll.sY?b.style.width=v(d.offsetWidth):e&&(b.style.width=v(e));b.style.visibility="hidden";Ta(a,b);d=h("tbody tr:eq(0)",b).children();0===d.length&&(d=S(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(g=c=l=0;g<a.aoColumns.length;g++)a.aoColumns[g].bVisible&&(l=null===a.aoColumns[g].sWidthOrig?l+h(d[c]).outerWidth():l+(parseInt(a.aoColumns[g].sWidth.replace("px",""),10)+(h(d[c]).outerWidth()-
h(d[c]).width())),c++);b.style.width=v(l);a.nTable.style.width=v(l)}for(g=c=0;g<a.aoColumns.length;g++)a.aoColumns[g].bVisible&&(l=h(d[c]).width(),null!==l&&0<l&&(a.aoColumns[g].sWidth=v(l)),c++);d=h(b).css("width");a.nTable.style.width=-1!==d.indexOf("%")?d:v(h(b).outerWidth());b.parentNode.removeChild(b)}e&&(a.nTable.style.width=v(e))}function Ta(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=v(h(b).outerWidth()-a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=v(h(b).outerWidth()))}
function Sa(a,b){var c=Ua(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=q.createElement("td");d.innerHTML=z(a,c,b,"");return d}return O(a,c)[b]}function Ua(a,b){for(var c=-1,d=-1,g=0;g<a.aoData.length;g++){var f=z(a,g,b,"display")+"";f=f.replace(/<.*?>/g,"");f.length>c&&(c=f.length,d=g)}return d}function v(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);return 48>b||57<b?a:a+"px"}function Va(){var a=q.createElement("p"),b=a.style;
b.width="100%";b.height="200px";b.padding="0px";var c=q.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);q.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);q.body.removeChild(c);return b-a}function T(a,b){var c,d,g=[],f=[],e=k.ext.oSort,l=a.aoData,n=a.aoColumns,r=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&
(0!==a.aaSorting.length||null!==a.aaSortingFixed)){g=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<g.length;c++){var m=g[c][0];var u=G(a,m);var q=a.aoColumns[m].sSortDataType;if(k.ext.afnSortData[q]){var t=k.ext.afnSortData[q].call(a.oInstance,a,m,u);if(t.length===l.length)for(u=0,q=l.length;u<q;u++)M(a,u,m,t[u]);else I(a,0,"Returned data sort array (col "+m+") is the wrong length")}}c=0;for(m=a.aiDisplayMaster.length;c<m;c++)f[a.aiDisplayMaster[c]]=c;
var v=g.length;c=0;for(m=l.length;c<m;c++)for(u=0;u<v;u++){var K=n[g[u][0]].aDataSort;t=0;for(d=K.length;t<d;t++)q=n[K[t]].sType,q=e[(q?q:"string")+"-pre"],l[c]._aSortData[K[t]]=q?q(z(a,c,K[t],"sort")):z(a,c,K[t],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d;for(c=0;c<v;c++){var h=n[g[c][0]].aDataSort;var k=0;for(d=h.length;k<d;k++){var r=n[h[k]].sType;r=e[(r?r:"string")+"-"+g[c][1]](l[a]._aSortData[h[k]],l[b]._aSortData[h[k]]);if(0!==r)return r}}return e["numeric-asc"](f[a],f[b])})}b!==p&&
!b||a.oFeatures.bDeferRender||U(a);c=0;for(m=a.aoColumns.length;c<m;c++)u=n[c].sTitle.replace(/<.*?>/g,""),b=n[c].nTh,b.removeAttribute("aria-sort"),b.removeAttribute("aria-label"),n[c].bSortable?0<g.length&&g[0][0]==c?(b.setAttribute("aria-sort","asc"==g[0][1]?"ascending":"descending"),b.setAttribute("aria-label",u+("asc"==(n[c].asSorting[g[0][2]+1]?n[c].asSorting[g[0][2]+1]:n[c].asSorting[0])?r.sSortAscending:r.sSortDescending))):b.setAttribute("aria-label",u+("asc"==n[c].asSorting[0]?r.sSortAscending:
r.sSortDescending)):b.setAttribute("aria-label",u);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?P(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,C(a),A(a))}function la(a,b,c,d){Wa(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var f=function(){if(b.shiftKey){for(var d=!1,f=0;f<a.aaSorting.length;f++)if(a.aaSorting[f][0]==c){d=!0;var g=a.aaSorting[f][0];var e=a.aaSorting[f][2]+1;a.aoColumns[g].asSorting[e]?(a.aaSorting[f][1]=a.aoColumns[g].asSorting[e],
a.aaSorting[f][2]=e):a.aaSorting.splice(f,1);break}!1===d&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(g=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[g].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[g].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));T(a)};a.oFeatures.bProcessing?(J(a,!0),setTimeout(function(){f();a.oFeatures.bServerSide||J(a,!1)},0)):
f();"function"==typeof d&&d(a)}})}function U(a){var b,c,d=a.aoColumns.length,g=a.oClasses;for(b=0;b<d;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(g.sSortAsc+" "+g.sSortDesc+" "+a.aoColumns[b].sSortingClass);var f=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){var e=a.aoColumns[b].sSortingClass;var l=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){e="asc"==f[c][1]?g.sSortAsc:g.sSortDesc;l=c;
break}h(a.aoColumns[b].nTh).addClass(e);a.bJUI&&(c=h("span."+g.sSortIcon,a.aoColumns[b].nTh),c.removeClass(g.sSortJUIAsc+" "+g.sSortJUIDesc+" "+g.sSortJUI+" "+g.sSortJUIAscAllowed+" "+g.sSortJUIDescAllowed),c.addClass(-1==l?a.aoColumns[b].sSortingClassJUI:"asc"==f[l][1]?g.sSortJUIAsc:g.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);e=g.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){l=O(a);if(a.oFeatures.bDeferRender)h(l).removeClass(e+"1 "+e+"2 "+e+"3");
else if(l.length>=d)for(b=0;b<d;b++)if(-1!=l[b].className.indexOf(e+"1"))for(c=0,a=l.length/d;c<a;c++)l[d*c+b].className=h.trim(l[d*c+b].className.replace(e+"1",""));else if(-1!=l[b].className.indexOf(e+"2"))for(c=0,a=l.length/d;c<a;c++)l[d*c+b].className=h.trim(l[d*c+b].className.replace(e+"2",""));else if(-1!=l[b].className.indexOf(e+"3"))for(c=0,a=l.length/d;c<a;c++)l[d*c+b].className=h.trim(l[d*c+b].className.replace(" "+e+"3",""));g=1;for(b=0;b<f.length;b++){var k=parseInt(f[b][0],10);c=0;for(a=
l.length/d;c<a;c++)l[d*c+k].className+=" "+e+g;3>g&&g++}}}function va(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b;var c=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:c?0:a._iDisplayStart,iEnd:c?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};c=0;for(b=a.aoColumns.length;c<b;c++)d.abVisCols.push(a.aoColumns[c].bVisible);E(a,
"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Xa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=E(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,
a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];E(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function Ya(a){var b=R.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=q.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null}
function x(a){for(var b=0;b<k.settings.length;b++)if(k.settings[b].nTable===a)return k.settings[b];return null}function W(a){var b=[];a=a.aoData;for(var c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function O(a,b){var c=[],d;var g=0;var f=a.aoData.length;b!==p&&(g=b,f=b+1);for(;g<f;g++){var e=a.aoData[g];if(null!==e.nTr){b=[];var h=0;for(d=e.nTr.childNodes.length;h<d;h++){var k=e.nTr.childNodes[h].nodeName.toLowerCase();"td"!=k&&"th"!=k||b.push(e.nTr.childNodes[h])}h=k=0;for(d=
a.aoColumns.length;h<d;h++)a.aoColumns[h].bVisible?c.push(b[h-k]):(c.push(e._anHidden[h]),k++)}}return c}function I(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(0===b)if("alert"==k.ext.sErrMode)alert(a);else throw Error(a);else R.console&&console.log&&console.log(a)}function t(a,b,c,d){d===p&&(d=c);b[c]!==p&&(a[d]=b[c])}function Za(a,b){for(var c in b)b.hasOwnProperty(c)&&("object"===typeof e[c]&&!1===h.isArray(b[c])?h.extend(!0,a[c],b[c]):a[c]=
b[c]);return a}function Wa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}function D(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function E(a,b,c,d){b=a[b];for(var g=[],f=b.length-1;0<=f;f--)g.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return g}function $a(a){return function(){var b=[x(this[k.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return k.ext.oApi[a].apply(this,
b)}}var ab=R.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d=[],g=h.isArray(a);for(c in a){var f=a[c];b=typeof f;"string"===b?f='"'+f+'"':"object"===b&&null!==f&&(f=ab(f));d.push((g?"":'"'+c+'":')+f)}return(g?"[":"{")+d+(g?"]":"}")};this.$=function(a,b){var c,d=[],g=x(this[k.ext.iApiIndex]);b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page)for(b=g._iDisplayStart,c=g.fnDisplayEnd();b<c;b++)d.push(g.aoData[g.aiDisplay[b]].nTr);
else if("current"==b.order&&"none"==b.filter)for(b=0,c=g.aiDisplayMaster.length;b<c;b++)d.push(g.aoData[g.aiDisplayMaster[b]].nTr);else if("current"==b.order&&"applied"==b.filter)for(b=0,c=g.aiDisplay.length;b<c;b++)d.push(g.aoData[g.aiDisplay[b]].nTr);else if("original"==b.order&&"none"==b.filter)for(b=0,c=g.aoData.length;b<c;b++)d.push(g.aoData[b].nTr);else if("original"==b.order&&"applied"==b.filter)for(b=0,c=g.aoData.length;b<c;b++)-1!==h.inArray(b,g.aiDisplay)&&d.push(g.aoData[b].nTr);else I(g,
1,"Unknown selection options");g=h(d);d=g.filter(a);a=g.find(a);return h([].concat(h.makeArray(d),h.makeArray(a)))};this._=function(a,b){var c=[],d=this.$(a,b);a=0;for(b=d.length;a<b;a++)c.push(this.fnGetData(d[a]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],d=x(this[k.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var g=0;g<a.length;g++){var f=y(d,a[g]);if(-1==f)return c;c.push(f)}else{f=y(d,a);if(-1==f)return c;c.push(f)}d.aiDisplay=d.aiDisplayMaster.slice();
(b===p||b)&&da(d);return c};this.fnAdjustColumnSizing=function(a){var b=x(this[k.ext.iApiIndex]);m(b);a===p||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=x(this[k.ext.iApiIndex]);ja(b);(a===p||a)&&A(b)};this.fnClose=function(a){for(var b=x(this[k.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),
0;return 1};this.fnDeleteRow=function(a,b,c){var d=x(this[k.ext.iApiIndex]),g;a="object"===typeof a?N(d,a):a;var f=d.aoData.splice(a,1);var e=0;for(g=d.aoData.length;e<g;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ka(d.aiDisplayMaster,a);ka(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,f);d._iDisplayStart>=d.aiDisplay.length&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===p||c)C(d),
A(d);return f};this.fnDestroy=function(a){var b=x(this[k.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,g;a=a===p?!1:!0;b.bDestroying=!0;E(b,"aoDestroyCallback","destroy",[b]);var f=0;for(g=b.aoColumns.length;f<g;f++)!1===b.aoColumns[f].bVisible&&this.fnSetColumnVis(f,!0);h(b.nTableWrapper).find("*").addBack().unbind(".DT");h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));
b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];U(b);h(W(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),
h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);f=0;for(g=b.aoData.length;f<g;f++)null!==b.aoData[f].nTr&&d.appendChild(b.aoData[f].nTr);!0===b.oFeatures.bAutoWidth&&(b.nTable.style.width=v(b.sDestroyWidth));h(d).children("tr:even").addClass(b.asDestroyStripes[0]);h(d).children("tr:odd").addClass(b.asDestroyStripes[1]);
f=0;for(g=k.settings.length;f<g;f++)k.settings[f]==b&&k.settings.splice(f,1);b=null};this.fnDraw=function(a){var b=x(this[k.ext.iApiIndex]);!1===a?(C(b),A(b)):da(b)};this.fnFilter=function(a,b,c,d,g,f){var e=x(this[k.ext.iApiIndex]);if(e.oFeatures.bFilter){if(c===p||null===c)c=!1;if(d===p||null===d)d=!0;if(g===p||null===g)g=!0;if(f===p||null===f)f=!0;if(b===p||null===b){if(P(e,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),g&&e.aanFeatures.f)for(b=e.aanFeatures.f,c=0,d=b.length;c<d;c++)h(b[c]._DT_Input).val(a)}else h.extend(e.aoPreSearchCols[b],
{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),P(e,e.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=x(this[k.ext.iApiIndex]);if(a!==p){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();"tr"===e?d=N(c,a):"td"===e&&(d=N(c,a.parentNode),b=ia(c,d,a))}return b!==p?z(c,d,b,""):c.aoData[d]!==p?c.aoData[d]._aData:null}return ba(c)};this.fnGetNodes=function(a){var b=x(this[k.ext.iApiIndex]);return a!==p?b.aoData[a]!==p?b.aoData[a].nTr:null:W(b)};this.fnGetPosition=function(a){var b=
x(this[k.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?N(b,a):"TD"==c||"TH"==c?(c=N(b,a.parentNode),a=ia(b,c,a),[c,G(b,a),a]):null};this.fnIsOpen=function(a){for(var b=x(this[k.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=x(this[k.ext.iApiIndex]),e=W(d);if(-1!==h.inArray(a,e)){this.fnClose(a);e=q.createElement("tr");var f=q.createElement("td");e.appendChild(f);f.className=c;f.colSpan=H(d);"string"===typeof b?
f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=x(this[k.ext.iApiIndex]);ua(c,a);C(c);(b===p||b)&&A(c)};this.fnSetColumnVis=function(a,b,c){var d=x(this[k.ext.iApiIndex]),e,f,h=d.aoColumns,l=d.aoData;if(h[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)h[e].bVisible&&f++;var n=f>=H(d);if(!n)for(e=a;e<h.length;e++)if(h[e].bVisible){var r=e;break}e=0;for(f=l.length;e<f;e++)null!==l[e].nTr&&
(n?l[e].nTr.appendChild(l[e]._anHidden[a]):l[e].nTr.insertBefore(l[e]._anHidden[a],O(d,e)[r]))}else for(e=0,f=l.length;e<f;e++)null!==l[e].nTr&&(r=O(d,e)[a],l[e]._anHidden[a]=r,r.parentNode.removeChild(r));h[a].bVisible=b;Y(d,d.aoHeader);d.nTFoot&&Y(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=H(d);if(c===p||c)m(d),A(d);va(d)}};this.fnSettings=function(){return x(this[k.ext.iApiIndex])};this.fnSort=function(a){var b=x(this[k.ext.iApiIndex]);b.aaSorting=a;T(b)};this.fnSortListener=
function(a,b,c){la(x(this[k.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=x(this[k.ext.iApiIndex]);b="object"===typeof b?N(f,b):b;if(f.__fnUpdateDeep===p&&h.isArray(a)&&"object"===typeof a){f.aoData[b]._aData=a.slice();f.__fnUpdateDeep=!0;for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(z(f,b,c),b,c,!1,!1);f.__fnUpdateDeep=p}else if(f.__fnUpdateDeep===p&&null!==a&&"object"===typeof a){f.aoData[b]._aData=h.extend(!0,{},a);f.__fnUpdateDeep=!0;for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(z(f,
b,c),b,c,!1,!1);f.__fnUpdateDeep=p}else{M(f,b,c,a);a=z(f,b,c,"display");var g=f.aoColumns[c];null!==g.fnRender&&(a=V(f,b,c),g.bUseRendered&&M(f,b,c,a));null!==f.aoData[b].nTr&&(O(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=ra(f,aa(f,b,"filter"));(e===p||e)&&m(f);(d===p||d)&&da(f);return 0};this.fnVersionCheck=k.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:$a,_fnInitialise:ea,_fnInitComplete:ca,_fnLanguageCompat:ta,_fnAddColumn:r,_fnColumnOptions:u,_fnAddData:y,_fnCreateTr:ha,
_fnGatherData:Aa,_fnBuildHead:Ba,_fnDrawHead:Y,_fnDraw:A,_fnReDraw:da,_fnAjaxUpdate:Ca,_fnAjaxParameters:Ka,_fnAjaxUpdateDraw:La,_fnServerParams:na,_fnAddOptionsHtml:Da,_fnFeatureHtmlTable:Ha,_fnScrollDraw:Qa,_fnAdjustColumnSizing:m,_fnFeatureHtmlFilter:Fa,_fnFilterComplete:P,_fnFilterCustom:Oa,_fnFilterColumn:Na,_fnFilter:Ma,_fnBuildSearchArray:oa,_fnBuildSearchRow:ra,_fnFilterCreateSearch:pa,_fnDataToSearch:qa,_fnSort:T,_fnSortAttachListener:la,_fnSortingClasses:U,_fnFeatureHtmlPaginate:Ja,_fnPageChange:ua,
_fnFeatureHtmlInfo:Ia,_fnUpdateInfo:Pa,_fnFeatureHtmlLength:Ea,_fnFeatureHtmlProcessing:Ga,_fnProcessingDisplay:J,_fnVisibleToColumnIndex:K,_fnColumnIndexToVisible:G,_fnNodeToDataIndex:N,_fnVisbleColumns:H,_fnCalculateEnd:C,_fnConvertToWidth:Ra,_fnCalculateColumnWidths:fa,_fnScrollingWidthAdjust:Ta,_fnGetWidestNode:Sa,_fnGetMaxLenString:Ua,_fnStringToCss:v,_fnDetectType:B,_fnSettingsFromNode:x,_fnGetDataMaster:ba,_fnGetTrNodes:W,_fnGetTdNodes:O,_fnEscapeRegex:sa,_fnDeleteIndex:ka,_fnReOrderIndex:F,
_fnColumnOrdering:L,_fnLog:I,_fnClearTable:ja,_fnSaveState:va,_fnLoadState:Xa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);c=R.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();if(null!==e){var g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")");b=e(a,g,f.toGMTString(),c.join("/")+"/")}else b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";e="";f=9999999999999;if(4096<(null!==Ya(a)?q.cookie.length:
b.length+q.cookie.length)+10){a=q.cookie.split(";");for(var k=0,r=a.length;k<r;k++)if(-1!=a[k].indexOf(d)){var m=a[k].split("=");try{g=eval("("+decodeURIComponent(m[1])+")")}catch(bb){continue}g.iCreate&&g.iCreate<f&&(e=m[0],f=g.iCreate)}""!==e&&(q.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/")}q.cookie=b},_fnReadCookie:Ya,_fnDetectHeader:X,_fnGetUniqueThs:S,_fnScrollBarWidth:Va,_fnApplyToChildren:Q,_fnMap:t,_fnGetRowData:aa,_fnGetCellData:z,_fnSetCellData:M,_fnGetObjectDataFn:Z,
_fnSetObjectDataFn:ya,_fnApplyColumnDefs:za,_fnBindAction:Wa,_fnExtend:Za,_fnCallbackReg:D,_fnCallbackFire:E,_fnJsonString:ab,_fnRender:V,_fnNodeToColumnIndex:ia,_fnInfoMacros:ma};h.extend(k.ext.oApi,this.oApi);for(var wa in k.ext.oApi)wa&&(this[wa]=$a(wa));var xa=this;return this.each(function(){var a=0,b;var c=this.getAttribute("id");var d=!1,g=!1;if("table"!=this.nodeName.toLowerCase())I(null,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{a=0;for(b=
k.settings.length;a<b;a++){if(k.settings[a].nTable==this){if(e===p||e.bRetrieve)return k.settings[a].oInstance;if(e.bDestroy){k.settings[a].oInstance.fnDestroy();break}else{I(k.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(k.settings[a].sTableId==this.id){k.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+k.ext._oExternConfig.iNextUnique++;var f=
h.extend(!0,{},k.models.oSettings,{nTable:this,oApi:xa.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});k.settings.push(f);f.oInstance=1===xa.length?xa:h(this).dataTable();e||(e={});e.oLanguage&&ta(e.oLanguage);e=Za(h.extend(!0,{},k.defaults),e);t(f.oFeatures,e,"bPaginate");t(f.oFeatures,e,"bLengthChange");t(f.oFeatures,e,"bFilter");t(f.oFeatures,e,"bSort");t(f.oFeatures,e,"bInfo");t(f.oFeatures,e,"bProcessing");t(f.oFeatures,e,"bAutoWidth");t(f.oFeatures,e,"bSortClasses");t(f.oFeatures,
e,"bServerSide");t(f.oFeatures,e,"bDeferRender");t(f.oScroll,e,"sScrollX","sX");t(f.oScroll,e,"sScrollXInner","sXInner");t(f.oScroll,e,"sScrollY","sY");t(f.oScroll,e,"bScrollCollapse","bCollapse");t(f.oScroll,e,"bScrollInfinite","bInfinite");t(f.oScroll,e,"iScrollLoadGap","iLoadGap");t(f.oScroll,e,"bScrollAutoCss","bAutoCss");t(f,e,"asStripeClasses");t(f,e,"asStripClasses","asStripeClasses");t(f,e,"fnServerData");t(f,e,"fnFormatNumber");t(f,e,"sServerMethod");t(f,e,"aaSorting");t(f,e,"aaSortingFixed");
t(f,e,"aLengthMenu");t(f,e,"sPaginationType");t(f,e,"sAjaxSource");t(f,e,"sAjaxDataProp");t(f,e,"iCookieDuration");t(f,e,"sCookiePrefix");t(f,e,"sDom");t(f,e,"bSortCellsTop");t(f,e,"iTabIndex");t(f,e,"oSearch","oPreviousSearch");t(f,e,"aoSearchCols","aoPreSearchCols");t(f,e,"iDisplayLength","_iDisplayLength");t(f,e,"bJQueryUI","bJUI");t(f,e,"fnCookieCallback");t(f,e,"fnStateLoad");t(f,e,"fnStateSave");t(f.oLanguage,e,"fnInfoCallback");D(f,"aoDrawCallback",e.fnDrawCallback,"user");D(f,"aoServerParams",
e.fnServerParams,"user");D(f,"aoStateSaveParams",e.fnStateSaveParams,"user");D(f,"aoStateLoadParams",e.fnStateLoadParams,"user");D(f,"aoStateLoaded",e.fnStateLoaded,"user");D(f,"aoRowCallback",e.fnRowCallback,"user");D(f,"aoRowCreatedCallback",e.fnCreatedRow,"user");D(f,"aoHeaderCallback",e.fnHeaderCallback,"user");D(f,"aoFooterCallback",e.fnFooterCallback,"user");D(f,"aoInitComplete",e.fnInitComplete,"user");D(f,"aoPreDrawCallback",e.fnPreDrawCallback,"user");f.oFeatures.bServerSide&&f.oFeatures.bSort&&
f.oFeatures.bSortClasses?D(f,"aoDrawCallback",U,"server_side_sort_classes"):f.oFeatures.bDeferRender&&D(f,"aoDrawCallback",U,"defer_sort_classes");e.bJQueryUI?(h.extend(f.oClasses,k.ext.oJUIClasses),e.sDom===k.defaults.sDom&&"lfrtip"===k.defaults.sDom&&(f.sDom='<"H"lfr>t<"F"ip>')):h.extend(f.oClasses,k.ext.oStdClasses);h(this).addClass(f.oClasses.sTable);if(""!==f.oScroll.sX||""!==f.oScroll.sY)f.oScroll.iBarWidth=Va();f.iInitDisplayStart===p&&(f.iInitDisplayStart=e.iDisplayStart,f._iDisplayStart=
e.iDisplayStart);e.bStateSave&&(f.oFeatures.bStateSave=!0,Xa(f,e),D(f,"aoDrawCallback",va,"state_save"));null!==e.iDeferLoading&&(f.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),f._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,f._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(g=!0);""!==e.oLanguage.sUrl?(f.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(f.oLanguage.sUrl,null,function(a){ta(a);h.extend(!0,f.oLanguage,e.oLanguage,a);ea(f)}),d=!0):h.extend(!0,f.oLanguage,e.oLanguage);
null===e.asStripeClasses&&(f.asStripeClasses=[f.oClasses.sStripeOdd,f.oClasses.sStripeEven]);c=!1;var m=h(this).children("tbody").children("tr");a=0;for(b=f.asStripeClasses.length;a<b;a++)if(m.filter(":lt(2)").hasClass(f.asStripeClasses[a])){c=!0;break}c&&(f.asDestroyStripes=["",""],h(m[0]).hasClass(f.oClasses.sStripeOdd)&&(f.asDestroyStripes[0]+=f.oClasses.sStripeOdd+" "),h(m[0]).hasClass(f.oClasses.sStripeEven)&&(f.asDestroyStripes[0]+=f.oClasses.sStripeEven),h(m[1]).hasClass(f.oClasses.sStripeOdd)&&
(f.asDestroyStripes[1]+=f.oClasses.sStripeOdd+" "),h(m[1]).hasClass(f.oClasses.sStripeEven)&&(f.asDestroyStripes[1]+=f.oClasses.sStripeEven),m.removeClass(f.asStripeClasses.join(" ")));c=[];a=this.getElementsByTagName("thead");0!==a.length&&(X(f.aoHeader,a[0]),c=S(f));if(null===e.aoColumns)for(m=[],a=0,b=c.length;a<b;a++)m.push(null);else m=e.aoColumns;a=0;for(b=m.length;a<b;a++)e.saved_aoColumns!==p&&e.saved_aoColumns.length==b&&(null===m[a]&&(m[a]={}),m[a].bVisible=e.saved_aoColumns[a].bVisible),
r(f,c?c[a]:null);za(f,e.aoColumnDefs,m,function(a,b){u(f,a,b)});a=0;for(b=f.aaSorting.length;a<b;a++){f.aaSorting[a][0]>=f.aoColumns.length&&(f.aaSorting[a][0]=0);var l=f.aoColumns[f.aaSorting[a][0]];f.aaSorting[a][2]===p&&(f.aaSorting[a][2]=0);e.aaSorting===p&&f.saved_aaSorting===p&&(f.aaSorting[a][1]=l.asSorting[0]);c=0;for(m=l.asSorting.length;c<m;c++)if(f.aaSorting[a][1]==l.asSorting[c]){f.aaSorting[a][2]=c;break}}U(f);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});
b=h(this).children("thead");0===b.length&&(b=[q.createElement("thead")],this.appendChild(b[0]));f.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[q.createElement("tbody")],this.appendChild(b[0]));f.nTBody=b[0];f.nTBody.setAttribute("role","alert");f.nTBody.setAttribute("aria-live","polite");f.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");0===b.length&&0<a.length&&(""!==f.oScroll.sX||""!==f.oScroll.sY)&&(b=[q.createElement("tfoot")],this.appendChild(b[0]));0<b.length&&
(f.nTFoot=b[0],X(f.aoFooter,f.nTFoot));if(g)for(a=0;a<e.aaData.length;a++)y(f,e.aaData[a]);else Aa(f);f.aiDisplay=f.aiDisplayMaster.slice();f.bInitialised=!0;!1===d&&ea(f)}})};k.fnVersionCheck=function(e){var h=function(e,h){for(;e.length<h;)e+="0";return e},u=k.ext.sVersion.split(".");e=e.split(".");for(var m="",p="",q=0,H=e.length;q<H;q++)m+=h(u[q],3),p+=h(e[q],3);return parseInt(m,10)>=parseInt(p,10)};k.fnIsDataTable=function(e){for(var h=k.settings,u=0;u<h.length;u++)if(h[u].nTable===e||h[u].nScrollHead===
e||h[u].nScrollFoot===e)return!0;return!1};k.fnTables=function(e){var r=[];jQuery.each(k.settings,function(k,m){(!e||!0===e&&h(m.nTable).is(":visible"))&&r.push(m.nTable)});return r};k.version="1.9.1";k.settings=[];k.models={};k.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],aTypes:[],fnVersionCheck:k.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:k.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};k.models.oSearch={bCaseInsensitive:!0,
sSearch:"",bRegex:!1,bSmart:!0};k.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};k.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,fnRender:null,fnSetData:null,mDataProp:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};
k.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,
fnFormatNumber:function(e){if(1E3>e)return e;var h=e+"";e=h.split("");var k="";h=h.length;for(var m=0;m<h;m++)0===m%3&&0!==m&&(k=this.oLanguage.sInfoThousands+k),k=e[h-m-1]+k;return k},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:function(e,k,p,m){m.jqXHR=h.ajax({url:e,data:k,success:function(e){h(m.oInstance).trigger("xhr",m);p(e)},dataType:"json",cache:!1,type:m.sServerMethod,error:function(e,h,k){"parsererror"==h&&m.oApi._fnLog(m,
0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance);try{var k="function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(u){k=null}return k},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},
fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",
sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},k.models.oSearch),sAjaxDataProp:"aaData",sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};k.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,
bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mDataProp:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};k.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,
sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",
nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,
_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:
Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};k.ext=h.extend(!0,{},k.models.ext);h.extend(k.ext.oStdClasses,{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",
sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",
sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""});h.extend(k.ext.oJUIClasses,k.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",
sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",
sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",
sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default"});h.extend(k.ext.oPagination,{two_button:{fnInit:function(e,k,p){var m=e.oLanguage.oPaginate,r=function(h){e.oApi._fnPageChange(e,h.data.action)&&p(e)};m=e.bJUI?'<a class="'+e.oClasses.sPagePrevDisabled+
'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>':'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+m.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+m.sNext+"</a>";h(k).append(m);var q=h("a",k);m=q[0];q=q[1];e.oApi._fnBindAction(m,
{action:"previous"},r);e.oApi._fnBindAction(q,{action:"next"},r);e.aanFeatures.p||(k.id=e.sTableId+"_paginate",m.id=e.sTableId+"_previous",q.id=e.sTableId+"_next",m.setAttribute("aria-controls",e.sTableId),q.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e,h){if(e.aanFeatures.p){h=e.oClasses;for(var k=e.aanFeatures.p,m=0,r=k.length;m<r;m++)0!==k[m].childNodes.length&&(k[m].childNodes[0].className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k[m].childNodes[1].className=
e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled)}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,k,p){var m=e.oLanguage.oPaginate,r=e.oClasses,q=function(h){e.oApi._fnPageChange(e,h.data.action)&&p(e)};h(k).append('<a  tabindex="'+e.iTabIndex+'" class="'+r.sPageButton+" "+r.sPageFirst+'">'+m.sFirst+'</a><a  tabindex="'+e.iTabIndex+'" class="'+r.sPageButton+" "+r.sPagePrevious+'">'+m.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+r.sPageButton+
" "+r.sPageNext+'">'+m.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+r.sPageButton+" "+r.sPageLast+'">'+m.sLast+"</a>");var u=h("a",k);m=u[0];r=u[1];var B=u[2];u=u[3];e.oApi._fnBindAction(m,{action:"first"},q);e.oApi._fnBindAction(r,{action:"previous"},q);e.oApi._fnBindAction(B,{action:"next"},q);e.oApi._fnBindAction(u,{action:"last"},q);e.aanFeatures.p||(k.id=e.sTableId+"_paginate",m.id=e.sTableId+"_first",r.id=e.sTableId+"_previous",B.id=e.sTableId+"_next",u.id=e.sTableId+"_last")},fnUpdate:function(e,
r){if(e.aanFeatures.p){var p=k.ext.oPagination.iFullNumbersShowPages,m=Math.floor(p/2),q=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),G=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,H="",B,F=e.oClasses,L=e.aanFeatures.p,R=function(h){e.oApi._fnBindAction(this,{page:h+B-1},function(h){e.oApi._fnPageChange(e,h.data.page);r(e);h.preventDefault()})};-1===e._iDisplayLength?G=m=B=1:q<p?(B=1,m=q):G<=m?(B=1,m=p):G>=q-m?(B=q-p+1,m=q):(B=G-Math.ceil(p/2)+1,m=B+p-1);for(p=B;p<=m;p++)H+=G!==p?'<a tabindex="'+
e.iTabIndex+'" class="'+F.sPageButton+'">'+e.fnFormatNumber(p)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+F.sPageButtonActive+'">'+e.fnFormatNumber(p)+"</a>";p=0;for(m=L.length;p<m;p++)if(0!==L[p].childNodes.length){h("span:eq(0)",L[p]).html(H).children("a").each(R);var y=L[p].getElementsByTagName("a");y=[y[0],y[1],y[y.length-2],y[y.length-1]];h(y).removeClass(F.sPageButton+" "+F.sPageButtonActive+" "+F.sPageButtonStaticDisabled);h([y[0],y[1]]).addClass(1==G?F.sPageButtonStaticDisabled:F.sPageButton);
h([y[2],y[3]]).addClass(0===q||G===q||-1===e._iDisplayLength?F.sPageButtonStaticDisabled:F.sPageButton)}}}}});h.extend(k.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<h?1:e>h?
-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(k.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h=!1;var k=e.charAt(0);if(-1=="0123456789-".indexOf(k))return null;
for(var m=1;m<e.length;m++){k=e.charAt(m);if(-1=="0123456789.".indexOf(k))return null;if("."==k){if(h)return null;h=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=k;h.fn.dataTable=k;h.fn.dataTableSettings=k.settings;h.fn.dataTableExt=k.ext})(jQuery,window,document,void 0);
;

