{"version":3,"sources":["https:\/\/servizi.odsacb.it\/theme\/remui\/amd\/src\/loader.js"],"names":["define","$","Ajax","Tether","Event","Aria","breakpoints","Drawer","Notice","str","PubSub","ModalFactory","resetSidebar","window","width","hasClass","trigger","removeClass","document","jQuery","init","popover","selector","container","delay","hide","getLegacyEvents","done","events","on","FILTER_CONTENT_UPDATED","change","onbeforeunload","this","form","submit","toggleClass","length","sidebarFooterHeight","height","css","ready","tooltip","availableSpace","numOfVisibleItems","$btn","$vlinks","$hlinks","numOfItems","totalSpace","breakWidths","wdmCollapsibleNavMenu","children","last","prependTo","first","appendTo","attr","addClass","outerWidth","i","w","push","currLeft","offset","left","body","evt","button","target","currentTarget","closest","subscribe","resize","parents","IGNORE_DRAWER_BTN","click","M","util","set_user_preference","info","get_string","prop","show","animate","scrollTop","scroll","hover","topdistance","distanceFromTop","position","top","screenHeight","submenuid","undefined","submenu","concat","subcourseskey","subcourses","elid","parentel","elkey","e","preventDefault","key","keypress","keyCode","setfocus","each","index","tabIndex","focus","console","log","sectionEl","parent","find","label","trim","text","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen","element","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","msRequestFullscreen","toggleFullScreen","next","event","create","title","data","modal","call","methodname","args","location","href","cfg","wwwroot","encodeURI","mouseover","mouseout"],"mappings":"AAyBA,aAEAA,OAAO,CAAC,SAAU,YAAa,qBAAsB,aAAc,mBAAoB,0BAA2B,qBAAsB,qBAAsB,WAAY,cAAe,qBAAsB,sBAAuB,mBAAoB,oBAAqB,qBAAsB,uBAAwB,uBAAwB,uBAAwB,oBAAqB,wBAAyB,kBAAmB,sBAAuB,sBAAuB,wBAAyB,SAAUC,EAAGC,EAAMC,EAAQC,EAAOC,EAAMC,EAAaC,EAAQC,EAAQC,EAAKC,EAAQC,GA+ZrkB,SAASC,IACKX,EAA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EN,CACL,IAAIC,EAAU\/H,EAAE,QAAQ,GAEpB+H,EAAQC,kBACVD,EAAQC,oBACCD,EAAQE,qBACjBF,EAAQE,uBACCF,EAAQG,wBACjBH,EAAQG,wBAAwBC,QAAQC,sBAC\/BL,EAAQM,qBACjBN,EAAQM,uBA3BZC,KAiCFtI,EAAE,kCAAkC2E,MAAM,WACxC3E,EAAEgC,MAAMuG,OAAOpB,KAAK,8BAA8BpG,QAAQ,WAyB5Df,EAAEY,QAAQ4D,OAAO,WACf7D,MAEFX,EAAE,mBAAmB2E,MAAM,WACzB3E,EAAE,0BAA0BmC,YAAY,UAE1CnC,EAAE,QAAQ4B,GAAG,QAAS,iBAAkB,SAAU4G,GAChDA,EAAMlC,iBACN,IAAIvF,EAAUf,EAAE,iBAChBU,EAAa+H,OAAO,CAClBC,MAAO9D,EAAEC,KAAKG,WAAW,YAAa,eACtCf,KAAMjE,EAAEgC,MAAM2G,KAAK,QAClB5H,GAASW,KAAK,SAAUkH,GACzBA,EAAM1D,WAKVlF,EAAE,sCAAsC2E,MAAM,WAC5C1E,EAAK4I,KAAK,CAAC,CACTC,WAAc,0BACdC,KAAQ,QAIZ\/I,EAAE,4CAA4C2E,MAAM,WAClDC,EAAEC,KAAKC,oBAAoB,+BAA+B,KAE5D9E,EAAE,+BAA+B4B,GAAG,QAAS,WAC3ChB,OAAOoI,SAASC,KAAOrE,EAAEsE,IAAIC,QAAU,mCAAqCC,UAAUxI,OAAOoI,SAASC,QAGxGjJ,EAAE,uCAAuCqJ,UAAU,WACjDrJ,EAAE,uCAAuCuC,IAAI,SAAU,GAAGwD,OAAO,GAAK\/F,EAAEgC,MAAMmF,KAAK,kBAAkB\/E,OAAQ,SAC5GkH,SAAS,WACVtJ,EAAE,uCAAuCuC,IAAI,SAAU","sourcesContent":["\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\n\/**\n * Template renderer for Moodle. Load and render Moodle templates with Mustache.\n *\n * @module core\/templates\n * @package core\n * @class templates\n * @copyright 2015 Damyon Wiese \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n * @since 2.9\n *\/\n\"use strict\";\ndefine([\n 'jquery',\n 'core\/ajax',\n 'theme_remui\/tether',\n 'core\/event',\n 'theme_remui\/aria',\n 'theme_remui\/breakpoints',\n 'theme_remui\/drawer',\n 'theme_remui\/notice',\n 'core\/str',\n 'core\/pubsub',\n 'core\/modal_factory',\n 'theme_remui\/pending',\n 'theme_remui\/util',\n 'theme_remui\/alert',\n 'theme_remui\/button',\n 'theme_remui\/carousel',\n 'theme_remui\/collapse',\n 'theme_remui\/dropdown',\n 'theme_remui\/modal',\n 'theme_remui\/scrollspy',\n 'theme_remui\/tab',\n 'theme_remui\/tooltip',\n 'theme_remui\/popover',\n 'theme_remui\/skintool'\n], function(\n $,\n Ajax,\n Tether,\n Event,\n Aria,\n breakpoints,\n Drawer,\n Notice,\n str,\n PubSub,\n ModalFactory\n) {\n\n window.jQuery = $;\n window.Tether = Tether;\n Drawer.init();\n\n \/\/ We do twice because: https:\/\/github.com\/twbs\/bootstrap\/issues\/10547 end.\n $('body').popover({\n trigger: 'focus',\n selector: \"[data-toggle=popover][data-trigger!=hover]\"\n });\n\n $(\"html\").popover({\n container: \"body\",\n selector: \"[data-toggle=popover][data-trigger=hover]\",\n trigger: \"hover\",\n delay: {\n hide: 500\n }\n });\n\n \/\/ We need to call popover automatically if nodes are added to the page later.\n Event.getLegacyEvents().done(function(events) {\n $(document).on(events.FILTER_CONTENT_UPDATED, function() {\n $('body').popover({\n selector: '[data-toggle=\"popover\"]',\n trigger: 'focus'\n });\n\n });\n });\n\n \/\/ Settings update on change.\n $(`#id_s_theme_remui_frontpagechooser`).change(function() {\n window.onbeforeunload = null;\n this.form.submit();\n });\n Aria.init();\n \/\/ Open Right Sidebar.\n $(\".page-aside-switch .fa-angle-left\").on('click', function() {\n $(\"body\").toggleClass('sidebar-open');\n if (!$(\"body\").hasClass(\"hasblocks\")) {\n $(\".page-aside-switch\").removeClass('d-flex');\n $(\".page-aside-switch\").hide();\n }\n });\n\n \/\/ Created custom event to adjust left sidebar scrollable height.\n $(document).on('remui-adjust-left-side', function() {\n if ($('.site-menubar-footer').length == 0) {\n return;\n }\n let sidebarFooterHeight = $('.site-menubar-footer').height();\n if ($('#nav-drawer').length == 0) {\n return;\n }\n $('#nav-drawer').css('bottom', sidebarFooterHeight + 'px');\n });\n\n $(document).ready(function() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n if ($(\"body\").hasClass(\"editing\") && $(\"body\").hasClass(\"hasblocks\")) {\n $(\".page-aside-switch .fa-angle-left\").trigger('click');\n }\n\n $(document).trigger('remui-adjust-left-side');\n\n $('[data-region=\"drawer-toggle\"]').on('click', function() {\n $(document).trigger('remui-adjust-left-side');\n });\n\n resetSidebar();\n\n \/\/ Collapsible menu in header implementation.\n \/\/ Moves excess menu items to 3 dot menu on resize and based on available screen space.\n\n \/\/ Greedy menu js implementation.\n var $btn = $('nav.greedy .menu-toggle');\n var $vlinks = $('nav.greedy .links');\n var $hlinks = $('nav.greedy .hidden-links');\n var numOfItems = 0;\n var totalSpace = 0;\n var breakWidths = [];\n var availableSpace, numOfVisibleItems, requiredSpace;\n\n \/\/ Get initial state.\n $vlinks.children().outerWidth(function(i, w) {\n totalSpace += w;\n numOfItems += 1;\n breakWidths.push(totalSpace);\n });\n\n \/**\n * Custom collapsible navigation menu\n *\/\n function wdmCollapsibleNavMenu() {\n \/\/ Get instant state.\n availableSpace = $vlinks.width() - 10;\n numOfVisibleItems = $vlinks.children().length;\n requiredSpace = breakWidths[numOfVisibleItems - 1];\n\n \/\/ There is not enought space.\n if (requiredSpace > availableSpace) {\n $vlinks.children().last().prependTo($hlinks);\n numOfVisibleItems -= 1;\n wdmCollapsibleNavMenu();\n \/\/ There is more than enough space.\n } else if (availableSpace > breakWidths[numOfVisibleItems]) {\n $hlinks.children().first().appendTo($vlinks);\n numOfVisibleItems += 1;\n }\n \/\/ Update the button accordingly.\n $btn.attr(\"count\", numOfItems - numOfVisibleItems);\n if (numOfVisibleItems === numOfItems) {\n $btn.addClass('hidden');\n } else {\n $btn.removeClass('hidden');\n }\n }\n\n \/\/ Init collapsible nav menu.\n wdmCollapsibleNavMenu();\n\n \/\/ Hide \/ show hidden-links ul on click button.\n $btn.on('click', function() {\n var currLeft = $(this).offset().left - 25;\n $hlinks.css({\n left: currLeft + \"px\"\n });\n $hlinks.toggleClass('hidden');\n });\n\n \/\/ Close when clicking somewhere else.\n $(document.body).on('click', function(evt) {\n let IGNORED_ELS = 'ul.hidden-links, button.menu-toggle, .modal, .alertify, .-handled-lick';\n if (evt.button === 0 && !$('ul.hidden-links').hasClass('hidden')) {\n var target = evt.target;\n if (target === evt.currentTarget || !$(target).closest(IGNORED_ELS).length) {\n $('ul.hidden-links').addClass('hidden');\n }\n }\n });\n\n \/\/ Resize menu when drawer opens closes.\n PubSub.subscribe('nav-drawer-toggle-end', function() {\n wdmCollapsibleNavMenu();\n });\n\n \/\/ Window listeners.\n $(window).resize(function() {\n wdmCollapsibleNavMenu();\n });\n\n \/\/ Collapsible menu JS ends.\n\n \/\/ Auto hide messaging bar when not merged in sidebar.\n if ($('[data-region=\"right-hand-drawer\"]').parents('#sidebar-message').length == 0) {\n $(document.body).on('click', function(evt) {\n if (evt.button === 0 && !$('[data-region=\"right-hand-drawer\"]').hasClass('hidden')) {\n \/\/ Hide Message Drawer if click outsite.\n var IGNORE_DRAWER_BTN = '[data-region=\"right-hand-drawer\"], [href=\"#sidebar-message\"]';\n var target = evt.target;\n if (target === evt.currentTarget || !$(target).closest(IGNORE_DRAWER_BTN).length) {\n $('[data-region=\"right-hand-drawer\"]').addClass(\"hidden\");\n $(IGNORE_DRAWER_BTN).removeClass('active');\n }\n }\n });\n } else {\n \/\/ Prevent messaging bar toggle when merged in sidebar.\n $('.page-aside .nav-item .nav-link[href=\"#sidebar-message\"]').click(function() {\n $('[data-region=\"right-hand-drawer\"]').removeClass('hidden');\n });\n }\n });\n\n \/\/ Pin & Unpin Right Sidebar.\n $(\".page-aside-switch .fa-thumb-tack\").on('click', function() {\n $(\"body\").removeClass('sidebar-open');\n $(\"body\").toggleClass('sidebar-pinned');\n if ($('body').hasClass('sidebar-pinned')) {\n M.util.set_user_preference('pin_aside', 'true');\n Notice.info(M.util.get_string('sidebarpinned', 'theme_remui'));\n $(this).prop('title', M.util.get_string('unpinsidebar', 'theme_remui'));\n } else {\n M.util.set_user_preference('pin_aside', '');\n Notice.info(M.util.get_string('sidebarunpinned', 'theme_remui'));\n $(this).prop('title', M.util.get_string('pinsidebar', 'theme_remui'));\n }\n });\n \/\/ This function ... handles the aria-selected attribute for tabs in right sidebar.\n $('.page-aside .site-sidebar-nav .nav-link').on('click', function(){\n $('.page-aside .site-sidebar-nav .nav-link').attr('aria-selected', false);\n $(this).attr('aria-selected', true);\n });\n\n \/\/ Close Right Sidebar on click outside.\n $(document.body).on('click', function(evt) {\n let IGNORED_ELS = '.page-aside, .modal, .alertify, .-handled-lick';\n if (evt.button === 0 && $('body').hasClass('sidebar-open')) {\n var target = evt.target;\n if (target === evt.currentTarget || !$(target).closest(IGNORED_ELS).length) {\n $('body').removeClass('sidebar-open');\n $(\".page-aside-switch\").addClass('d-flex');\n $(\".page-aside-switch\").show();\n }\n }\n });\n\n \/\/ Scroll to top.\n $(\"#gotop\").click(function() {\n $('html, body').animate({scrollTop: 0}, $(window).scrollTop() \/ 6);\n return false;\n });\n\n \/\/ Hide and Show Go to top button.\n $(window).scroll(function() {\n if ($(this).scrollTop() > 300) {\n $('#gotop').removeClass(\"d-none\").addClass(\"d-flex\");\n } else {\n $('#gotop').removeClass(\"d-flex\").addClass(\"d-none\");\n }\n });\n\n \/\/ Display Submenu on Hover on closed sidebar.\n $('#nav-drawer .list-group-item:not(.activity):not([data-indent=\"1\"])').hover(function() {\n if (!$('#nav-drawer').hasClass('closed')) {\n return;\n }\n let distanceFromTop = $(this).position().top + $('nav.fixed-top:not(.fm-navbar)').height();\n let screenHeight = $(window).height();\n $(this).addClass('hovered');\n $('.media-body').css('top', distanceFromTop + 'px');\n \/\/ Sub Menu.\n let topdistance;\n let submenuid = $(this).attr('data-target');\n if (submenuid != undefined && submenuid != \"\") {\n let submenu = $(`${submenuid}`);\n if (submenu.length > 0) {\n if (distanceFromTop < (screenHeight \/ 2)) {\n topdistance = distanceFromTop + 52;\n } else {\n topdistance = distanceFromTop - $(submenu).height();\n }\n $(submenu).css('top', topdistance + 'px');\n $(submenu).addClass('pop-over');\n }\n }\n \/\/ My Courses data-indent = 1.\n let subcourseskey = $(this).attr('data-key');\n if (subcourseskey != undefined && subcourseskey == \"mycourses\") {\n var subcourses = $('#nav-drawer .mycoursesubmenu');\n if (distanceFromTop < (screenHeight \/ 2)) {\n topdistance = distanceFromTop + 52;\n $(subcourses).css('top', topdistance + 'px');\n $(subcourses).addClass('pop-over');\n } else {\n $(subcourses).addClass('pop-over');\n topdistance = distanceFromTop - $(subcourses).height();\n $(subcourses).css('top', topdistance + 'px');\n }\n }\n }, function() {\n $(this).removeClass('hovered');\n $('.sub-menu').removeClass('pop-over');\n $('#nav-drawer .mycoursesubmenu').removeClass('pop-over');\n });\n\n $('.sub-menu').hover(function() {\n let elid = $(this).attr('id');\n let parentel = $('#nav-drawer .list-group-item[data-target=\"#' + elid + '\"]');\n $(parentel).trigger('mouseenter');\n $(parentel).trigger('hover');\n $(parentel).trigger('mouseover');\n }, function() {\n let elid = $(this).attr('id');\n let parentel = $('#nav-drawer .list-group-item[data-target=\"#' + elid + '\"]');\n $(parentel).trigger('mouseout');\n });\n\n \/\/ My Courses.\n $('#nav-drawer .mycoursesubmenu').hover(function() {\n let elkey = $(this).attr('data-parent-key');\n let parentel = $('#nav-drawer .list-group-item[data-key=\"' + elkey + '\"]');\n $(parentel).trigger('mouseenter');\n $(parentel).trigger('hover');\n $(parentel).trigger('mouseover');\n }, function() {\n let elkey = $(this).attr('data-parent-key');\n let parentel = $('#nav-drawer .list-group-item[data-key=\"' + elkey + '\"]');\n $(parentel).trigger('mouseout');\n });\n\n \/\/ Flat navigation mycourses ul dropdown support.\n $('#nav-drawer .toggle-menu').click(function(e) {\n e.preventDefault();\n let key = $(this).attr('data-key');\n $('#nav-drawer .toggle-menu').toggleClass('rotate90');\n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]').toggleClass('show');\n });\n\n $('#nav-drawer .toggle-menu').keypress(function(e){\n if(e.keyCode == 32 || e.keyCode == 13){\n \/\/spacebar or enter clicks focused element\n try {\n e.preventDefault();\n let setfocus = 0;\n let key = $(this).attr('data-key');\n $('#nav-drawer .fa-angle-right').toggleClass('rotate90');\n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]').toggleClass('show');\n \/\/ Fetch all sub menu items and change their tabindex property \n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]').each(function( index ) {\n if ($('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]')[index].tabIndex == -1){\n setfocus = 1;\n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]')[index].tabIndex = 0;\n } else {\n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]')[index].tabIndex = -1;\n }\n });\n \/\/ Set the focus to first element of List\n if (setfocus) {\n $('#nav-drawer a.list-group-item[data-parent-key=\"' + key + '\"]')[0].focus();\n }\n }\n catch (e) {\n console.log(e);\n } \n }\n });\n\n \/\/ Toggle section show or hide in default course formats.\n $('.sectionname .toggle-section').click(function() {\n let parentEl = $(this).parent().parent().parent();\n let sectionEl = parentEl.find('ul.section');\n if (sectionEl.length) {\n $(this).toggleClass('down');\n $(sectionEl).toggleClass('hidden');\n }\n\n if ($(this).attr('aria-expanded') == 'false') { \/\/ region is collapsed\n \/\/ update the aria-expanded attribute of the region\n $(this).attr('aria-expanded', 'true');\n }\n else { \/\/ region is expanded\n \/\/ update the aria-expanded attribute of the region\n $(this).attr('aria-expanded', 'false');\n }\n });\n\n $('.sectionname .toggle-section').keypress(function(e){\n if(e.keyCode == 32 || e.keyCode == 13){\n \/\/spacebar or enter clicks focused element\n try {\n let parentEl = $(this).parent().parent().parent();\n let sectionEl = parentEl.find('ul.section');\n if (sectionEl.length) {\n $(this).toggleClass('down');\n $(sectionEl).toggleClass('hidden');\n }\n if ($(this).attr('aria-expanded') == 'false') { \/\/ region is collapsed\n \/\/ update the aria-expanded attribute of the region\n $(this).attr('aria-expanded', 'true');\n $(sectionEl).focus();\n }\n else { \/\/ region is expanded\n \/\/ update the aria-expanded attribute of the region\n $(this).attr('aria-expanded', 'false');\n }\n }\n catch (e) {\n console.log(e);\n } \n }\n });\n\n \/\/ Add signup form fields placeholders.\n $(\".signupform .fcontainer .form-group\").each(function() {\n var label = $.trim($(\".col-form-label\", this).text());\n $(\".felement input\", this).attr('placeholder', label);\n });\n\n \/\/ Function for fullscreen.\n $('#toggleFullscreen').click(function() {\n $(this).toggleClass('collapse');\n toggleFullScreen();\n });\n\n \/**\n * Toggle fullscreen\n *\/\n function toggleFullScreen() {\n if (document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement) {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n } else {\n var element = $('html')[0];\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n }\n }\n\n\n \/\/ Fix to get message details when no blocks are present.\n $('.page-aside .page-aside-switch').click(function() {\n $(this).next().find('.nav-item .nav-link.active').trigger('click');\n });\n\n \/**\n * Close drawer and sidebar automatically on smaller window size.\n *\/\n function resetSidebar() {\n var width = $(window).width();\n if (width < 992) {\n if ($('body').hasClass('drawer-open-left')) {\n $('button[data-action=\"toggle-drawer\"]').trigger('click');\n }\n if ($('body').hasClass('sidebar-open')) {\n $('.page-aside-switch .fa-angle-left').trigger('click');\n }\n $('body').removeClass('sidebar-pinned');\n }\n $(document).trigger('remui-adjust-left-side');\n }\n\n \/\/ Resize listner for reset sidebar function.\n $(window).resize(function() {\n resetSidebar();\n });\n\n $('.navbar-toggler').click(function() {\n $('.navbar-nav.right-menu').toggleClass('show');\n });\n\n $('body').on('click', '.showchangelog', function(event) {\n event.preventDefault();\n var trigger = $('#create-modal');\n ModalFactory.create({\n title: M.util.get_string('changelog', 'theme_remui'),\n body: $(this).data('log')\n }, trigger).done(function(modal) {\n modal.show();\n });\n return;\n });\n\n \/\/ Hide update-nag ribbon.\n $('.update-nag [data-dismiss=\"alert\"]').click(function() {\n Ajax.call([{\n 'methodname': 'theme_remui_hide_update',\n 'args': {}\n }]);\n });\n\n \/\/ Save the preference, after dismiss the announcement\n $('.site-announcement #dismiss_announcement').click(function(){\n M.util.set_user_preference('remui_dismised_announcement', true);\n });\n\n $('.customizer-turn-editing-on').on('click', function() {\n window.location.href = M.cfg.wwwroot + '\/theme\/remui\/customizer.php?url=' + encodeURI(window.location.href);\n });\n\n \/\/ Showing closed sidebar's all footer icon on mouse over.\n $('.site-menubar-footer.sidebar-closed').mouseover(function() {\n $('.site-menubar-footer.sidebar-closed').css('height', `${55 * $(this).find('a:not(:hidden)').length}px`);\n }).mouseout(function() {\n $('.site-menubar-footer.sidebar-closed').css('height', '55px');\n });\n});\n"],"file":"loader.min.js"}