From 9010d079d338a87c995052d54b94bb9fd30d756c Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 31 Aug 2023 14:58:47 +0200 Subject: [PATCH 1/4] 11801-Datatables add parameter Start disabled (enable on filter) --- pandora_console/include/functions_ui.php | 17 ++++++++++--- .../include/javascript/datatablesFunction.js | 25 ++++++++++++++++++- .../operation/agentes/alerts_status.php | 3 ++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index e1c04a45b5..730f4d77d6 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3913,6 +3913,11 @@ function ui_print_datatable(array $parameters) $parameters['toggle_collapsed'] = true; } + $parameters['startDisabled'] = false; + if (isset($parameters['start_disabled']) && $parameters['start_disabled'] === true) { + $parameters['startDisabled'] = true; + } + if (!is_array($parameters['order'])) { $order = 0; $direction = 'asc'; @@ -4113,7 +4118,7 @@ function ui_print_datatable(array $parameters) // Base table. $table = ''; $table .= ''; @@ -4187,13 +4192,19 @@ function ui_print_datatable(array $parameters) $info_msg_arr['message'] = $emptyTable; $info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id; - $spinner = '
'; + $info_msg_arr_filter = []; + $info_msg_arr_filter['message'] = __('Please apply a filter to display the data.'); + $info_msg_arr_filter['div_class'] = 'info_box_container invisible_important datatable-msg-info-filter-'.$table_id; + + $spinner = ''; // TODO This widget should take a return: ui_print_info_message($info_msg_arr, '', true) $info_msg = '
'.ui_print_info_message($info_msg_arr).'
'; + $info_msg_filter = '
'.ui_print_info_message($info_msg_arr_filter, true).'
'; + $err_msg = '
'; - $output = $info_msg.$err_msg.$filter.$extra.$spinner.$table.$js; + $output = $info_msg.$info_msg_filter.$err_msg.$filter.$extra.$spinner.$table.$js; if (is_ajax() === false) { ui_require_css_file('datatables.min', 'include/styles/js/'); ui_require_css_file('tables'); diff --git a/pandora_console/include/javascript/datatablesFunction.js b/pandora_console/include/javascript/datatablesFunction.js index 41f0bbf1e2..6c9dc6a3f4 100644 --- a/pandora_console/include/javascript/datatablesFunction.js +++ b/pandora_console/include/javascript/datatablesFunction.js @@ -126,6 +126,11 @@ if (typeof dt.ajax_data !== "undefined") { ajaxData = dt.ajax_data; } +var startDisabled = false; +if (dt.startDisabled === true) { + startDisabled = true; +} + $(document).ready(function() { function checkPages() { if (dt_table.page.info().pages > 1) { @@ -335,7 +340,25 @@ $(document).ready(function() { } $.extend(settings_datatable, ajaxOrData); - var dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable); + + var dt_table; + + if (startDisabled === true) { + $(`.datatable-msg-info-filter-${dt.id}`) + .removeClass("invisible_important") + .show(); + + $(`div#${dt.id}-spinner`).hide(); + $(`#${dt.table_id}`).hide(); + + $(`#button-form_${dt.table_id}_search_bt`).click(function() { + $(`.datatable-msg-info-filter-${dt.id}`).hide(); + $(`#${dt.table_id}`).show(); + dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable); + }); + } else { + dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable); + } $(`#button-${dt.form_id}_search_bt`).click(function() { dt_table.draw().page(0); diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 07974af99e..f9d7bb01cd 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -407,7 +407,7 @@ if ($agent_view_page === true) { [ 'id' => 'alerts_status_datatable', 'class' => 'info_table', - 'style' => 'width: 99%;', + 'style' => 'width: 100%;', 'columns' => $columns, 'column_names' => $column_names, 'no_sortable_columns' => $no_sortable_columns, @@ -439,6 +439,7 @@ if ($agent_view_page === true) { $strict_user ), ], + 'start_disabled' => true, ] ); } From 4d3b558e97ccfe18ed417de9d18927f5ba316880 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 1 Sep 2023 09:37:16 +0200 Subject: [PATCH 2/4] 11801-Monitors detail/view Start disabled (enable on filter) --- pandora_console/operation/agentes/status_monitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index d54d70a799..62d6183179 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -154,7 +154,7 @@ if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== '' // The execution has not been done manually. $userRequest = (bool) get_parameter('uptbutton'); -if ($userRequest === false) { +if ($userRequest === true) { $autosearch = true; } From 87c02fd0a7f9c0e60b716f294034801a9891f99f Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 7 Sep 2023 11:08:31 +0200 Subject: [PATCH 3/4] 11801-Resolve conflict --- extras/deploy-scripts/pandora_agent_deploy.sh | 82 +- pandora_agents/pc/Linux/pandora_agent.conf | 2 +- pandora_agents/pc/Win32/pandora_agent.conf | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- .../unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/Darwin/pandora_agent.conf | 2 +- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- .../unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/bin/pandora_agent.conf | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/extras/mr/66.sql | 26 + .../godmode/agentes/configurar_agente.php | 6 +- .../godmode/agentes/module_manager_editor.php | 6 +- .../agentes/module_manager_editor_network.php | 17 +- .../godmode/alerts/alert_commands.php | 4 +- .../godmode/setup/setup_visuals.php | 25 + .../godmode/snmpconsole/snmp_alert.php | 2 +- .../wizards/DiscoveryTaskList.class.php | 4 +- .../images/widgets/groups_status_map.png | Bin 0 -> 4390 bytes pandora_console/images/widgets/inventory.png | Bin 0 -> 5698 bytes pandora_console/include/ajax/audit_log.php | 78 +- pandora_console/include/ajax/module.php | 54 +- .../include/class/AuditLog.class.php | 48 +- .../include/class/SnmpConsole.class.php | 9 +- pandora_console/include/config_process.php | 2 +- pandora_console/include/functions_config.php | 8 + .../include/functions_filemanager.php | 36 +- pandora_console/include/functions_html.php | 293 ++++ .../include/functions_inventory.php | 14 +- pandora_console/include/functions_menu.php | 4 + pandora_console/include/functions_ui.php | 21 +- pandora_console/include/get_file.php | 26 +- .../include/graphs/flot/pandora.flot.js | 20 +- .../include/graphs/functions_d3.php | 16 +- pandora_console/include/graphs/pandora.d3.js | 115 +- .../include/javascript/jquery-ui.min.js | 2 +- .../include/javascript/pandora_dashboards.js | 73 + .../include/lib/Dashboard/Manager.php | 45 + .../include/lib/Dashboard/Widget.php | 8 + .../Dashboard/Widgets/groups_status_map.php | 460 ++++++ .../lib/Dashboard/Widgets/inventory.php | 1270 +++++++++++++++++ .../lib/Dashboard/Widgets/single_graph.php | 92 +- pandora_console/include/styles/dashboards.css | 10 + .../include/styles/js/jquery-ui.min.css | 2 +- .../include/styles/js/jquery-ui_custom.css | 127 +- pandora_console/include/styles/pandora.css | 4 + pandora_console/install.php | 2 +- .../operation/agentes/stat_win.php | 71 +- .../operation/agentes/ver_agente.php | 98 ++ pandora_console/operation/events/events.php | 1 + .../operation/inventory/inventory.php | 140 +- .../operation/netflow/nf_live_view.php | 200 +-- .../operation/network/network_report.php | 233 +-- .../operation/network/network_usage_map.php | 138 +- .../operation/reporting/graph_viewer.php | 108 +- .../operation/reporting/reporting_viewer.php | 99 +- .../operation/visual_console/view.php | 5 + pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.sql | 26 +- pandora_console/pandoradb_data.sql | 6 +- pandora_console/views/dashboard/cell.php | 12 + pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/DB.pm | 4 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/lib/PandoraFMS/SNMPServer.pm | 4 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 82 files changed, 3400 insertions(+), 814 deletions(-) create mode 100644 pandora_console/images/widgets/groups_status_map.png create mode 100644 pandora_console/images/widgets/inventory.png create mode 100644 pandora_console/include/lib/Dashboard/Widgets/groups_status_map.php create mode 100644 pandora_console/include/lib/Dashboard/Widgets/inventory.php diff --git a/extras/deploy-scripts/pandora_agent_deploy.sh b/extras/deploy-scripts/pandora_agent_deploy.sh index a16f5afc47..88bfe4dd83 100644 --- a/extras/deploy-scripts/pandora_agent_deploy.sh +++ b/extras/deploy-scripts/pandora_agent_deploy.sh @@ -78,16 +78,16 @@ cd unix && ./pandora_agent_installer --install } -install_autodiscover () { - local arch=$1 - wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip - unzip autodiscover-linux.zip - chmod +x $arch/autodiscover - mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover -} +# install_autodiscover () { +# local arch=$1 +# wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip +# unzip autodiscover-linux.zip +# chmod +x $arch/autodiscover +# mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover +# } ## Main -echo "Starting PandoraFMS Agent deployment ver. $S_VERSION" +echo "Starting PandoraFMS Agent binary deployment ver. $S_VERSION" execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP' @@ -104,8 +104,6 @@ OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release [[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS [[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS [[ $OS =~ 'debian' ]] && OS_RELEASE=$OS -#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS -#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS # initialice logfile execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE" @@ -126,6 +124,30 @@ check_repo_connection execute_cmd "grep --version" 'Checking needed tools: grep' execute_cmd "sed --version" 'Checking needed tools: sed' +# Arch check +arch=$(uname -m) +case $arch in + + x86_64) + echo -e "${cyan}Arch: $arch ${reset} " + ;; + + x86) + echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}" + exit -1 + ;; + + armv7l) + echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}" + exit -1 + ;; + + *) + echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}" + exit -1 + ;; +esac + # Creating working directory rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE @@ -148,6 +170,10 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then # Check rh version if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then package_manager_cmd=dnf + execute_cmd "$package_manager_cmd install -y libnsl" "Installing dependencies" + elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '9' ] ; then + package_manager_cmd=dnf + execute_cmd "$package_manager_cmd install -y libnsl libxcrypt-compat" "Installing dependencies" elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then package_manager_cmd=yum @@ -158,24 +184,23 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset} # Insatall pandora agent - $package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE - echo -en "${cyan}Installing Pandora FMS agent...${reset}" - check_cmd_status 'Error installing Pandora FMS agent' - [[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection" + [ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm " + execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package' + #[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection" fi if [[ $OS_RELEASE == 'debian' ]]; then + [ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz' execute_cmd "apt update" 'Updating repos' - execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies' - execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package' + execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies' + execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package' execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent' - [[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection" + #[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection" cd $HOME/pandora_deploy_tmp fi # Configuring Agente - [[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF [[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF [[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF @@ -187,27 +212,6 @@ fi [[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF -#installing autodiscover - -arch=$(uname -m) -case $arch in - - x86_64) - execute_cmd 'install_autodiscover x86_64' "installing service autodiscover on $arch" 'Error unable to install autodiscovery' - ;; - - x86) - execute_cmd 'install_autodiscover x84' "installing service autodiscover on $arch" 'Error unable to install autodiscovery' - ;; - - armv7l) - echo -e "${cyan}Skiping autodiscover installation arch $arch not suported${reset}" - ;; - - *) - echo -e "${yellow}Skiping autodiscover installation arch $arch not suported${reset}" - ;; -esac #Starting pandora agent daemon. execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent' diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 745b464803..0a3a48950c 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -166,7 +166,7 @@ module_description User CPU Usage (%) module_min_warning 70 module_max_warning 90 module_min_critical 91 -module_max_critical 100 +module_max_critical 0 module_unit % module_end diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 53b368f5ee..edf5a7847a 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -119,7 +119,7 @@ module_description CPU Load (%) module_min_warning 80 module_max_warning 90 module_min_critical 91 -module_max_critical 100 +module_max_critical 0 module_end # Number processes diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7c20120eae..4a10fb7ac8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230831 +Version: 7.0NG.773.3-230907 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 3a6431f20f..9304a38d93 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.773.3-230831" +pandora_version="7.0NG.773.3-230907" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 27b3dfd479..44f909aee8 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -187,7 +187,7 @@ module_description User CPU Usage (%) module_min_warning 70 module_max_warning 90 module_min_critical 91 -module_max_critical 100 +module_max_critical 0 module_end #Get load average diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index a172ae37a2..1b8131a42d 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -219,7 +219,7 @@ module_description User CPU Usage (%) module_min_warning 70 module_max_warning 90 module_min_critical 91 -module_max_critical 100 +module_max_critical 0 module_unit % module_group System module_end diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d712b8efec..f8fdb985c4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230831'; +use constant AGENT_BUILD => '230907'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index f6116fcc83..cf506511f5 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230831 +%define release 230907 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 99e1c4900c..7c7373124e 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230831 +%define release 230907 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 613a77c5f2..40ecbc015c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230831 +%define release 230907 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 7e287a8c08..60dd5f2a43 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230831" +PI_BUILD="230907" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 97974c62fa..d299325f3b 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -165,7 +165,7 @@ module_description User CPU Usage (%) module_min_warning 70 module_max_warning 90 module_min_critical 91 -module_max_critical 100 +module_max_critical 0 module_unit % module_group System module_end diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9880384a67..5ec92eec40 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230831} +{230907} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9c355f5be7..c9ada13790 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.773.3 Build 230831") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230907") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 20c585892a..5c694f8a90 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230831))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230907))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4530f088df..658070ae58 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230831 +Version: 7.0NG.773.3-230907 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 33070dbbac..ff558a0de4 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.773.3-230831" +pandora_version="7.0NG.773.3-230907" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index b0022d31b0..8161c4c2b6 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -1,5 +1,9 @@ START TRANSACTION; +ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0; + +UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp); + CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` ( `id` INT NOT NULL auto_increment, `filter_name` VARCHAR(45) NULL, @@ -18,4 +22,26 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; +ALTER TABLE `tsesion_filter_log_viewer` +CHANGE COLUMN `date_range` `custom_date` INT NULL DEFAULT NULL , +CHANGE COLUMN `start_date_defined` `date` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `start_date_time` `date_text` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `start_date_date` `date_units` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `start_date_date_range` `date_init` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `start_date_time_range` `time_init` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `end_date_date_range` `date_end` VARCHAR(45) NULL DEFAULT NULL , +CHANGE COLUMN `end_date_time_range` `time_end` VARCHAR(45) NULL DEFAULT NULL ; + +ALTER TABLE `tsesion_filter` +CHANGE COLUMN `period` `date_text` VARCHAR(45) NULL DEFAULT NULL AFTER `user`; + +ALTER TABLE `tsesion_filter` +ADD COLUMN `custom_date` INT NULL AFTER `user`, +ADD COLUMN `date` VARCHAR(45) NULL AFTER `custom_date`, +ADD COLUMN `date_units` VARCHAR(45) NULL AFTER `date_text`, +ADD COLUMN `date_init` VARCHAR(45) NULL AFTER `date_units`, +ADD COLUMN `time_init` VARCHAR(45) NULL AFTER `date_init`, +ADD COLUMN `date_end` VARCHAR(45) NULL AFTER `time_init`, +ADD COLUMN `time_end` VARCHAR(45) NULL AFTER `date_end`; + COMMIT; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 5fa92f8c85..701ce4894b 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1475,13 +1475,13 @@ if ($update_module === true || $create_module === true) { $plugin_pass = io_input_password( (string) get_parameter('snmp3_auth_pass') ); - $plugin_parameter = (string) get_parameter('snmp3_auth_method'); + $plugin_parameter = (string) get_parameter('snmp3_auth_method', 'MD5'); - $custom_string_1 = (string) get_parameter('snmp3_privacy_method'); + $custom_string_1 = (string) get_parameter('snmp3_privacy_method', 'DES'); $custom_string_2 = io_input_password( (string) get_parameter('snmp3_privacy_pass') ); - $custom_string_3 = (string) get_parameter('snmp3_security_level'); + $custom_string_3 = (string) get_parameter('snmp3_security_level', 'noAuthNoPriv'); } else if ($id_module_type >= 34 && $id_module_type <= 37) { $tcp_send = (string) get_parameter('command_text'); $custom_string_1 = (string) get_parameter( diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 42aa286c8a..452d2a498a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -459,10 +459,10 @@ if ($id_agent_module) { $snmp_version = 1; $snmp3_auth_user = ''; $snmp3_auth_pass = ''; - $snmp3_auth_method = ''; - $snmp3_privacy_method = ''; + $snmp3_auth_method = 'MD5'; + $snmp3_privacy_method = 'DES'; $snmp3_privacy_pass = ''; - $snmp3_security_level = ''; + $snmp3_security_level = 'noAuthNoPriv'; // For Remote CMD. $command_text = ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 656dac2b0b..a5f0b4d184 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -405,7 +405,22 @@ push_table_simple($data, 'field_snmpv3_row1'); $data = []; $data[0] = __('Privacy method'); -$data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy); +$data[1] = html_print_select( + [ + 'DES' => __('DES'), + 'AES' => __('AES'), + ], + 'snmp3_privacy_method', + $snmp3_privacy_method, + '', + '', + '', + true, + false, + false, + '', + $disabledBecauseInPolicy +); $data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true); $data[3] = html_print_input_password( 'snmp3_privacy_pass', diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 75a80d8d57..b6231544d1 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -97,7 +97,7 @@ if (is_ajax()) { if (!empty($field_description)) { // If the value is 5, this because severity in snmp alerts is not permit to show. - if (($i > 5) && ($command['id'] == 3)) { + if (($i > 5) && ($command['id'] === 3)) { $fdesc = $field_description.'
'.sprintf( __('Field %s'), ($i - 1) @@ -118,7 +118,7 @@ if (is_ajax()) { } } else { // If the macro hasn't description and doesnt appear in command, set with empty description to dont show it. - if (($i > 5) && ($command['id'] == 3)) { + if (($i > 5) && ($command['id'] === 3)) { if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) { $fdesc = sprintf(__('Field %s'), ($i - 1)); } else { diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 6753d1d499..68f2e1dfe2 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -759,6 +759,31 @@ if (enterprise_installed() === true) { ); } +$days_week = [ + 0 => __('Sunday'), + 1 => __('Monday'), + 2 => __('Tuesday'), + 3 => __('Wednesday'), + 4 => __('Thursday'), + 5 => __('Friday'), + 6 => __('Saturday'), +]; + +$table_styles->data[$row][] = html_print_label_input_block( + __('Datepicker first day of week'), + html_print_select( + $days_week, + 'datepicker_first_day', + $config['datepicker_first_day'], + '', + '', + false, + true, + false, + false + ) +); + $row++; // Title Header. diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index d23b65d7ea..2c139e4f21 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -2312,7 +2312,7 @@ $(document).ready (function () { // The row provided has a predefined class. We delete it. $('#table_macros-field' + i) .removeAttr('class'); - if(old_value && i != 4){ + if(old_value){ $("[name=field" + i + "_value]").val(old_value).trigger('change'); } $('#table_macros-field').show(); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index af88c3e51f..347458ff62 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -912,7 +912,7 @@ class DiscoveryTaskList extends HTML 'class' => 'main_menu_icon invert_filter', ] ).'  '; - $data[6] .= __('Discovery.NetScan (legacy)'); + $data[6] .= __('Discovery.NetScan'); } else { // APP or external script recon task. $data[6] = html_print_image( @@ -920,7 +920,7 @@ class DiscoveryTaskList extends HTML true, ['class' => 'main_menu_icon invert_filter'] ).'  '; - $data[6] .= $recon_script_name.' (legacy)'; + $data[6] .= $recon_script_name; } break; } diff --git a/pandora_console/images/widgets/groups_status_map.png b/pandora_console/images/widgets/groups_status_map.png new file mode 100644 index 0000000000000000000000000000000000000000..ca624b9c71c9ea3bea62daa236dec8642bd8afd7 GIT binary patch literal 4390 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 literal 0 HcmV?d00001 diff --git a/pandora_console/include/ajax/audit_log.php b/pandora_console/include/ajax/audit_log.php index c0d1c4f73e..754d679f5b 100644 --- a/pandora_console/include/ajax/audit_log.php +++ b/pandora_console/include/ajax/audit_log.php @@ -58,7 +58,14 @@ if ($save_log_filter) { $values = []; $values['id_name'] = get_parameter('id_name'); $values['text'] = get_parameter('text', ''); - $values['period'] = get_parameter('period', ''); + $values['custom_date'] = get_parameter('custom_date'); + $values['date'] = get_parameter('date'); + $values['date_text'] = get_parameter('date_text'); + $values['date_units'] = get_parameter('date_units'); + $values['date_init'] = get_parameter('date_init'); + $values['time_init'] = get_parameter('time_init'); + $values['date_end'] = get_parameter('date_end'); + $values['time_end'] = get_parameter('time_end'); $values['ip'] = get_parameter('ip', ''); $values['type'] = get_parameter('type', -1); $values['user'] = get_parameter('user', -1); @@ -91,7 +98,14 @@ if ($update_log_filter) { $values = []; $id = get_parameter('id'); $values['text'] = get_parameter('text', ''); - $values['period'] = get_parameter('period', ''); + $values['custom_date'] = get_parameter('custom_date'); + $values['date'] = get_parameter('date'); + $values['date_text'] = get_parameter('date_text'); + $values['date_units'] = get_parameter('date_units'); + $values['date_init'] = get_parameter('date_init'); + $values['time_init'] = get_parameter('time_init'); + $values['date_end'] = get_parameter('date_end'); + $values['time_end'] = get_parameter('time_end'); $values['ip'] = get_parameter('ip', ''); $values['type'] = get_parameter('type', -1); $values['user'] = get_parameter('user', -1); @@ -211,18 +225,42 @@ function load_filter_values() { $.each(data,function(i,value){ if (i == 'text'){ $("#text-filter_text").val(value); - } - if (i == 'period'){ - $("#filter_period").val(value).change(); - } - if (i == 'ip'){ + } else if (i == 'ip'){ $("#text-filter_ip").val(value); - } - if (i == 'type'){ + } else if (i == 'type'){ $("#filter_type").val(value).change(); - } - if (i == 'user'){ + } else if (i == 'user'){ $("#filter_user").val(value).change(); + } else if (i == 'custom_date'){ + $('#hidden-custom_date').val(value).change(); + if ($('#hidden-custom_date').val()==='0'){ + $('#date_default').show(); + $('#date_range').hide(); + $('#date_extend').hide(); + $('#date').val('".SECONDS_1DAY."').trigger('change'); + } else if ($('#hidden-custom_date').val()==='1'){ + $('#date_range').show(); + $('#date_default').hide(); + $('#date_extend').hide(); + } else { + $('#date_range').hide(); + $('#date_default').hide(); + $('#date_extend').show(); + } + } else if (i == 'date'){ + $('#date').val(value).change(); + } else if (i == 'date_end'){ + $('#text-date_end').val(value); + } else if (i == 'date_init'){ + $('#text-date_init').val(value); + } else if (i == 'date_text'){ + $('#text-date_text').val(value); + } else if (i == 'date_units'){ + $('#date_units').val(value).change(); + } else if (i == 'time_end'){ + $('#text-time_end').val(value); + } else if (i == 'time_init'){ + $('#text-time_init').val(value); } }); } @@ -408,7 +446,14 @@ function save_new_filter() { "save_log_filter" : 1, "id_name" : $("#text-id_name").val(), "text" : $("#text-filter_text").val(), - "period" : $("#filter_period :selected").val(), + "custom_date": $('#hidden-custom_date').val(), + "date": $('#date option:selected').val(), + "date_text": $('#text-date_text').val(), + "date_units": $('#date_units option:selected').val(), + "date_init": $('#text-date_init').val(), + "time_init": $('#text-time_init').val(), + "date_end": $('#text-date_end').val(), + "time_end": $('#text-time_end').val(), "ip" : $('#text-filter_ip').val(), "type" : $('#filter_type :selected').val(), "user" : $('#filter_user :selected').val(), @@ -444,7 +489,14 @@ function save_update_filter() { "update_log_filter" : 1, "id" : $("#overwrite_filter :selected").val(), "text" : $("#text-filter_text").val(), - "period" : $("#filter_period :selected").val(), + "custom_date": $('#hidden-custom_date').val(), + "date": $('#date option:selected').val(), + "date_text": $('#text-date_text').val(), + "date_units": $('#date_units option:selected').val(), + "date_init": $('#text-date_init').val(), + "time_init": $('#text-time_init').val(), + "date_end": $('#text-date_end').val(), + "time_end": $('#text-time_end').val(), "ip" : $('#text-filter_ip').val(), "type" : $('#filter_type :selected').val(), "user" : $('#filter_user :selected').val(), diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 921a1e1bc0..1e529c487c 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1486,27 +1486,53 @@ if (check_login()) { metaconsole_connect($server); } - if ($params['histogram'] === true) { - $params['id_agent_module'] = $params['agent_module_id']; - $params['dinamic_proc'] = 1; + if ($params['enable_projected_period'] === '1') { + $params_graphic = [ + 'period' => $params['period'], + 'date' => strtotime(date('Y-m-d H:i:s')), + 'only_image' => false, + 'homeurl' => ui_get_full_url(false, false, false, false).'/', + 'ttl' => false, + 'height' => $config['graph_image_height'], + 'landscape' => $content['landscape'], + 'return_img_base_64' => true, + ]; + $params_combined = [ + 'projection' => $params['period_projected'], + ]; + + $return['chart'] = graphic_combined_module( + [$params['agent_module_id']], + $params_graphic, + $params_combined + ); $output .= '
'; - if ($params['compare'] === 'separated') { + $output .= $return['chart']; + $output .= '
'; + } else { + if ($params['histogram'] === true) { + $params['id_agent_module'] = $params['agent_module_id']; + $params['dinamic_proc'] = 1; + + $output .= '
'; + if ($params['compare'] === 'separated') { + $graph = \reporting_module_histogram_graph( + ['datetime' => ($params['begin_date'] - $params['period'])], + $params + ); + $output .= $graph['chart']; + } + $graph = \reporting_module_histogram_graph( - ['datetime' => ($params['begin_date'] - $params['period'])], + ['datetime' => $params['begin_date']], $params ); $output .= $graph['chart']; + $output .= '
'; + } else { + $output .= grafico_modulo_sparse($params); } - - $graph = \reporting_module_histogram_graph( - ['datetime' => $params['begin_date']], - $params - ); - $output .= $graph['chart']; - $output .= ''; - } else { - $output .= grafico_modulo_sparse($params); } if (is_metaconsole() === true && empty($server_id) === false) { diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index f35f4e4e6d..261ffac531 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -201,23 +201,8 @@ class AuditLog extends HTML 'name' => 'filter_text', ], [ - 'label' => __('Max. hours old'), - 'type' => 'select', - 'class' => 'w20px', - 'select2_enable' => true, - 'sort' => false, - 'selected' => 168, - 'fields' => [ - 24 => __('1 day'), - 168 => __('7 days'), - 360 => __('15 days'), - 744 => __('1 month'), - 2160 => __('3 months'), - 4320 => __('6 months'), - 8760 => __('1 Year'), - ], - 'id' => 'filter_period', - 'name' => 'filter_period', + 'label' => __('Date'), + 'type' => 'date_range', ], [ 'label' => __('IP'), @@ -312,10 +297,35 @@ class AuditLog extends HTML $filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $this->filterIp); } - if (empty($this->filterPeriod) === false) { - $filter .= sprintf(' AND fecha >= DATE_ADD(NOW(), INTERVAL -%d HOUR)', $this->filterPeriod); + // Calculate range dates. + $custom_date = $filters['custom_date']; + if ($custom_date === '1') { + $date_from = ($filters['date_init'].' '.$filters['time_init']); + $date_to = ($filters['date_end'].' '.$filters['time_end']); + } else if ($custom_date === '2') { + $period = ($filters['date_text'] * $filters['date_units']); + $date_to = date('Y-m-d H:i:s'); + $date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $period)); + } else if (in_array($filters['date'], ['this_week', 'this_month', 'past_week', 'past_month'])) { + if ($filters['date'] === 'this_week') { + $date_from = date('Y-m-d 00:00:00', strtotime('last monday')); + $date_to = date('Y-m-d 23:59:59', strtotime($date_from.' +6 days')); + } else if ($filters['date'] === 'this_month') { + $date_from = date('Y-m-d 23:59:59', strtotime('first day of this month')); + $date_to = date('Y-m-d 00:00:00', strtotime('last day of this month')); + } else if ($filters['date'] === 'past_month') { + $date_from = date('Y-m-d 00:00:00', strtotime('first day of previous month')); + $date_to = date('Y-m-d 23:59:59', strtotime('last day of previous month')); + } else if ($filters['date'] === 'past_week') { + $date_from = date('Y-m-d 00:00:00', strtotime('monday', strtotime('last week'))); + $date_to = date('Y-m-d 23:59:59', strtotime('sunday', strtotime('last week'))); + } + } else { + $date_to = date('Y-m-d H:i:s'); + $date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $filters['date'])); } + $filter .= sprintf(' AND fecha BETWEEN "%s" AND "%s"', $date_from, $date_to); $count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter)); if ($length !== '-1') { diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 4a2c32de2e..86132d3956 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -549,6 +549,11 @@ class SnmpConsole extends HTML $order = get_datatable_order(true); $filters = get_parameter('filter', []); + // Build ranges. + $now_timestamp = time(); + $interval_seconds = ($filters['filter_hours_ago'] * 3600); + $ago_timestamp = ($now_timestamp - $interval_seconds); + // Build ranges. $now = new DateTime(); $ago = new DateTime(); @@ -688,7 +693,7 @@ class SnmpConsole extends HTML if ($date_from_trap != '') { if ($time_from_trap != '') { $whereSubquery .= ' - AND (UNIX_TIMESTAMP(timestamp) > UNIX_TIMESTAMP("'.$date_from_trap.' '.$time_from_trap.'")) + AND (utimestamp > '.$ago_timestamp.') '; } else { $whereSubquery .= ' @@ -700,7 +705,7 @@ class SnmpConsole extends HTML if ($date_to_trap != '') { if ($time_to_trap) { $whereSubquery .= ' - AND (UNIX_TIMESTAMP(timestamp) < UNIX_TIMESTAMP("'.$date_to_trap.' '.$time_to_trap.'")) + AND (utimestamp < '.$now_timestamp.') '; } else { $whereSubquery .= ' diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 47631474c7..ec8dc69f48 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230831'; +$build_version = 'PC230907'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 033b2067b6..9bda03f8fd 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1168,6 +1168,10 @@ function config_update_config() $error_update[] = __('Custom title header'); } + if (config_update_value('datepicker_first_day', (string) get_parameter('datepicker_first_day'), true) === false) { + $error_update[] = __('Datepicker first day'); + } + if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) { $error_update[] = __('Custom subtitle header'); } @@ -2751,6 +2755,10 @@ function config_process_config() config_update_value('custom_title_header', __('Pandora FMS')); } + if (!isset($config['datepicker_first_day'])) { + config_update_value('datepicker_first_day', '0'); + } + if (!isset($config['custom_subtitle_header'])) { config_update_value('custom_subtitle_header', __('the Flexible Monitoring System')); } diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 50ca449123..aee3d88730 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -125,9 +125,22 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) { $filename = $_FILES['file']['name']; $real_directory = filemanager_safe_directory($destination_directory); - $umask = io_safe_output((string) get_parameter('umask')); + $extension = pathinfo($filename, PATHINFO_EXTENSION); - if (strpos($real_directory, $default_real_directory) !== 0) { + $umask = io_safe_output((string) get_parameter('umask')); + $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); + $parse_sec2_query = explode('=', $parse_all_queries[1]); + $check_extension = true; + if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') { + if ((strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')) { + $check_extension = false; + } else { + $check_extension = true; + } + } + + // (strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip') + if (strpos($real_directory, $default_real_directory) !== 0 || $check_extension === false) { // Perform security check to determine whether received upload // directory is part of the default path for caller uploader and // user is not trying to access an external path (avoid @@ -177,14 +190,31 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ // Upload zip. if ($upload_zip === true) { + $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); + $parse_sec2_query = explode('=', $parse_all_queries[1]); if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false ) { $filename = $_FILES['file']['name']; $filepath = $_FILES['file']['tmp_name']; $real_directory = filemanager_safe_directory($destination_directory); + $secure = true; + if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') { + // Security control structure. + $zip = new \ZipArchive; + if ($zip->open($filepath) === true) { + for ($i = 0; $i < $zip->numFiles; $i++) { + $unzip_filename = $zip->getNameIndex($i); + $extension = pathinfo($unzip_filename, PATHINFO_EXTENSION); + if (strtolower($extension) !== 'mib') { + $secure = false; + break; + } + } + } + } - if (strpos($real_directory, $default_real_directory) !== 0) { + if (strpos($real_directory, $default_real_directory) !== 0 || $secure === false) { // Perform security check to determine whether received upload // directory is part of the default path for caller uploader // and user is not trying to access an external path (avoid diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 1b20cdfc3c..3d8eb231b9 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -7228,6 +7228,298 @@ function html_print_code_picker( } +function html_print_select_date_range( + $name, + $return, + $selected=SECONDS_1DAY, + $date_init='', + $time_init='', + $date_end='', + $time_end='', + $date_text=SECONDS_1DAY, + $class='w100p' +) { + global $config; + + if ($selected === 'custom') { + $display_extend = ''; + $display_range = 'style="display:none"'; + $display_default = 'style="display:none"'; + $custom_date = 2; + } else if ($selected === 'chose_range') { + $display_range = ''; + $display_default = 'style="display:none"'; + $display_extend = 'style="display:none"'; + $custom_date = 1; + } else { + $display_default = ''; + $display_range = 'style="display:none"'; + $display_extend = 'style="display:none"'; + $custom_date = 0; + } + + if ($date_end === '') { + $date_end = date('Y/m/d'); + } + + if ($date_init === '') { + $date_init = date('Y/m/d', strtotime($date_end.' -1 days')); + } + + if ($time_init === '') { + $time_init = date('H:i:s'); + } + + if ($time_end === '') { + $time_end = date('H:i:s'); + } + + $fields[SECONDS_1DAY] = __('Last 24hr'); + $fields['this_week'] = __('This week'); + $fields['this_month'] = __('This month'); + $fields['past_week'] = __('Past week'); + $fields['past_month'] = __('Past month'); + $fields[SECONDS_1WEEK] = __('Last 7 days'); + $fields[SECONDS_15DAYS] = __('Last 15 days'); + $fields[SECONDS_1MONTH] = __('Last 30 days'); + $fields['custom'] = __('Custom'); + $fields['chose_range'] = __('Chose start/end date period'); + + $output = html_print_input_hidden('custom_date', $custom_date, true); + $output .= '
'; + $output .= html_print_select( + $fields, + $name, + $selected, + '', + '', + 0, + true, + false, + false, + $class + ); + $output .= '
'; + $output .= '
'; + $table = new stdClass(); + $table->class = 'table-adv-filter'; + $table->data[0][0] .= '
'.__('From').':
'; + $table->data[0][0] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' '; + $table->data[0][0] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' '; + $table->data[0][0] .= '
'; + $table->data[0][0] .= '
'.__('to').':
'; + $table->data[0][0] .= html_print_input_text('date_end', $date_end, '', 12, 10, true).' '; + $table->data[0][0] .= '
'; + $table->data[0][0] .= html_print_input_text('time_end', $time_end, '', 10, 7, true).' '; + $table->data[0][0] .= ' '.html_print_image( + 'images/logs@svg.svg', + true, + [ + 'id' => 'back_default', + 'class' => ' main_menu_icon invert_filter', + 'alt' => __('List'), + 'title' => __('List'), + 'style' => 'width: 18px;', + ] + ).''; + $table->data[0][0] .= '
'; + $output .= html_print_table($table, true); + $output .= '
'; + + $units = [ + 1 => __('seconds'), + SECONDS_1MINUTE => __('minutes'), + SECONDS_1HOUR => __('hours'), + SECONDS_1DAY => __('days'), + SECONDS_1WEEK => __('weeks'), + SECONDS_1MONTH => __('months'), + SECONDS_1YEAR => __('years'), + ]; + $output .= '
'; + $output .= html_print_input_text($name.'_text', $date_text, '', false, 255, true); + $output .= html_print_select( + $units, + $name.'_units', + '1', + '', + '', + 0, + true, + false, + false, + '', + false, + ' margin-left: 5px; width: 140px;', + false, + false, + false, + '', + false, + false, + false, + false, + false + ); + $output .= ' '.html_print_image( + 'images/logs@svg.svg', + true, + [ + 'id' => 'back_default_extend', + 'class' => $name.'_toggler main_menu_icon invert_filter', + 'alt' => __('List'), + 'title' => __('List'), + 'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;', + ] + ).''; + $output .= '
'; + ui_include_time_picker(); + ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); + $output .= ""; + + if ($return === true) { + return $output; + } else { + echo $output; + } + +} + + function html_print_wizard_diagnosis( $title, $id_button, @@ -7266,4 +7558,5 @@ function html_print_wizard_diagnosis( } else { echo $output; } + } \ No newline at end of file diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index 89fe0da71e..8e69da7445 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -31,6 +31,7 @@ function inventory_get_data( $agents_ids, $inventory_module_name, $utimestamp, + $period, $inventory_search_string='', $export_csv=false, $return_mode=false, @@ -97,7 +98,7 @@ function inventory_get_data( // Prepare pagination. $url = sprintf( - '?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&order_by_agent=%s&submit_filter=%d', + '?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&period=%s&order_by_agent=%s&submit_filter=%d', $pagination_url_parameters['inventory_id_agent'], $pagination_url_parameters['inventory_agent'], $pagination_url_parameters['inventory_id_group'], @@ -105,6 +106,7 @@ function inventory_get_data( $inventory_module_name, $inventory_search_string, $utimestamp, + $period, $order_by_agent, 1 ); @@ -328,7 +330,7 @@ function inventory_get_data( $timestamp = db_get_value_sql( "SELECT timestamp FROM tagente_datos_inventory - WHERE utimestamp = $utimestamp" + WHERE utimestamp BETWEEN '".($utimestamp - $period)."' AND '".$utimestamp."'" ); } else { $timestamp = db_get_value_sql( @@ -892,6 +894,14 @@ function get_data_basic_info_sql($params, $count=false) ); } + if ($params['utimestamp'] > 0 && $count === false) { + $where .= sprintf( + ' AND utimestamp BETWEEN %d AND %d', + ($params['utimestamp'] - $params['period']), + $params['utimestamp'] + ); + } + if ($params['order'] > 0) { $str_split = explode(' ', $params['order']); switch ($str_split[0]) { diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 614c0df43e..a1927bb60a 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -143,6 +143,10 @@ function menu_print_menu(&$menu) if (empty($new_msg) === false) { $sec2 = 'operation/messages/message_edit&new_msg='.$new_msg; } + } else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite' + || $sec2 === 'enterprise/godmode/servers/manage_credential_boxes' + ) { + $sec2 = 'enterprise/godmode/servers/list_satellite'; } else { $sec2 = (string) get_parameter('sec2'); } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 730f4d77d6..027965e649 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3918,6 +3918,15 @@ function ui_print_datatable(array $parameters) $parameters['startDisabled'] = true; } + $columns_tmp = []; + foreach ($parameters['columns'] as $k_column => $v_column) { + if (isset($parameters['columns'][$k_column]['text']) === true) { + array_push($columns_tmp, $v_column['text']); + } else { + array_push($columns_tmp, $v_column); + } + } + if (!is_array($parameters['order'])) { $order = 0; $direction = 'asc'; @@ -3931,7 +3940,7 @@ function ui_print_datatable(array $parameters) } else { $order = array_search( $parameters['order']['field'], - $parameters['columns'] + $columns_tmp ); if ($order === false) { @@ -3948,7 +3957,7 @@ function ui_print_datatable(array $parameters) foreach ($parameters['no_sortable_columns'] as $key => $find) { $found = array_search( $parameters['no_sortable_columns'][$key], - $parameters['columns'] + $columns_tmp ); if ($found !== false) { @@ -4018,7 +4027,11 @@ function ui_print_datatable(array $parameters) $filter .= '
    '; foreach ($parameters['form']['inputs'] as $input) { - $filter .= html_print_input(($input + ['return' => true]), 'li'); + if ($input['type'] === 'date_range') { + $filter .= '
  • '.html_print_select_date_range('date', true).'
  • '; + } else { + $filter .= html_print_input(($input + ['return' => true]), 'li'); + } } $filter .= '
'; @@ -7100,7 +7113,7 @@ function ui_print_breadcrums($tab_name) * * @return string HTML string with the last comment of the events. */ -function ui_print_comments($comments, $truncate_limit=255) +function ui_print_comments($comment, $truncate_limit=255) { global $config; diff --git a/pandora_console/include/get_file.php b/pandora_console/include/get_file.php index aa9d9fe6dd..679fdad5ad 100644 --- a/pandora_console/include/get_file.php +++ b/pandora_console/include/get_file.php @@ -46,6 +46,18 @@ $hash = get_parameter('hash'); $file_raw = get_parameter('file'); $file = base64_decode(urldecode($file_raw)); +$secure_extension = true; +$extension = pathinfo($file, PATHINFO_EXTENSION); +if ($extension === 'php' || $extension === 'js') { + $secure_extension = false; +} + +$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); +$parse_sec2_query = explode('=', $parse_all_queries[1]); +$dirname = dirname($file); + +$path_traversal = strpos($file, '../'); + // Avoid possible inifite loop with referer. if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI'])) { $refererPath = ui_get_full_url('index.php'); @@ -53,12 +65,13 @@ if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) $refererPath = $_SERVER['HTTP_REFERER']; } -if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) || isset($_SERVER['HTTP_REFERER']) === false) { +if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) + || isset($_SERVER['HTTP_REFERER']) === false || $path_traversal !== false || $secure_extension === false +) { $errorMessage = __('Security error. Please contact the administrator.'); } else { $downloadable_file = ''; - $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); - $parse_sec2_query = explode('=', $parse_all_queries[1]); + // Metaconsole have a route distinct than node. $main_file_manager = (is_metaconsole() === true) ? 'advanced/metasetup' : 'godmode/setup/file_manager'; $main_collections = (is_metaconsole() === true) ? 'advanced/collections' : 'enterprise/godmode/agentes/collections'; @@ -70,7 +83,9 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c break; case 'extensions/files_repo': - $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file; + $attachment_path = io_safe_output($config['attachment_store']); + $downloadable_file = $attachment_path.'/files_repo/'.$file; + // $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file; break; case 'godmode/servers/plugin': @@ -81,6 +96,9 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/collection/'.$file; break; + case 'godmode/setup/file_manager': + $downloadable_file = ($dirname === 'image') ? $_SERVER['DOCUMENT_ROOT'].'/pandora_console/'.$file : ''; + default: // Wrong action. $downloadable_file = ''; diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 37162f5a37..56cd4a71a1 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -943,17 +943,25 @@ function pandoraFlotSlicebar( // Format functions function xFormatter(v) { - // var ct = new Date(); - var ct = new timezoneJS.Date(); - ct.setTimezone(phpTimezone); + var ct; + if (typeof timezoneJS === "undefined") { + ct = new Date(); + } else { + ct = new timezoneJS.Date(); + ct.setTimezone(phpTimezone); + } var currentTime = ct.getTime(); var diffDates = (currentTime - 1000 * datelimit) / 1000; - // var d = new Date(1000 * (v + datelimit)); - var d = new timezoneJS.Date(1000 * (v + datelimit)); - d.setTimezone(phpTimezone); + var d; + if (typeof timezoneJS === "undefined") { + d = new Date(1000 * (v + datelimit)); + } else { + d = new timezoneJS.Date(1000 * (v + datelimit)); + d.setTimezone(phpTimezone); + } var monthNames = [ "Jan", diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index 498602a1d1..5bfd03d244 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -83,7 +83,7 @@ function d3_relationship_graph($elements, $matrix, $width=700, $return=false, $h } -function d3_tree_map_graph($data, $width=700, $height=700, $return=false) +function d3_tree_map_graph($data, $width=700, $height=700, $return=false, $id_container='tree_map', $child_links=false) { global $config; @@ -91,7 +91,7 @@ function d3_tree_map_graph($data, $width=700, $height=700, $return=false) $data = json_encode($data); } - $output = "
"; + $output = '
"; $output .= include_javascript_d3(true); $output .= ''; $output .= ""; + if ($child_links === true) { + $output .= html_print_input_image( + 'resize_parent', + '/images/normal_screen.png', + 1, + 'background-color: white !important; padding: 4px !important;', + true, + ['class' => 'resize_button invisible'] + ); + } if (!$return) { echo $output; diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index f99f0448da..881899a1df 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -402,18 +402,24 @@ function chordDiagram(recipient, elements, matrix, width, height) { // } // ] // }; -function treeMap(recipient, data, width, height) { +function treeMap(recipient, data, width, height, childLinks = false) { //var isIE = BrowserDetect.browser == 'Explorer'; var isIE = true; var chartWidth = width; var chartHeight = height; - var consoleStyle = document.getElementById("hidden-selected_style_theme") - .value; - $("#tooltip").css( + const uniqueId = generateUniqueId(); + if (document.getElementById("hidden-selected_style_theme") !== null) { + var consoleStyle = document.getElementById("hidden-selected_style_theme") + .value; + } else { + var consoleStyle = ""; + } + + $("#tooltip_" + uniqueId).css( "color", consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)" ); - $("#tooltip").css( + $("#tooltip_" + uniqueId).css( "background-color", consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)" ); @@ -431,6 +437,9 @@ function treeMap(recipient, data, width, height) { var transitionDuration = 500; var root; var node; + var resize_button = $(recipient) + .parent() + .find(".resize_button"); var treemap = d3.layout .treemap() @@ -468,6 +477,7 @@ function treeMap(recipient, data, width, height) { .attr("class", "cell parent") .on("click", function(d) { zoom(d); + resize_button.show(); }) .append("svg") .attr("class", "clip") @@ -476,6 +486,9 @@ function treeMap(recipient, data, width, height) { }) .attr("height", headerHeight); parentEnterTransition + .filter(function(d) { + if (d.name) return d; + }) .append("rect") .attr("width", function(d) { return Math.max(0.01, d.dx); @@ -483,6 +496,9 @@ function treeMap(recipient, data, width, height) { .attr("height", headerHeight) .style("fill", headerColor); parentEnterTransition + .filter(function(d) { + if (d.name) return d; + }) .append("text") .attr("class", "label") .attr("fill", "white") @@ -490,6 +506,7 @@ function treeMap(recipient, data, width, height) { .attr("width", function(d) { return Math.max(0.01, d.dx); }) + .attr("style", "transition: all 0.5s ease-out;") .attr("height", headerHeight) .text(function(d) { return d.name; @@ -521,6 +538,10 @@ function treeMap(recipient, data, width, height) { // remove transition parentCells.exit().remove(); + $(resize_button).on("click", function() { + zoom(root); + $(this).hide(); + }); // create children cells var childrenCells = chart .selectAll("g.cell.child") @@ -534,19 +555,27 @@ function treeMap(recipient, data, width, height) { .append("g") .attr("class", "cell child") .on("click", function(d) { - zoom(node === d.parent ? root : d.parent); + if (childLinks) { + if (node === d.parent) { + window.location.href = d.link; + } else { + resize_button.show(); + zoom(d.parent); + } + } else { + zoom(node === d.parent ? root : d.parent); + } }) - .on("mouseover", over_user) - .on("mouseout", out_user) - .on("mousemove", move_tooltip) .append("svg") .attr("class", "clip"); - + $(recipient).on("mouseover", over_user); + $(recipient).on("mouseout", out_user); + $(recipient).on("mousemove", move_tooltip); childEnterTransition .append("rect") .classed("background", true) .style("fill", function(d) { - return color(d.name); + return d.color ? d.color : color(d.name); }); childEnterTransition @@ -608,6 +637,30 @@ function treeMap(recipient, data, width, height) { zoom(node); + function calculateSizeText() { + $(recipient + " .parent .clip .label").each((key, node) => { + const textElement = node; + const containerWidth = parseFloat( + $(textElement) + .parent() + .attr("width") + ); + const originalFontSize = 12; + + textElement.style.fontSize = "16px"; + const computedTextLength = textElement.getComputedTextLength(); + const textWidth = computedTextLength + 8; + textElement.style.fontSize = originalFontSize + "px"; + + const scaleFactor = containerWidth / textWidth; + let scaledFontSize = parseFloat(originalFontSize) * scaleFactor; + + scaledFontSize = scaledFontSize > 12 ? 12 : scaledFontSize; + + textElement.style.fontSize = scaledFontSize + "px"; + }); + } + function size(d) { return d.size; } @@ -728,6 +781,9 @@ function treeMap(recipient, data, width, height) { if (d3.event) { d3.event.stopPropagation(); } + setTimeout(() => { + calculateSizeText(); + }, transitionDuration); } function position() { @@ -746,11 +802,10 @@ function treeMap(recipient, data, width, height) { } function move_tooltip(d) { - x = d3.event.pageX + 10; - y = d3.event.pageY + 10; - - $("#tooltip").css("left", x + "px"); - $("#tooltip").css("top", y + "px"); + x = d.offsetX + 40; + y = d.offsetY + 40; + $("#tooltip_" + uniqueId).css("left", x + "px"); + $("#tooltip_" + uniqueId).css("top", y + "px"); } function over_user(d) { @@ -772,17 +827,17 @@ function treeMap(recipient, data, width, height) { } function create_tooltip(d, x, y) { - if ($("#tooltip").length == 0) { + if ($("#tooltip_" + uniqueId).length == 0) { $(recipient).append( $("
") - .attr("id", "tooltip") - .html(d.tooltip_content) + .attr("id", "tooltip_" + uniqueId) + .html(d.target.__data__.tooltip_content) ); } else { - $("#tooltip").html(d.tooltip_content); + $("#tooltip_" + uniqueId).html(d.target.__data__.tooltip_content); } - $("#tooltip").attr( + $("#tooltip_" + uniqueId).attr( "style", "background: #fff;" + "color: #111;" + @@ -805,14 +860,22 @@ function treeMap(recipient, data, width, height) { } function show_tooltip(d) { - x = d3.event.pageX + 10; - y = d3.event.pageY + 10; - - create_tooltip(d, x, y); + x = d.offsetX + 10; + y = d.offsetY + 10; + if (d.target.__data__) { + create_tooltip(d, x, y); + } } function hide_tooltip() { - $("#tooltip").hide(); + $("#tooltip_" + uniqueId).hide(); + } + + function generateUniqueId() { + const timestamp = new Date().getTime(); + const randomNum = Math.floor(Math.random() * 10000); + const uniqueId = `${timestamp}-${randomNum}`; + return uniqueId; } } diff --git a/pandora_console/include/javascript/jquery-ui.min.js b/pandora_console/include/javascript/jquery-ui.min.js index 50b036f4d2..c39e5c7792 100644 --- a/pandora_console/include/javascript/jquery-ui.min.js +++ b/pandora_console/include/javascript/jquery-ui.min.js @@ -3,4 +3,4 @@ * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ -!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0")[0],w=d.each;function P(t){return null==t?t+"":"object"==typeof t?p[e.call(t)]||"object":typeof t}function M(t,e,i){var s=v[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function S(s){var n=m(),o=n._rgba=[];return s=s.toLowerCase(),w(g,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[_[e].cache]=i[_[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&d.extend(o,B.transparent),n):B[s]}function H(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}y.style.cssText="background-color:rgba(1,1,1,.5)",b.rgba=-1o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=m(t)._rgba;return m(d.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=d.map(this._rgba,function(t,e){return null!=t?t:2").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=j+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=G(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},Y={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){Y[t]=function(t){return Math.pow(t,e+2)}}),V.extend(Y,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(Y,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});y=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V(""),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("
    ").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("
    ").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("
    ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(V("
    ").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e))},100))}});V.ui.autocomplete;var tt=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"
    ",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(tt,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("
    ").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V(""),this.iconSpace=V(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var et;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"
",x=o?"":"",g=0;g<7;g++)x+="";for(w+=x+"",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P",M=o?"":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T"+(H&&!u?" ":z?""+T.getDate()+"":""+T.getDate()+"")+"",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+""}11<++K&&(K=0,U++),_+=w+="
"+this._get(t,"weekHeader")+""+r[k]+"
"+this._get(t,"calculateWeek")(T)+"
"+(Y?""+(0":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="
",y="";if(o||!f)y+=""+a[e]+"";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+=""}if(m||(b+=y+(!o&&f&&g?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!g)b+=""+i+"";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":" ")+y),b+="
"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new st,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker,V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var rt=!1;V(document).on("mouseup",function(){rt=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!rt){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),rt=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,rt=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0},r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("
").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("
"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("").button({label:V("").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=V("
"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("
").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("
").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("
").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog;function lt(t,e,i){return e<=t&&t").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("
").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("
"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return ll||i.righth||i.bottoma&&i.rightr&&i.bottom",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("