diff --git a/acf.php b/acf.php
index 2039742..3f5d4ce 100644
--- a/acf.php
+++ b/acf.php
@@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com/
Description: Customise WordPress with powerful, professional and intuitive fields
-Version: 5.5.11
+Version: 5.5.14
Author: Elliot Condon
Author URI: http://www.elliotcondon.com/
Copyright: Elliot Condon
@@ -17,6 +17,9 @@ if( ! class_exists('acf') ) :
class acf {
+ // vars
+ var $version = '5.5.14';
+
/*
* __construct
@@ -58,41 +61,49 @@ class acf {
// basic
'name' => __('Advanced Custom Fields', 'acf'),
- 'version' => '5.5.11',
+ 'version' => $this->version,
// urls
+ 'file' => __FILE__,
'basename' => plugin_basename( __FILE__ ),
'path' => plugin_dir_path( __FILE__ ),
'dir' => plugin_dir_url( __FILE__ ),
// options
- 'show_admin' => true,
- 'show_updates' => true,
- 'stripslashes' => false,
- 'local' => true,
- 'json' => true,
- 'save_json' => '',
- 'load_json' => array(),
- 'default_language' => '',
- 'current_language' => '',
- 'capability' => 'manage_options',
- 'uploader' => 'wp',
- 'autoload' => false,
- 'l10n' => true,
- 'l10n_textdomain' => '',
- 'google_api_key' => '',
- 'google_api_client' => '',
- 'enqueue_google_maps' => true,
+ 'show_admin' => true,
+ 'show_updates' => true,
+ 'stripslashes' => false,
+ 'local' => true,
+ 'json' => true,
+ 'save_json' => '',
+ 'load_json' => array(),
+ 'default_language' => '',
+ 'current_language' => '',
+ 'capability' => 'manage_options',
+ 'uploader' => 'wp',
+ 'autoload' => false,
+ 'l10n' => true,
+ 'l10n_textdomain' => '',
+ 'google_api_key' => '',
+ 'google_api_client' => '',
+ 'enqueue_google_maps' => true,
'enqueue_select2' => true,
'enqueue_datepicker' => true,
'enqueue_datetimepicker' => true,
'select2_version' => 3,
- 'row_index_offset' => 1
+ 'row_index_offset' => 1,
+ 'remove_wp_meta_box' => false // todo: set to true in 5.6.0
);
+ // constants
+ $this->define( 'ACF', true );
+ $this->define( 'ACF_VERSION', $this->settings['version'] );
+ $this->define( 'ACF_PATH', $this->settings['path'] );
+
+
// include helpers
- include_once('api/api-helpers.php');
+ include_once( ACF_PATH . 'api/api-helpers.php');
// api
@@ -202,16 +213,12 @@ class acf {
acf_update_setting('dir', plugin_dir_url( __FILE__ ));
- // set text domain
- load_textdomain( 'acf', acf_get_path( 'lang/acf-' . acf_get_locale() . '.mo' ) );
+ // textdomain
+ $this->load_plugin_textdomain();
// include wpml support
- if( defined('ICL_SITEPRESS_VERSION') ) {
-
- acf_include('core/wpml.php');
-
- }
+ if( defined('ICL_SITEPRESS_VERSION') ) acf_include('core/wpml.php');
// field types
@@ -223,7 +230,6 @@ class acf {
acf_include('fields/password.php');
acf_include('fields/wysiwyg.php');
acf_include('fields/oembed.php');
- //acf_include('fields/output.php');
acf_include('fields/image.php');
acf_include('fields/file.php');
acf_include('fields/select.php');
@@ -258,6 +264,37 @@ class acf {
}
+ /*
+ * load_plugin_textdomain
+ *
+ * This function will load the textdomain file
+ *
+ * @type function
+ * @date 3/5/17
+ * @since 5.5.13
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ function load_plugin_textdomain() {
+
+ // vars
+ $domain = 'acf';
+ $locale = apply_filters( 'plugin_locale', acf_get_locale(), $domain );
+ $mofile = $domain . '-' . $locale . '.mo';
+
+
+ // load from the languages directory first
+ load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile );
+
+
+ // load from plugin lang folder
+ load_textdomain( $domain, acf_get_path( 'lang/' . $mofile ) );
+
+ }
+
+
/*
* register_post_types
*
@@ -454,6 +491,27 @@ class acf {
}
+ /*
+ * define
+ *
+ * This function will safely define a constant
+ *
+ * @type function
+ * @date 3/5/17
+ * @since 5.5.13
+ *
+ * @param $name (string)
+ * @param $value (mixed)
+ * @return n/a
+ */
+
+ function define( $name, $value = true ) {
+
+ if( !defined($name) ) define( $name, $value );
+
+ }
+
+
/*
* get_setting
*
diff --git a/api/api-helpers.php b/api/api-helpers.php
index 6490c9a..64658b5 100644
--- a/api/api-helpers.php
+++ b/api/api-helpers.php
@@ -427,11 +427,17 @@ function acf_parse_type( $v ) {
* @return n/a
*/
-function acf_get_view( $view_name = '', $args = array() ) {
-
- // vars
- $path = acf_get_path("admin/views/{$view_name}.php");
+function acf_get_view( $path = '', $args = array() ) {
+ // allow view file name shortcut
+ if( substr($path, -4) !== '.php' ) {
+
+ $path = acf_get_path("admin/views/{$path}.php");
+
+ }
+
+
+ // include
if( file_exists($path) ) {
include( $path );
@@ -1123,7 +1129,7 @@ function acf_get_full_version( $version = '1' ) {
function acf_get_locale() {
- return function_exists('get_user_locale') ? get_user_locale() : get_locale();
+ return is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
}
diff --git a/assets/css/acf-field-group.css b/assets/css/acf-field-group.css
index 8072912..7f82a0c 100644
--- a/assets/css/acf-field-group.css
+++ b/assets/css/acf-field-group.css
@@ -347,10 +347,28 @@ table.conditional-logic-rules tbody td {
* Field: Date Picker
*
*---------------------------------------------------------------------------------------------*/
-.acf-field-object-date_picker .acf-radio-list span {
+.acf-field-object-date-picker .acf-radio-list li,
+.acf-field-object-time-picker .acf-radio-list li,
+.acf-field-object-date-time-picker .acf-radio-list li {
+ line-height: 25px;
+}
+.acf-field-object-date-picker .acf-radio-list span,
+.acf-field-object-time-picker .acf-radio-list span,
+.acf-field-object-date-time-picker .acf-radio-list span {
display: inline-block;
+ min-width: 10em;
+}
+.acf-field-object-date-picker .acf-radio-list input[type="text"],
+.acf-field-object-time-picker .acf-radio-list input[type="text"],
+.acf-field-object-date-time-picker .acf-radio-list input[type="text"] {
width: 100px;
}
+.acf-field-object-date-time-picker .acf-radio-list span {
+ min-width: 15em;
+}
+.acf-field-object-date-time-picker .acf-radio-list input[type="text"] {
+ width: 200px;
+}
/*--------------------------------------------------------------------------------------------
*
* RTL
diff --git a/assets/css/acf-input.css b/assets/css/acf-input.css
index f59e099..46f6277 100644
--- a/assets/css/acf-input.css
+++ b/assets/css/acf-input.css
@@ -485,6 +485,22 @@ html[dir="rtl"] input.acf-is-prepended.acf-is-appended {
border-color: #bbb;
background: #f9f9f9;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
+ /* sortable item*/
+ /* sortable shadow */
+}
+.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper {
+ background: #5897fb;
+ border-color: #3f87fa;
+ color: #fff;
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
+}
+.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper a {
+ visibility: hidden;
+}
+.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-placeholder {
+ background-color: #f7f7f7;
+ border-color: #f7f7f7;
+ visibility: visible !important;
}
.select2-container.-acf .select2-choices .select2-search-choice-focus {
border-color: #999;
@@ -551,11 +567,31 @@ html[dir="rtl"] .select2-container.-acf .select2-choice .select2-arrow {
* Select2 (v4)
*
*---------------------------------------------------------------------------------------------*/
-.select2-selection.-acf li {
+.select2-container.-acf li {
margin-bottom: 0;
}
-.select2-selection.-acf input {
- box-shadow: none;
+.select2-container--default.-acf .select2-selection--multiple {
+ /* multiple choice item */
+}
+.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice {
+ background-color: #f7f7f7;
+ border-color: #cccccc;
+ /* sortable item*/
+ /* sortable shadow */
+}
+.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper {
+ background: #5897fb;
+ border-color: #3f87fa;
+ color: #fff;
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
+}
+.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper span {
+ visibility: hidden;
+}
+.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder {
+ background-color: #f7f7f7;
+ border-color: #f7f7f7;
+ visibility: visible !important;
}
/*---------------------------------------------------------------------------------------------
*
@@ -1042,10 +1078,6 @@ html[dir="rtl"] .acf-relationship .selection .values .acf-icon {
.acf-editor-wrap.tmce-active .wp-editor-area {
color: #333 !important;
}
-/* fix z-index behind media modal */
-div.mce-toolbar-grp.mce-inline-toolbar-grp {
- z-index: 170000;
-}
/*---------------------------------------------------------------------------------------------
*
* Tab
diff --git a/assets/inc/select2/4/select2.css b/assets/inc/select2/4/select2.css
index d365213..447b2b8 100644
--- a/assets/inc/select2/4/select2.css
+++ b/assets/inc/select2/4/select2.css
@@ -18,6 +18,8 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
+ .select2-container .select2-selection--single .select2-selection__clear {
+ position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
@@ -40,7 +42,8 @@
box-sizing: border-box;
border: none;
font-size: 100%;
- margin-top: 5px; }
+ margin-top: 5px;
+ padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
@@ -113,14 +116,14 @@
filter: alpha(opacity=0); }
.select2-hidden-accessible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px; }
+ border: 0 !important;
+ clip: rect(0 0 0 0) !important;
+ height: 1px !important;
+ margin: -1px !important;
+ overflow: hidden !important;
+ padding: 0 !important;
+ position: absolute !important;
+ width: 1px !important; }
.select2-container--default .select2-selection--single {
background-color: #fff;
@@ -152,19 +155,24 @@
position: absolute;
top: 50%;
width: 0; }
+
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
+
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
+
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
+
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
+
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
@@ -176,6 +184,8 @@
margin: 0;
padding: 0 5px;
width: 100%; }
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
+ list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
@@ -203,43 +213,60 @@
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
-.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder {
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
+
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
+
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
+
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
+
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
+
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
+
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
+
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
+
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
+
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
- outline: 0; }
+ outline: 0;
+ box-shadow: none;
+ -webkit-appearance: textfield; }
+
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
+
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
+
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
+
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
+
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
@@ -259,24 +286,26 @@
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
+
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
+
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
- background-color: #f6f6f6;
+ background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
- background-image: -webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);
- background-image: -o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);
- background-image: linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);
+ background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); }
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
@@ -304,7 +333,7 @@
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); }
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
@@ -316,8 +345,10 @@
position: absolute;
top: 50%;
width: 0; }
+
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
+
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
@@ -326,6 +357,7 @@
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
+
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
@@ -334,24 +366,27 @@
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
+
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
- background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
- background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
- background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);
+ background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); }
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
+
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
- background-image: -webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);
- background-image: -o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);
- background-image: linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); }
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
+
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
@@ -383,49 +418,67 @@
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; }
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
+
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
+
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
+
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
+
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
+
.select2-container--classic .select2-search--inline .select2-search__field {
- outline: 0; }
+ outline: 0;
+ box-shadow: none; }
+
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
+
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
+
.select2-container--classic .select2-dropdown--below {
border-top: none; }
+
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
+
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
+
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
+
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
+
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
+
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
diff --git a/assets/inc/select2/4/select2.full.js b/assets/inc/select2/4/select2.full.js
index dd0e8bc..e750834 100644
--- a/assets/inc/select2/4/select2.full.js
+++ b/assets/inc/select2/4/select2.full.js
@@ -1,5 +1,5 @@
/*!
- * Select2 4.0.0
+ * Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
@@ -30,7 +30,7 @@
var S2;(function () { if (!S2 || !S2.requirejs) {
if (!S2) { S2 = {}; } else { require = S2; }
/**
- * @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
+ * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
@@ -75,12 +75,6 @@ var requirejs, require, define;
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
- //Convert baseName to array, and lop off the last part,
- //so that . matches that "directory" and not name of the baseName's
- //module. For instance, baseName of "one/two/three", maps to
- //"one/two/three.js", but we want the directory, "one/two" for
- //this normalization.
- baseParts = baseParts.slice(0, baseParts.length - 1);
name = name.split('/');
lastIndex = name.length - 1;
@@ -89,7 +83,11 @@ var requirejs, require, define;
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
- name = baseParts.concat(name);
+ //Lop off the last part of baseParts, so that . matches the
+ //"directory" and not name of the baseName's module. For instance,
+ //baseName of "one/two/three", maps to "one/two/three.js", but we
+ //want the directory, "one/two" for this normalization.
+ name = baseParts.slice(0, baseParts.length - 1).concat(name);
//start trimDots
for (i = 0; i < name.length; i += 1) {
@@ -181,7 +179,15 @@ var requirejs, require, define;
//A version of a require function that passes a moduleName
//value for items that may need to
//look up paths relative to the moduleName
- return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync]));
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
};
}
@@ -431,6 +437,9 @@ var requirejs, require, define;
requirejs._defined = defined;
define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
//This module may not have dependencies
if (!deps.splice) {
@@ -597,9 +606,23 @@ S2.define('select2/utils',[
Observable.prototype.trigger = function (event) {
var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
this.listeners = this.listeners || {};
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
if (event in this.listeners) {
this.invoke(this.listeners[event], slice.call(arguments, 1));
}
@@ -773,7 +796,8 @@ S2.define('select2/results',[
this.hideLoading();
var $message = $(
- '
'
+ ' '
);
var message = this.options.get('translations').get(params.message);
@@ -784,9 +808,15 @@ S2.define('select2/results',[
)
);
+ $message[0].className += ' select2-results__message';
+
this.$results.append($message);
};
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
Results.prototype.append = function (data) {
this.hideLoading();
@@ -826,6 +856,25 @@ S2.define('select2/results',[
return sorter(data);
};
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[aria-selected]');
+
+ var $selected = $options.filter('[aria-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
Results.prototype.setClasses = function () {
var self = this;
@@ -853,17 +902,6 @@ S2.define('select2/results',[
}
});
- var $selected = $options.filter('[aria-selected=true]');
-
- // Check if there are any selected options
- if ($selected.length > 0) {
- // If there are selected options, highlight the first
- $selected.first().trigger('mouseenter');
- } else {
- // If there are no selected options, highlight the first option
- // in the dropdown
- $options.first().trigger('mouseenter');
- }
});
};
@@ -974,6 +1012,7 @@ S2.define('select2/results',[
if (container.isOpen()) {
self.setClasses();
+ self.highlightFirstItem();
}
});
@@ -986,6 +1025,7 @@ S2.define('select2/results',[
});
container.on('query', function (params) {
+ self.hideMessages();
self.showLoading(params);
});
@@ -995,6 +1035,7 @@ S2.define('select2/results',[
}
self.setClasses();
+ self.highlightFirstItem();
});
container.on('unselect', function () {
@@ -1003,6 +1044,7 @@ S2.define('select2/results',[
}
self.setClasses();
+ self.highlightFirstItem();
});
container.on('open', function () {
@@ -1041,7 +1083,7 @@ S2.define('select2/results',[
var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') {
- self.trigger('close');
+ self.trigger('close', {});
} else {
self.trigger('select', {
data: data
@@ -1125,11 +1167,7 @@ S2.define('select2/results',[
this.$results.on('mousewheel', function (e) {
var top = self.$results.scrollTop();
- var bottom = (
- self.$results.get(0).scrollHeight -
- self.$results.scrollTop() +
- e.deltaY
- );
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
@@ -1163,7 +1201,7 @@ S2.define('select2/results',[
data: data
});
} else {
- self.trigger('close');
+ self.trigger('close', {});
}
return;
@@ -1229,7 +1267,7 @@ S2.define('select2/results',[
var template = this.options.get('templateResult');
var escapeMarkup = this.options.get('escapeMarkup');
- var content = template(result);
+ var content = template(result, container);
if (content == null) {
container.style.display = 'none';
@@ -1286,7 +1324,7 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.render = function () {
var $selection = $(
'' +
+ ' aria-haspopup="true" aria-expanded="false">' +
' '
);
@@ -1319,7 +1357,7 @@ S2.define('select2/selection/base',[
});
this.$selection.on('blur', function (evt) {
- self.trigger('blur', evt);
+ self._handleBlur(evt);
});
this.$selection.on('keydown', function (evt) {
@@ -1366,6 +1404,24 @@ S2.define('select2/selection/base',[
});
};
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
@@ -1466,6 +1522,12 @@ S2.define('select2/selection/single',[
// User exits the container
});
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
container.on('selection:update', function (params) {
self.update(params.data);
});
@@ -1475,11 +1537,11 @@ S2.define('select2/selection/single',[
this.$selection.find('.select2-selection__rendered').empty();
};
- SingleSelection.prototype.display = function (data) {
+ SingleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
- return escapeMarkup(template(data));
+ return escapeMarkup(template(data, container));
};
SingleSelection.prototype.selectionContainer = function () {
@@ -1494,9 +1556,9 @@ S2.define('select2/selection/single',[
var selection = data[0];
- var formatted = this.display(selection);
-
var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
$rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
};
@@ -1538,29 +1600,37 @@ S2.define('select2/selection/multiple',[
});
});
- this.$selection.on('click', '.select2-selection__choice__remove',
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
function (evt) {
- var $remove = $(this);
- var $selection = $remove.parent();
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
- var data = $selection.data('data');
+ var $remove = $(this);
+ var $selection = $remove.parent();
- self.trigger('unselect', {
- originalEvent: evt,
- data: data
- });
- });
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
};
MultipleSelection.prototype.clear = function () {
this.$selection.find('.select2-selection__rendered').empty();
};
- MultipleSelection.prototype.display = function (data) {
+ MultipleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
- return escapeMarkup(template(data));
+ return escapeMarkup(template(data, container));
};
MultipleSelection.prototype.selectionContainer = function () {
@@ -1587,8 +1657,8 @@ S2.define('select2/selection/multiple',[
for (var d = 0; d < data.length; d++) {
var selection = data[d];
- var formatted = this.display(selection);
var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection);
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
@@ -1720,7 +1790,7 @@ S2.define('select2/selection/allowClear',[
this.$element.val(this.placeholder.id).trigger('change');
- this.trigger('toggle');
+ this.trigger('toggle', {});
};
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
@@ -1768,7 +1838,7 @@ S2.define('select2/selection/search',[
'' +
' ' +
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
' '
);
@@ -1777,6 +1847,8 @@ S2.define('select2/selection/search',[
var $rendered = decorated.call(this);
+ this._transferTabIndex();
+
return $rendered;
};
@@ -1786,32 +1858,39 @@ S2.define('select2/selection/search',[
decorated.call(this, container, $container);
container.on('open', function () {
- self.$search.attr('tabindex', 0);
-
- self.$search.focus();
+ self.$search.trigger('focus');
});
container.on('close', function () {
- self.$search.attr('tabindex', -1);
-
self.$search.val('');
- self.$search.focus();
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.trigger('focus');
});
container.on('enable', function () {
self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
});
container.on('disable', function () {
self.$search.prop('disabled', true);
});
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.id);
+ });
+
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
- self.trigger('blur', evt);
+ self._handleBlur(evt);
});
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
@@ -1837,18 +1916,73 @@ S2.define('select2/selection/search',[
}
});
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
- this.$selection.on('input', '.select2-search--inline', function (evt) {
- // Unbind the duplicated `keyup` event
- self.$selection.off('keyup.search');
- });
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
- this.$selection.on('keyup.search input', '.select2-search--inline',
- function (evt) {
- self.handleSearch(evt);
- });
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
};
Search.prototype.createPlaceholder = function (decorated, placeholder) {
@@ -1856,6 +1990,8 @@ S2.define('select2/selection/search',[
};
Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
this.$search.attr('placeholder', '');
decorated.call(this, data);
@@ -1864,6 +2000,9 @@ S2.define('select2/selection/search',[
.append(this.$searchContainer);
this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
};
Search.prototype.handleSearch = function () {
@@ -1885,9 +2024,8 @@ S2.define('select2/selection/search',[
data: item
});
- this.trigger('open');
-
- this.$search.val(item.text + ' ');
+ this.$search.val(item.text);
+ this.handleSearch();
};
Search.prototype.resizeSearch = function () {
@@ -3221,9 +3359,9 @@ S2.define('select2/data/array',[
var $existingOption = $existing.filter(onlyItem(item));
var existingData = this.item($existingOption);
- var newData = $.extend(true, {}, existingData, item);
+ var newData = $.extend(true, {}, item, existingData);
- var $newOption = this.option(existingData);
+ var $newOption = this.option(newData);
$existingOption.replaceWith($newOption);
@@ -3259,7 +3397,7 @@ S2.define('select2/data/ajax',[
this.processResults = this.ajaxOptions.processResults;
}
- ArrayAdapter.__super__.constructor.call(this, $element, options);
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
}
Utils.Extend(AjaxAdapter, ArrayAdapter);
@@ -3267,9 +3405,9 @@ S2.define('select2/data/ajax',[
AjaxAdapter.prototype._applyDefaults = function (options) {
var defaults = {
data: function (params) {
- return {
+ return $.extend({}, params, {
q: params.term
- };
+ });
},
transport: function (params, success, failure) {
var $request = $.ajax(params);
@@ -3306,11 +3444,11 @@ S2.define('select2/data/ajax',[
}, this.ajaxOptions);
if (typeof options.url === 'function') {
- options.url = options.url(params);
+ options.url = options.url.call(this.$element, params);
}
if (typeof options.data === 'function') {
- options.data = options.data(params);
+ options.data = options.data.call(this.$element, params);
}
function request () {
@@ -3329,13 +3467,21 @@ S2.define('select2/data/ajax',[
callback(results);
}, function () {
- // TODO: Handle AJAX errors
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
});
self._request = $request;
}
- if (this.ajaxOptions.delay && params.term !== '') {
+ if (this.ajaxOptions.delay && params.term != null) {
if (this._queryTimeout) {
window.clearTimeout(this._queryTimeout);
}
@@ -3361,6 +3507,12 @@ S2.define('select2/data/tags',[
this.createTag = createTag;
}
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
decorated.call(this, $element, options);
if ($.isArray(tags)) {
@@ -3492,13 +3644,38 @@ S2.define('select2/data/tokenizer',[
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
function select (data) {
- self.select(data);
+ self.trigger('select', {
+ data: data
+ });
}
params.term = params.term || '';
- var tokenData = this.tokenizer(params, this.options, select);
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
@@ -3541,6 +3718,11 @@ S2.define('select2/data/tokenizer',[
var data = createTag(partParams);
+ if (data == null) {
+ i++;
+ continue;
+ }
+
callback(data);
// Reset the term to not include the tokenized portion
@@ -3678,6 +3860,10 @@ S2.define('select2/dropdown',[
return $dropdown;
};
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implmented in subclasses
};
@@ -3754,6 +3940,12 @@ S2.define('select2/dropdown/search',[
self.$search.val('');
});
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
@@ -3904,7 +4096,9 @@ S2.define('select2/dropdown/infiniteScroll',[
InfiniteScroll.prototype.createLoadingMore = function () {
var $option = $(
- ' '
+ ' '
);
var message = this.options.get('translations').get('loadingMore');
@@ -3922,7 +4116,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils'
], function ($, Utils) {
function AttachBody (decorated, $element, options) {
- this.$dropdownParent = options.get('dropdownParent') || document.body;
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options);
}
@@ -3963,6 +4157,12 @@ S2.define('select2/dropdown/attachBody',[
});
};
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
// Clone all of the container classes
$dropdown.attr('class', $container.attr('class'));
@@ -3993,7 +4193,8 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach();
};
- AttachBody.prototype._attachPositioningHandler = function (container) {
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
var self = this;
var scrollEvent = 'scroll.select2.' + container.id;
@@ -4020,7 +4221,8 @@ S2.define('select2/dropdown/attachBody',[
});
};
- AttachBody.prototype._detachPositioningHandler = function (container) {
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
@@ -4039,7 +4241,6 @@ S2.define('select2/dropdown/attachBody',[
var newDirection = null;
- var position = this.$container.position();
var offset = this.$container.offset();
offset.bottom = offset.top + this.$container.outerHeight(false);
@@ -4068,6 +4269,20 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
@@ -4080,7 +4295,7 @@ S2.define('select2/dropdown/attachBody',[
if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
- css.top = container.top - dropdown.height;
+ css.top = container.top - parentOffset.top - dropdown.height;
}
if (newDirection != null) {
@@ -4096,14 +4311,13 @@ S2.define('select2/dropdown/attachBody',[
};
AttachBody.prototype._resizeDropdown = function () {
- this.$dropdownContainer.width();
-
var css = {
width: this.$container.outerWidth(false) + 'px'
};
if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
+ css.position = 'relative';
css.width = 'auto';
}
@@ -4170,20 +4384,41 @@ S2.define('select2/dropdown/selectOnClose',[
decorated.call(this, container, $container);
- container.on('close', function () {
- self._handleSelectOnClose();
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
});
};
- SelectOnClose.prototype._handleSelectOnClose = function () {
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
var $highlightedResults = this.getHighlightedResults();
+ // Only select highlighted results
if ($highlightedResults.length < 1) {
return;
}
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
this.trigger('select', {
- data: $highlightedResults.data('data')
+ data: data
});
};
@@ -4217,7 +4452,10 @@ S2.define('select2/dropdown/closeOnSelect',[
return;
}
- this.trigger('close');
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
};
return CloseOnSelect;
@@ -4325,7 +4563,7 @@ S2.define('select2/defaults',[
}
Defaults.prototype.apply = function (options) {
- options = $.extend({}, this.defaults, options);
+ options = $.extend(true, {}, this.defaults, options);
if (options.dataAdapter == null) {
if (options.ajax != null) {
@@ -4868,8 +5106,8 @@ S2.define('select2/core',[
// Hide the original select
$element.addClass('select2-hidden-accessible');
- $element.attr('aria-hidden', 'true');
-
+ $element.attr('aria-hidden', 'true');
+
// Synchronize any monitored attributes
this._syncAttributes();
@@ -4889,6 +5127,7 @@ S2.define('select2/core',[
id = Utils.generateChars(4);
}
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
id = 'select2-' + id;
return id;
@@ -4970,10 +5209,15 @@ S2.define('select2/core',[
});
});
- this._sync = Utils.bind(this._syncAttributes, this);
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
if (this.$element[0].attachEvent) {
- this.$element[0].attachEvent('onpropertychange', this._sync);
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
}
var observer = window.MutationObserver ||
@@ -4983,14 +5227,30 @@ S2.define('select2/core',[
if (observer != null) {
this._observer = new observer(function (mutations) {
- $.each(mutations, self._sync);
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
});
this._observer.observe(this.$element[0], {
attributes: true,
+ childList: true,
subtree: false
});
} else if (this.$element[0].addEventListener) {
- this.$element[0].addEventListener('DOMAttrModified', self._sync, false);
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
}
};
@@ -5004,12 +5264,16 @@ S2.define('select2/core',[
Select2.prototype._registerSelectionEvents = function () {
var self = this;
- var nonRelayEvents = ['toggle'];
+ var nonRelayEvents = ['toggle', 'focus'];
this.selection.on('toggle', function () {
self.toggleDropdown();
});
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
this.selection.on('*', function (name, params) {
if ($.inArray(name, nonRelayEvents) !== -1) {
return;
@@ -5054,17 +5318,13 @@ S2.define('select2/core',[
self.$container.addClass('select2-container--disabled');
});
- this.on('focus', function () {
- self.$container.addClass('select2-container--focus');
- });
-
this.on('blur', function () {
self.$container.removeClass('select2-container--focus');
});
this.on('query', function (params) {
if (!self.isOpen()) {
- self.trigger('open');
+ self.trigger('open', {});
}
this.dataAdapter.query(params, function (data) {
@@ -5088,30 +5348,31 @@ S2.define('select2/core',[
var key = evt.which;
if (self.isOpen()) {
- if (key === KEYS.ENTER) {
- self.trigger('results:select');
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
- self.trigger('results:toggle');
+ self.trigger('results:toggle', {});
evt.preventDefault();
} else if (key === KEYS.UP) {
- self.trigger('results:previous');
+ self.trigger('results:previous', {});
evt.preventDefault();
} else if (key === KEYS.DOWN) {
- self.trigger('results:next');
-
- evt.preventDefault();
- } else if (key === KEYS.ESC || key === KEYS.TAB) {
- self.close();
+ self.trigger('results:next', {});
evt.preventDefault();
}
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
- ((key === KEYS.DOWN || key === KEYS.UP) && evt.altKey)) {
+ (key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
@@ -5128,9 +5389,49 @@ S2.define('select2/core',[
this.close();
}
- this.trigger('disable');
+ this.trigger('disable', {});
} else {
- this.trigger('enable');
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
}
};
@@ -5147,6 +5448,10 @@ S2.define('select2/core',[
'unselect': 'unselecting'
};
+ if (args === undefined) {
+ args = {};
+ }
+
if (name in preTriggerMap) {
var preTriggerName = preTriggerMap[name];
var preTriggerArgs = {
@@ -5185,8 +5490,6 @@ S2.define('select2/core',[
}
this.trigger('query', {});
-
- this.trigger('open');
};
Select2.prototype.close = function () {
@@ -5194,13 +5497,27 @@ S2.define('select2/core',[
return;
}
- this.trigger('close');
+ this.trigger('close', {});
};
Select2.prototype.isOpen = function () {
return this.$container.hasClass('select2-container--open');
};
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
Select2.prototype.enable = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
@@ -5264,7 +5581,7 @@ S2.define('select2/core',[
this.$container.remove();
if (this.$element[0].detachEvent) {
- this.$element[0].detachEvent('onpropertychange', this._sync);
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
}
if (this._observer != null) {
@@ -5272,16 +5589,21 @@ S2.define('select2/core',[
this._observer = null;
} else if (this.$element[0].removeEventListener) {
this.$element[0]
- .removeEventListener('DOMAttrModified', this._sync, false);
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
}
- this._sync = null;
+ this._syncA = null;
+ this._syncS = null;
this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
- this.$element.attr('aria-hidden', 'false');
+ this.$element.attr('aria-hidden', 'false');
this.$element.removeData('select2');
this.dataAdapter.destroy();
@@ -5385,7 +5707,7 @@ S2.define('select2/compat/containerCss',[
containerCssAdapter = containerCssAdapter || _containerAdapter;
if (containerCssClass.indexOf(':all:') !== -1) {
- containerCssClass = containerCssClass.replace(':all', '');
+ containerCssClass = containerCssClass.replace(':all:', '');
var _cssAdapter = containerCssAdapter;
@@ -5442,7 +5764,7 @@ S2.define('select2/compat/dropdownCss',[
dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
if (dropdownCssClass.indexOf(':all:') !== -1) {
- dropdownCssClass = dropdownCssClass.replace(':all', '');
+ dropdownCssClass = dropdownCssClass.replace(':all:', '');
var _cssAdapter = dropdownCssAdapter;
@@ -5813,76 +6135,18 @@ S2.define('select2/selection/stopPropagation',[
return StopPropagation;
});
-S2.define('jquery.select2',[
- 'jquery',
- 'require',
-
- './select2/core',
- './select2/defaults'
-], function ($, require, Select2, Defaults) {
- // Force jQuery.mousewheel to be loaded if it hasn't already
- require('jquery.mousewheel');
-
- if ($.fn.select2 == null) {
- // All methods that should return the element
- var thisMethods = ['open', 'close', 'destroy'];
-
- $.fn.select2 = function (options) {
- options = options || {};
-
- if (typeof options === 'object') {
- this.each(function () {
- var instanceOptions = $.extend({}, options, true);
-
- var instance = new Select2($(this), instanceOptions);
- });
-
- return this;
- } else if (typeof options === 'string') {
- var instance = this.data('select2');
-
- if (instance == null && window.console && console.error) {
- console.error(
- 'The select2(\'' + options + '\') method was called on an ' +
- 'element that is not using Select2.'
- );
- }
-
- var args = Array.prototype.slice.call(arguments, 1);
-
- var ret = instance[options](args);
-
- // Check if we should be returning `this`
- if ($.inArray(options, thisMethods) > -1) {
- return this;
- }
-
- return ret;
- } else {
- throw new Error('Invalid arguments for Select2: ' + options);
- }
- };
- }
-
- if ($.fn.select2.defaults == null) {
- $.fn.select2.defaults = Defaults;
- }
-
- return Select2;
-});
-
/*!
- * jQuery Mousewheel 3.1.12
+ * jQuery Mousewheel 3.1.13
*
- * Copyright 2014 jQuery Foundation and other contributors
- * Released under the MIT license.
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
* http://jquery.org/license
*/
(function (factory) {
if ( typeof S2.define === 'function' && S2.define.amd ) {
// AMD. Register as an anonymous module.
- S2.define('jquery.mousewheel',['jquery'], factory);
+ S2.define('jquery-mousewheel',['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
@@ -6093,6 +6357,64 @@ S2.define('jquery.select2',[
}));
+S2.define('jquery.select2',[
+ 'jquery',
+ 'jquery-mousewheel',
+
+ './select2/core',
+ './select2/defaults'
+], function ($, _, Select2, Defaults) {
+ if ($.fn.select2 == null) {
+ // All methods that should return the element
+ var thisMethods = ['open', 'close', 'destroy'];
+
+ $.fn.select2 = function (options) {
+ options = options || {};
+
+ if (typeof options === 'object') {
+ this.each(function () {
+ var instanceOptions = $.extend(true, {}, options);
+
+ var instance = new Select2($(this), instanceOptions);
+ });
+
+ return this;
+ } else if (typeof options === 'string') {
+ var ret;
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
+
+ // Check if we should be returning `this`
+ if ($.inArray(options, thisMethods) > -1) {
+ return this;
+ }
+
+ return ret;
+ } else {
+ throw new Error('Invalid arguments for Select2: ' + options);
+ }
+ };
+ }
+
+ if ($.fn.select2.defaults == null) {
+ $.fn.select2.defaults = Defaults;
+ }
+
+ return Select2;
+});
+
// Return the AMD loader configuration so it can be used outside of this file
return {
define: S2.define,
diff --git a/assets/inc/select2/4/select2.full.min.js b/assets/inc/select2/4/select2.full.min.js
index 59d8c1a..684edf3 100644
--- a/assets/inc/select2/4/select2.full.min.js
+++ b/assets/inc/select2/4/select2.full.min.js
@@ -1,3 +1,3 @@
-/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a(" ")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('× ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery.mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
+/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('× ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
+if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
+},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
diff --git a/assets/inc/select2/4/select2.js b/assets/inc/select2/4/select2.js
index fbaca5e..13b84fa 100644
--- a/assets/inc/select2/4/select2.js
+++ b/assets/inc/select2/4/select2.js
@@ -1,5 +1,5 @@
/*!
- * Select2 4.0.0
+ * Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
@@ -30,7 +30,7 @@
var S2;(function () { if (!S2 || !S2.requirejs) {
if (!S2) { S2 = {}; } else { require = S2; }
/**
- * @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
+ * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
@@ -75,12 +75,6 @@ var requirejs, require, define;
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
- //Convert baseName to array, and lop off the last part,
- //so that . matches that "directory" and not name of the baseName's
- //module. For instance, baseName of "one/two/three", maps to
- //"one/two/three.js", but we want the directory, "one/two" for
- //this normalization.
- baseParts = baseParts.slice(0, baseParts.length - 1);
name = name.split('/');
lastIndex = name.length - 1;
@@ -89,7 +83,11 @@ var requirejs, require, define;
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
- name = baseParts.concat(name);
+ //Lop off the last part of baseParts, so that . matches the
+ //"directory" and not name of the baseName's module. For instance,
+ //baseName of "one/two/three", maps to "one/two/three.js", but we
+ //want the directory, "one/two" for this normalization.
+ name = baseParts.slice(0, baseParts.length - 1).concat(name);
//start trimDots
for (i = 0; i < name.length; i += 1) {
@@ -181,7 +179,15 @@ var requirejs, require, define;
//A version of a require function that passes a moduleName
//value for items that may need to
//look up paths relative to the moduleName
- return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync]));
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
};
}
@@ -431,6 +437,9 @@ var requirejs, require, define;
requirejs._defined = defined;
define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
//This module may not have dependencies
if (!deps.splice) {
@@ -597,9 +606,23 @@ S2.define('select2/utils',[
Observable.prototype.trigger = function (event) {
var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
this.listeners = this.listeners || {};
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
if (event in this.listeners) {
this.invoke(this.listeners[event], slice.call(arguments, 1));
}
@@ -773,7 +796,8 @@ S2.define('select2/results',[
this.hideLoading();
var $message = $(
- ' '
+ ' '
);
var message = this.options.get('translations').get(params.message);
@@ -784,9 +808,15 @@ S2.define('select2/results',[
)
);
+ $message[0].className += ' select2-results__message';
+
this.$results.append($message);
};
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
Results.prototype.append = function (data) {
this.hideLoading();
@@ -826,6 +856,25 @@ S2.define('select2/results',[
return sorter(data);
};
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[aria-selected]');
+
+ var $selected = $options.filter('[aria-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
Results.prototype.setClasses = function () {
var self = this;
@@ -853,17 +902,6 @@ S2.define('select2/results',[
}
});
- var $selected = $options.filter('[aria-selected=true]');
-
- // Check if there are any selected options
- if ($selected.length > 0) {
- // If there are selected options, highlight the first
- $selected.first().trigger('mouseenter');
- } else {
- // If there are no selected options, highlight the first option
- // in the dropdown
- $options.first().trigger('mouseenter');
- }
});
};
@@ -974,6 +1012,7 @@ S2.define('select2/results',[
if (container.isOpen()) {
self.setClasses();
+ self.highlightFirstItem();
}
});
@@ -986,6 +1025,7 @@ S2.define('select2/results',[
});
container.on('query', function (params) {
+ self.hideMessages();
self.showLoading(params);
});
@@ -995,6 +1035,7 @@ S2.define('select2/results',[
}
self.setClasses();
+ self.highlightFirstItem();
});
container.on('unselect', function () {
@@ -1003,6 +1044,7 @@ S2.define('select2/results',[
}
self.setClasses();
+ self.highlightFirstItem();
});
container.on('open', function () {
@@ -1041,7 +1083,7 @@ S2.define('select2/results',[
var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') {
- self.trigger('close');
+ self.trigger('close', {});
} else {
self.trigger('select', {
data: data
@@ -1125,11 +1167,7 @@ S2.define('select2/results',[
this.$results.on('mousewheel', function (e) {
var top = self.$results.scrollTop();
- var bottom = (
- self.$results.get(0).scrollHeight -
- self.$results.scrollTop() +
- e.deltaY
- );
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
@@ -1163,7 +1201,7 @@ S2.define('select2/results',[
data: data
});
} else {
- self.trigger('close');
+ self.trigger('close', {});
}
return;
@@ -1229,7 +1267,7 @@ S2.define('select2/results',[
var template = this.options.get('templateResult');
var escapeMarkup = this.options.get('escapeMarkup');
- var content = template(result);
+ var content = template(result, container);
if (content == null) {
container.style.display = 'none';
@@ -1286,7 +1324,7 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.render = function () {
var $selection = $(
'' +
+ ' aria-haspopup="true" aria-expanded="false">' +
' '
);
@@ -1319,7 +1357,7 @@ S2.define('select2/selection/base',[
});
this.$selection.on('blur', function (evt) {
- self.trigger('blur', evt);
+ self._handleBlur(evt);
});
this.$selection.on('keydown', function (evt) {
@@ -1366,6 +1404,24 @@ S2.define('select2/selection/base',[
});
};
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
@@ -1466,6 +1522,12 @@ S2.define('select2/selection/single',[
// User exits the container
});
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
container.on('selection:update', function (params) {
self.update(params.data);
});
@@ -1475,11 +1537,11 @@ S2.define('select2/selection/single',[
this.$selection.find('.select2-selection__rendered').empty();
};
- SingleSelection.prototype.display = function (data) {
+ SingleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
- return escapeMarkup(template(data));
+ return escapeMarkup(template(data, container));
};
SingleSelection.prototype.selectionContainer = function () {
@@ -1494,9 +1556,9 @@ S2.define('select2/selection/single',[
var selection = data[0];
- var formatted = this.display(selection);
-
var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
$rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
};
@@ -1538,29 +1600,37 @@ S2.define('select2/selection/multiple',[
});
});
- this.$selection.on('click', '.select2-selection__choice__remove',
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
function (evt) {
- var $remove = $(this);
- var $selection = $remove.parent();
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
- var data = $selection.data('data');
+ var $remove = $(this);
+ var $selection = $remove.parent();
- self.trigger('unselect', {
- originalEvent: evt,
- data: data
- });
- });
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
};
MultipleSelection.prototype.clear = function () {
this.$selection.find('.select2-selection__rendered').empty();
};
- MultipleSelection.prototype.display = function (data) {
+ MultipleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
- return escapeMarkup(template(data));
+ return escapeMarkup(template(data, container));
};
MultipleSelection.prototype.selectionContainer = function () {
@@ -1587,8 +1657,8 @@ S2.define('select2/selection/multiple',[
for (var d = 0; d < data.length; d++) {
var selection = data[d];
- var formatted = this.display(selection);
var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection);
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
@@ -1720,7 +1790,7 @@ S2.define('select2/selection/allowClear',[
this.$element.val(this.placeholder.id).trigger('change');
- this.trigger('toggle');
+ this.trigger('toggle', {});
};
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
@@ -1768,7 +1838,7 @@ S2.define('select2/selection/search',[
'' +
' ' +
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
' '
);
@@ -1777,6 +1847,8 @@ S2.define('select2/selection/search',[
var $rendered = decorated.call(this);
+ this._transferTabIndex();
+
return $rendered;
};
@@ -1786,32 +1858,39 @@ S2.define('select2/selection/search',[
decorated.call(this, container, $container);
container.on('open', function () {
- self.$search.attr('tabindex', 0);
-
- self.$search.focus();
+ self.$search.trigger('focus');
});
container.on('close', function () {
- self.$search.attr('tabindex', -1);
-
self.$search.val('');
- self.$search.focus();
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.trigger('focus');
});
container.on('enable', function () {
self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
});
container.on('disable', function () {
self.$search.prop('disabled', true);
});
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.id);
+ });
+
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
- self.trigger('blur', evt);
+ self._handleBlur(evt);
});
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
@@ -1837,18 +1916,73 @@ S2.define('select2/selection/search',[
}
});
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
- this.$selection.on('input', '.select2-search--inline', function (evt) {
- // Unbind the duplicated `keyup` event
- self.$selection.off('keyup.search');
- });
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
- this.$selection.on('keyup.search input', '.select2-search--inline',
- function (evt) {
- self.handleSearch(evt);
- });
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
};
Search.prototype.createPlaceholder = function (decorated, placeholder) {
@@ -1856,6 +1990,8 @@ S2.define('select2/selection/search',[
};
Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
this.$search.attr('placeholder', '');
decorated.call(this, data);
@@ -1864,6 +2000,9 @@ S2.define('select2/selection/search',[
.append(this.$searchContainer);
this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
};
Search.prototype.handleSearch = function () {
@@ -1885,9 +2024,8 @@ S2.define('select2/selection/search',[
data: item
});
- this.trigger('open');
-
- this.$search.val(item.text + ' ');
+ this.$search.val(item.text);
+ this.handleSearch();
};
Search.prototype.resizeSearch = function () {
@@ -3221,9 +3359,9 @@ S2.define('select2/data/array',[
var $existingOption = $existing.filter(onlyItem(item));
var existingData = this.item($existingOption);
- var newData = $.extend(true, {}, existingData, item);
+ var newData = $.extend(true, {}, item, existingData);
- var $newOption = this.option(existingData);
+ var $newOption = this.option(newData);
$existingOption.replaceWith($newOption);
@@ -3259,7 +3397,7 @@ S2.define('select2/data/ajax',[
this.processResults = this.ajaxOptions.processResults;
}
- ArrayAdapter.__super__.constructor.call(this, $element, options);
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
}
Utils.Extend(AjaxAdapter, ArrayAdapter);
@@ -3267,9 +3405,9 @@ S2.define('select2/data/ajax',[
AjaxAdapter.prototype._applyDefaults = function (options) {
var defaults = {
data: function (params) {
- return {
+ return $.extend({}, params, {
q: params.term
- };
+ });
},
transport: function (params, success, failure) {
var $request = $.ajax(params);
@@ -3306,11 +3444,11 @@ S2.define('select2/data/ajax',[
}, this.ajaxOptions);
if (typeof options.url === 'function') {
- options.url = options.url(params);
+ options.url = options.url.call(this.$element, params);
}
if (typeof options.data === 'function') {
- options.data = options.data(params);
+ options.data = options.data.call(this.$element, params);
}
function request () {
@@ -3329,13 +3467,21 @@ S2.define('select2/data/ajax',[
callback(results);
}, function () {
- // TODO: Handle AJAX errors
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
});
self._request = $request;
}
- if (this.ajaxOptions.delay && params.term !== '') {
+ if (this.ajaxOptions.delay && params.term != null) {
if (this._queryTimeout) {
window.clearTimeout(this._queryTimeout);
}
@@ -3361,6 +3507,12 @@ S2.define('select2/data/tags',[
this.createTag = createTag;
}
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
decorated.call(this, $element, options);
if ($.isArray(tags)) {
@@ -3492,13 +3644,38 @@ S2.define('select2/data/tokenizer',[
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
function select (data) {
- self.select(data);
+ self.trigger('select', {
+ data: data
+ });
}
params.term = params.term || '';
- var tokenData = this.tokenizer(params, this.options, select);
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
@@ -3541,6 +3718,11 @@ S2.define('select2/data/tokenizer',[
var data = createTag(partParams);
+ if (data == null) {
+ i++;
+ continue;
+ }
+
callback(data);
// Reset the term to not include the tokenized portion
@@ -3678,6 +3860,10 @@ S2.define('select2/dropdown',[
return $dropdown;
};
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implmented in subclasses
};
@@ -3754,6 +3940,12 @@ S2.define('select2/dropdown/search',[
self.$search.val('');
});
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
@@ -3904,7 +4096,9 @@ S2.define('select2/dropdown/infiniteScroll',[
InfiniteScroll.prototype.createLoadingMore = function () {
var $option = $(
- ' '
+ ' '
);
var message = this.options.get('translations').get('loadingMore');
@@ -3922,7 +4116,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils'
], function ($, Utils) {
function AttachBody (decorated, $element, options) {
- this.$dropdownParent = options.get('dropdownParent') || document.body;
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options);
}
@@ -3963,6 +4157,12 @@ S2.define('select2/dropdown/attachBody',[
});
};
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
// Clone all of the container classes
$dropdown.attr('class', $container.attr('class'));
@@ -3993,7 +4193,8 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach();
};
- AttachBody.prototype._attachPositioningHandler = function (container) {
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
var self = this;
var scrollEvent = 'scroll.select2.' + container.id;
@@ -4020,7 +4221,8 @@ S2.define('select2/dropdown/attachBody',[
});
};
- AttachBody.prototype._detachPositioningHandler = function (container) {
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
@@ -4039,7 +4241,6 @@ S2.define('select2/dropdown/attachBody',[
var newDirection = null;
- var position = this.$container.position();
var offset = this.$container.offset();
offset.bottom = offset.top + this.$container.outerHeight(false);
@@ -4068,6 +4269,20 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
@@ -4080,7 +4295,7 @@ S2.define('select2/dropdown/attachBody',[
if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
- css.top = container.top - dropdown.height;
+ css.top = container.top - parentOffset.top - dropdown.height;
}
if (newDirection != null) {
@@ -4096,14 +4311,13 @@ S2.define('select2/dropdown/attachBody',[
};
AttachBody.prototype._resizeDropdown = function () {
- this.$dropdownContainer.width();
-
var css = {
width: this.$container.outerWidth(false) + 'px'
};
if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
+ css.position = 'relative';
css.width = 'auto';
}
@@ -4170,20 +4384,41 @@ S2.define('select2/dropdown/selectOnClose',[
decorated.call(this, container, $container);
- container.on('close', function () {
- self._handleSelectOnClose();
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
});
};
- SelectOnClose.prototype._handleSelectOnClose = function () {
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
var $highlightedResults = this.getHighlightedResults();
+ // Only select highlighted results
if ($highlightedResults.length < 1) {
return;
}
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
this.trigger('select', {
- data: $highlightedResults.data('data')
+ data: data
});
};
@@ -4217,7 +4452,10 @@ S2.define('select2/dropdown/closeOnSelect',[
return;
}
- this.trigger('close');
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
};
return CloseOnSelect;
@@ -4325,7 +4563,7 @@ S2.define('select2/defaults',[
}
Defaults.prototype.apply = function (options) {
- options = $.extend({}, this.defaults, options);
+ options = $.extend(true, {}, this.defaults, options);
if (options.dataAdapter == null) {
if (options.ajax != null) {
@@ -4868,8 +5106,8 @@ S2.define('select2/core',[
// Hide the original select
$element.addClass('select2-hidden-accessible');
- $element.attr('aria-hidden', 'true');
-
+ $element.attr('aria-hidden', 'true');
+
// Synchronize any monitored attributes
this._syncAttributes();
@@ -4889,6 +5127,7 @@ S2.define('select2/core',[
id = Utils.generateChars(4);
}
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
id = 'select2-' + id;
return id;
@@ -4970,10 +5209,15 @@ S2.define('select2/core',[
});
});
- this._sync = Utils.bind(this._syncAttributes, this);
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
if (this.$element[0].attachEvent) {
- this.$element[0].attachEvent('onpropertychange', this._sync);
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
}
var observer = window.MutationObserver ||
@@ -4983,14 +5227,30 @@ S2.define('select2/core',[
if (observer != null) {
this._observer = new observer(function (mutations) {
- $.each(mutations, self._sync);
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
});
this._observer.observe(this.$element[0], {
attributes: true,
+ childList: true,
subtree: false
});
} else if (this.$element[0].addEventListener) {
- this.$element[0].addEventListener('DOMAttrModified', self._sync, false);
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
}
};
@@ -5004,12 +5264,16 @@ S2.define('select2/core',[
Select2.prototype._registerSelectionEvents = function () {
var self = this;
- var nonRelayEvents = ['toggle'];
+ var nonRelayEvents = ['toggle', 'focus'];
this.selection.on('toggle', function () {
self.toggleDropdown();
});
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
this.selection.on('*', function (name, params) {
if ($.inArray(name, nonRelayEvents) !== -1) {
return;
@@ -5054,17 +5318,13 @@ S2.define('select2/core',[
self.$container.addClass('select2-container--disabled');
});
- this.on('focus', function () {
- self.$container.addClass('select2-container--focus');
- });
-
this.on('blur', function () {
self.$container.removeClass('select2-container--focus');
});
this.on('query', function (params) {
if (!self.isOpen()) {
- self.trigger('open');
+ self.trigger('open', {});
}
this.dataAdapter.query(params, function (data) {
@@ -5088,30 +5348,31 @@ S2.define('select2/core',[
var key = evt.which;
if (self.isOpen()) {
- if (key === KEYS.ENTER) {
- self.trigger('results:select');
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
- self.trigger('results:toggle');
+ self.trigger('results:toggle', {});
evt.preventDefault();
} else if (key === KEYS.UP) {
- self.trigger('results:previous');
+ self.trigger('results:previous', {});
evt.preventDefault();
} else if (key === KEYS.DOWN) {
- self.trigger('results:next');
-
- evt.preventDefault();
- } else if (key === KEYS.ESC || key === KEYS.TAB) {
- self.close();
+ self.trigger('results:next', {});
evt.preventDefault();
}
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
- ((key === KEYS.DOWN || key === KEYS.UP) && evt.altKey)) {
+ (key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
@@ -5128,9 +5389,49 @@ S2.define('select2/core',[
this.close();
}
- this.trigger('disable');
+ this.trigger('disable', {});
} else {
- this.trigger('enable');
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
}
};
@@ -5147,6 +5448,10 @@ S2.define('select2/core',[
'unselect': 'unselecting'
};
+ if (args === undefined) {
+ args = {};
+ }
+
if (name in preTriggerMap) {
var preTriggerName = preTriggerMap[name];
var preTriggerArgs = {
@@ -5185,8 +5490,6 @@ S2.define('select2/core',[
}
this.trigger('query', {});
-
- this.trigger('open');
};
Select2.prototype.close = function () {
@@ -5194,13 +5497,27 @@ S2.define('select2/core',[
return;
}
- this.trigger('close');
+ this.trigger('close', {});
};
Select2.prototype.isOpen = function () {
return this.$container.hasClass('select2-container--open');
};
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
Select2.prototype.enable = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
@@ -5264,7 +5581,7 @@ S2.define('select2/core',[
this.$container.remove();
if (this.$element[0].detachEvent) {
- this.$element[0].detachEvent('onpropertychange', this._sync);
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
}
if (this._observer != null) {
@@ -5272,16 +5589,21 @@ S2.define('select2/core',[
this._observer = null;
} else if (this.$element[0].removeEventListener) {
this.$element[0]
- .removeEventListener('DOMAttrModified', this._sync, false);
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
}
- this._sync = null;
+ this._syncA = null;
+ this._syncS = null;
this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
- this.$element.attr('aria-hidden', 'false');
+ this.$element.attr('aria-hidden', 'false');
this.$element.removeData('select2');
this.dataAdapter.destroy();
@@ -5317,16 +5639,20 @@ S2.define('select2/core',[
return Select2;
});
+S2.define('jquery-mousewheel',[
+ 'jquery'
+], function ($) {
+ // Used to shim jQuery.mousewheel for non-full builds.
+ return $;
+});
+
S2.define('jquery.select2',[
'jquery',
- 'require',
+ 'jquery-mousewheel',
'./select2/core',
'./select2/defaults'
-], function ($, require, Select2, Defaults) {
- // Force jQuery.mousewheel to be loaded if it hasn't already
- require('jquery.mousewheel');
-
+], function ($, _, Select2, Defaults) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
@@ -5336,25 +5662,28 @@ S2.define('jquery.select2',[
if (typeof options === 'object') {
this.each(function () {
- var instanceOptions = $.extend({}, options, true);
+ var instanceOptions = $.extend(true, {}, options);
var instance = new Select2($(this), instanceOptions);
});
return this;
} else if (typeof options === 'string') {
- var instance = this.data('select2');
-
- if (instance == null && window.console && console.error) {
- console.error(
- 'The select2(\'' + options + '\') method was called on an ' +
- 'element that is not using Select2.'
- );
- }
-
+ var ret;
var args = Array.prototype.slice.call(arguments, 1);
- var ret = instance[options](args);
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
// Check if we should be returning `this`
if ($.inArray(options, thisMethods) > -1) {
@@ -5375,13 +5704,6 @@ S2.define('jquery.select2',[
return Select2;
});
-S2.define('jquery.mousewheel',[
- 'jquery'
-], function ($) {
- // Used to shim jQuery.mousewheel for non-full builds.
- return $;
-});
-
// Return the AMD loader configuration so it can be used outside of this file
return {
define: S2.define,
diff --git a/assets/inc/select2/4/select2.min.css b/assets/inc/select2/4/select2.min.css
index 1c72344..76de04d 100644
--- a/assets/inc/select2/4/select2.min.css
+++ b/assets/inc/select2/4/select2.min.css
@@ -1 +1 @@
-.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px;}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap;}.select2-container .select2-search--inline{float:left;}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051;}.select2-results{display:block;}.select2-results__options{list-style:none;margin:0;padding:0;}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none;}.select2-results__option[aria-selected]{cursor:pointer;}.select2-container--open .select2-dropdown{left:0;}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-search--dropdown{display:block;padding:4px;}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box;}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-search--dropdown.select2-search--hide{display:none;}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0);}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px;}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px;}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto;}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none;}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%;}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left;}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder{float:right;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0;}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none;}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0;}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa;}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--default .select2-results__option[role=group]{padding:0;}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999;}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd;}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em;}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white;}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic .select2-selection--single{background-color:#f6f6f6;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px;}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto;}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none;}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0;}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent;}.select2-container--classic .select2-dropdown--above{border-bottom:none;}.select2-container--classic .select2-dropdown--below{border-top:none;}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--classic .select2-results__option[role=group]{padding:0;}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey;}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white;}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb;}
\ No newline at end of file
+.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
diff --git a/assets/inc/select2/4/select2.min.js b/assets/inc/select2/4/select2.min.js
index 49a988c..43f0a65 100644
--- a/assets/inc/select2/4/select2.min.js
+++ b/assets/inc/select2/4/select2.min.js
@@ -1,2 +1,3 @@
-/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a(" ")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('× ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),b.define("jquery.mousewheel",["jquery"],function(a){return a}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
+/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('× ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
+if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
+},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
\ No newline at end of file
diff --git a/assets/js/acf-input.js b/assets/js/acf-input.js
index 64721d2..c5af87c 100644
--- a/assets/js/acf-input.js
+++ b/assets/js/acf-input.js
@@ -938,45 +938,74 @@ var acf;
* @return $post_id (int)
*/
- serialize_form : function( $el ){
+ serialize_form: function( $el, prefix ){
+
+ // defaults
+ prefix = prefix || '';
+
// vars
- var data = {},
- names = {};
-
-
- // selector
- $selector = $el.find('select, textarea, input');
+ var data = {};
+ var names = {};
+ var values = $el.find('select, textarea, input').serializeArray();
// populate data
- $.each( $selector.serializeArray(), function( i, pair ) {
+ $.each( values, function( i, pair ) {
+
+ // vars
+ var name = pair.name;
+ var value = pair.value;
+
+
+ // prefix
+ if( prefix ) {
+
+ // bail early if does not contain
+ if( name.indexOf(prefix) !== 0 ) return;
+
+
+ // remove prefix
+ name = name.substr(prefix.length);
+
+
+ // name must not start as array piece
+ if( name.slice(0, 1) == '[' ) {
+
+ name = name.replace('[', '');
+ name = name.replace(']', '');
+
+ }
+
+ }
+
// initiate name
- if( pair.name.slice(-2) === '[]' ) {
+ if( name.slice(-2) === '[]' ) {
// remove []
- pair.name = pair.name.replace('[]', '');
+ name = name.slice(0, -2);
// initiate counter
- if( typeof names[ pair.name ] === 'undefined'){
+ if( typeof names[ name ] === 'undefined'){
+
+ names[ name ] = -1;
- names[ pair.name ] = -1;
}
// increase counter
- names[ pair.name ]++;
+ names[ name ]++;
// add key
- pair.name += '[' + names[ pair.name ] +']';
+ name += '[' + names[ name ] +']';
}
// append to data
- data[ pair.name ] = pair.value;
+ data[ name ] = value;
});
@@ -986,9 +1015,9 @@ var acf;
},
- serialize: function( $el ){
+ serialize: function( $el, prefix ){
- return this.serialize_form( $el );
+ return this.serialize_form.apply( this, arguments );
},
@@ -2084,6 +2113,7 @@ var acf;
// lower case
string = string.toLowerCase();
+
// return
return string;
@@ -8820,6 +8850,12 @@ var acf;
(function($){
+ // globals
+ var _select2,
+ _select23,
+ _select24;
+
+
/*
* acf.select2
*
@@ -8833,10 +8869,12 @@ var acf;
* @return n/a
*/
- acf.select2 = acf.model.extend({
+ _select2 = acf.select2 = acf.model.extend({
// vars
version: 0,
+ version3: null,
+ version4: null,
// actions
@@ -8848,7 +8886,7 @@ var acf;
/*
* ready
*
- * This function will setup vars
+ * This function will run on document ready
*
* @type function
* @date 21/06/2016
@@ -8861,161 +8899,71 @@ var acf;
ready: function(){
// determine Select2 version
- if( acf.maybe_get(window, 'Select2') ) {
-
- this.version = 3;
-
- this.l10n_v3();
-
- } else if( acf.maybe_get(window, 'jQuery.fn.select2.amd') ) {
-
- this.version = 4;
-
- }
+ this.version = this.get_version();
+
+
+ // ready
+ this.do_function('ready');
},
/*
- * l10n_v3
+ * get_version
*
- * This function will set l10n for Select2 v3
+ * This function will return the Select2 version
*
* @type function
- * @date 21/06/2016
- * @since 5.3.8
+ * @date 29/4/17
+ * @since 5.5.13
*
* @param n/a
* @return n/a
*/
- l10n_v3: function(){
+ get_version: function(){
- // vars
- var locale = acf.get('locale'),
- rtl = acf.get('rtl')
- l10n = acf._e('select');
-
-
- // bail ealry if no l10n
- if( !l10n ) return;
-
-
- // vars
- var l10n_functions = {
- formatMatches: function( matches ) {
-
- if ( 1 === matches ) {
- return l10n.matches_1;
- }
-
- return l10n.matches_n.replace('%d', matches);
- },
- formatNoMatches: function() {
- return l10n.matches_0;
- },
- formatAjaxError: function() {
- return l10n.load_fail;
- },
- formatInputTooShort: function( input, min ) {
- var number = min - input.length;
-
- if ( 1 === number ) {
- return l10n.input_too_short_1;
- }
-
- return l10n.input_too_short_n.replace( '%d', number );
- },
- formatInputTooLong: function( input, max ) {
- var number = input.length - max;
-
- if ( 1 === number ) {
- return l10n.input_too_long_1;
- }
-
- return l10n.input_too_long_n.replace( '%d', number );
- },
- formatSelectionTooBig: function( limit ) {
- if ( 1 === limit ) {
- return l10n.selection_too_long_1;
- }
-
- return l10n.selection_too_long_n.replace( '%d', limit );
- },
- formatLoadMore: function() {
- return l10n.load_more;
- },
- formatSearching: function() {
- return l10n.searching;
- }
- };
-
-
- // ensure locales exists
- // older versions of Select2 did not have a locale storage
- $.fn.select2.locales = acf.maybe_get(window, 'jQuery.fn.select2.locales', {});
-
-
- // append
- $.fn.select2.locales[ locale ] = l10n_functions;
- $.extend($.fn.select2.defaults, l10n_functions);
+ if( acf.maybe_get(window, 'Select2') ) return 3;
+ if( acf.maybe_get(window, 'jQuery.fn.select2.amd') ) return 4;
+ return 0;
},
/*
- * init
+ * do_function
*
- * This function will initialize a Select2 instance
+ * This function will call the v3 or v4 equivelant function
*
* @type function
- * @date 21/06/2016
- * @since 5.3.8
+ * @date 28/4/17
+ * @since 5.5.13
*
- * @param $select (jQuery object)
- * @param args (object)
+ * @param name (string)
+ * @param args (array)
* @return (mixed)
*/
- init: function( $select, args, $field ){
-
- // bail early if no version found
- if( !this.version ) return;
-
+ do_function: function( name, args ){
// defaults
- args = args || {};
- $field = $field || null;
+ args = args || [];
- // merge
- args = $.extend({
- allow_null: false,
- placeholder: '',
- multiple: false,
- ajax: false,
- ajax_action: ''
- }, args);
+ // vars
+ var model = 'version'+this.version;
- // v3
- if( this.version == 3 ) {
-
- return this.init_v3( $select, args, $field );
-
- // v4
- } else if( this.version == 4 ) {
-
- return this.init_v4( $select, args, $field );
-
- }
+ // bail early if not set
+ if( typeof this[model] === 'undefined' ||
+ typeof this[model][name] === 'undefined' ) return false;
- // return
- return false;
-
+ // run
+ return this[model][name].apply( this, args );
+
},
-
+
/*
* get_data
@@ -9073,7 +9021,7 @@ var acf;
},
-
+
/*
* decode_data
*
@@ -9104,7 +9052,7 @@ var acf;
// children
if( typeof v.children !== 'undefined' ) {
- data[ k ].children = acf.select2.decode_data(v.children);
+ data[ k ].children = _select2.decode_data(v.children);
}
@@ -9292,7 +9240,8 @@ var acf;
// append
val.push({
'id': $el.attr('value'),
- 'text': $el.text()
+ 'text': $el.text(),
+ '$el': $el
});
});
@@ -9302,8 +9251,293 @@ var acf;
return val;
},
-
-
+
+
+ /*
+ * get_input_value
+ *
+ * This function will return an array of values as per the hidden input
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.13
+ *
+ * @param $input (jQuery)
+ * @return (array)
+ */
+
+ get_input_value: function( $input ) {
+
+ return $input.val().split('||');
+
+ },
+
+
+ /*
+ * sync_input_value
+ *
+ * This function will save the current selected values into the hidden input
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.13
+ *
+ * @param $input (jQuery)
+ * @param $select (jQuery)
+ * @return n/a
+ */
+
+ sync_input_value: function( $input, $select ) {
+
+ $input.val( $select.val().join('||') );
+
+ },
+
+
+ /*
+ * add_option
+ *
+ * This function will add an element to a select (if it doesn't already exist)
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.13
+ *
+ * @param $select (jQuery)
+ * @param value (string)
+ * @param label (string)
+ * @return n/a
+ */
+
+ add_option: function( $select, value, label ){
+
+ if( !$select.find('option[value="'+value+'"]').length ) {
+
+ $select.append(' '+label+' ');
+
+ }
+
+ },
+
+
+ /*
+ * select_option
+ *
+ * This function will select an option
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.13
+ *
+ * @param $select (jQuery)
+ * @param value (string)
+ * @return n/a
+ */
+
+ select_option: function( $select, value ){
+
+ $select.find('option[value="'+value+'"]').prop('selected', true);
+ $select.trigger('change');
+
+ },
+
+
+ /*
+ * unselect_option
+ *
+ * This function will unselect an option
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.13
+ *
+ * @param $select (jQuery)
+ * @param value (string)
+ * @return n/a
+ */
+
+ unselect_option: function( $select, value ){
+
+ $select.find('option[value="'+value+'"]').prop('selected', false);
+ $select.trigger('change');
+
+ },
+
+
+ /*
+ * Select2 v3 or v4 functions
+ *
+ * description
+ *
+ * @type function
+ * @date 29/4/17
+ * @since 5.5.10
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ init: function( $select, args, $field ){
+
+ this.do_function( 'init', arguments );
+
+ },
+
+ destroy: function( $select ){
+
+ this.do_function( 'destroy', arguments );
+
+ },
+
+ add_value: function( $select, value, label ){
+
+ this.do_function( 'add_value', arguments );
+
+ },
+
+ remove_value: function( $select, value ){
+
+ this.do_function( 'remove_value', arguments );
+
+ },
+
+ remove_value: function( $select, value ){
+
+ this.do_function( 'remove_value', arguments );
+
+ }
+
+ });
+
+
+ /*
+ * Select2 v3
+ *
+ * This model contains the Select2 v3 functions
+ *
+ * @type function
+ * @date 28/4/17
+ * @since 5.5.10
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ _select23 = _select2.version3 = {
+
+ ready: function(){
+
+ // vars
+ var locale = acf.get('locale'),
+ rtl = acf.get('rtl')
+ l10n = acf._e('select');
+
+
+ // bail ealry if no l10n
+ if( !l10n ) return;
+
+
+ // vars
+ var l10n_functions = {
+ formatMatches: function( matches ) {
+
+ if ( 1 === matches ) {
+ return l10n.matches_1;
+ }
+
+ return l10n.matches_n.replace('%d', matches);
+ },
+ formatNoMatches: function() {
+ return l10n.matches_0;
+ },
+ formatAjaxError: function() {
+ return l10n.load_fail;
+ },
+ formatInputTooShort: function( input, min ) {
+ var number = min - input.length;
+
+ if ( 1 === number ) {
+ return l10n.input_too_short_1;
+ }
+
+ return l10n.input_too_short_n.replace( '%d', number );
+ },
+ formatInputTooLong: function( input, max ) {
+ var number = input.length - max;
+
+ if ( 1 === number ) {
+ return l10n.input_too_long_1;
+ }
+
+ return l10n.input_too_long_n.replace( '%d', number );
+ },
+ formatSelectionTooBig: function( limit ) {
+ if ( 1 === limit ) {
+ return l10n.selection_too_long_1;
+ }
+
+ return l10n.selection_too_long_n.replace( '%d', limit );
+ },
+ formatLoadMore: function() {
+ return l10n.load_more;
+ },
+ formatSearching: function() {
+ return l10n.searching;
+ }
+ };
+
+
+ // ensure locales exists
+ // older versions of Select2 did not have a locale storage
+ $.fn.select2.locales = acf.maybe_get(window, 'jQuery.fn.select2.locales', {});
+
+
+ // append
+ $.fn.select2.locales[ locale ] = l10n_functions;
+ $.extend($.fn.select2.defaults, l10n_functions);
+
+ },
+
+ set_data: function( $select, data ){
+
+ // v3
+ if( this.version == 3 ) {
+
+ $select = $select.siblings('input');
+
+ }
+
+
+ // set data
+ $select.select2('data', data);
+
+ },
+
+ append_data: function( $select, data ){
+
+ // v3
+ if( this.version == 3 ) {
+
+ $select = $select.siblings('input');
+
+ }
+
+
+
+ // vars
+ var current = $select.select2('data') || [];
+
+
+ // append
+ current.push( data );
+
+
+ // set data
+ $select.select2('data', current);
+
+ },
+
+
/*
* init_v3
*
@@ -9317,8 +9551,23 @@ var acf;
* @return args (object)
*/
- init_v3: function( $select, args, $field ){
-
+ init: function( $select, args, $field ){
+
+ // defaults
+ args = args || {};
+ $field = $field || null;
+
+
+ // merge
+ args = $.extend({
+ allow_null: false,
+ placeholder: '',
+ multiple: false,
+ ajax: false,
+ ajax_action: ''
+ }, args);
+
+
// vars
var $input = $select.siblings('input');
@@ -9436,7 +9685,7 @@ var acf;
// return
- return acf.select2.get_ajax_data(args, params, $input, $field);
+ return _select2.get_ajax_data(args, params, $input, $field);
},
results: function( data, page ){
@@ -9448,13 +9697,13 @@ var acf;
// merge together groups
setTimeout(function(){
- acf.select2.merge_results_v3();
+ _select23.merge_results();
}, 1);
// return
- return acf.select2.get_ajax_results(data, params);
+ return _select2.get_ajax_results(data, params);
}
};
@@ -9521,13 +9770,14 @@ var acf;
// add new data
if( e.added ) {
- $select.append('' + e.added.text + ' ');
+ // add item
+ _select2.add_option($select, e.added.id, e.added.text);
}
- // update val
- $select.val( e.val );
+ // select
+ _select2.select_option($select, e.val);
});
@@ -9551,7 +9801,7 @@ var acf;
* @return $post_id (int)
*/
- merge_results_v3: function(){
+ merge_results: function(){
// vars
var label = '',
@@ -9587,8 +9837,149 @@ var acf;
},
- init_v4: function( $select, args, $field ){
+ /*
+ * destroy
+ *
+ * This function will destroy a Select2
+ *
+ * @type function
+ * @date 24/12/2015
+ * @since 5.3.2
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ destroy: function( $select ){
+
+ // vars
+ var $input = $select.siblings('input');
+
+
+ // bail early if no select2
+ if( !$input.data('select2') ) return;
+
+
+ // destroy
+ $input.select2('destroy');
+
+
+ // enable select
+ $select.prop('disabled', false).removeClass('acf-disabled acf-hidden');
+ },
+
+ add_value: function( $select, value, label ){
+
+ // add and select item
+ _select2.add_option($select, value, label);
+ _select2.select_option($select, value);
+
+
+ // vars
+ var $input = $select.siblings('input');
+
+
+ // new item
+ var item = {
+ 'id': value,
+ 'text': label
+ };
+
+
+ // single
+ if( !$select.data('multiple') ) {
+
+ return $input.select2('data', item);
+
+ }
+
+
+ // get existing value
+ var values = $input.select2('data') || [];
+
+
+ // append
+ values.push(item);
+
+
+ // set data
+ return $input.select2('data', values);
+
+ },
+
+ remove_value: function( $select, value ){
+
+ // unselect option
+ _select2.unselect_option($select, value);
+
+
+ // vars
+ var $input = $select.siblings('input'),
+ current = $input.select2('data');
+
+
+ // single
+ if( !$select.data('multiple') ) {
+
+ if( current && current.id == value ) {
+
+ $input.select2('data', null);
+
+ }
+
+ // multiple
+ } else {
+
+ // filter
+ current = $.grep(current, function( item ) {
+ return item.id != value;
+ });
+
+
+ // set data
+ $input.select2('data', current);
+
+ }
+
+ }
+
+
+ };
+
+
+ /*
+ * Select2 v4
+ *
+ * This model contains the Select2 v4 functions
+ *
+ * @type function
+ * @date 28/4/17
+ * @since 5.5.10
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ _select24 = _select2.version4 = {
+
+ init: function( $select, args, $field ){
+
+ // defaults
+ args = args || {};
+ $field = $field || null;
+
+
+ // merge
+ args = $.extend({
+ allow_null: false,
+ placeholder: '',
+ multiple: false,
+ ajax: false,
+ ajax_action: ''
+ }, args);
+
+
// vars
var $input = $select.siblings('input');
@@ -9606,11 +9997,6 @@ var acf;
separator: '||',
data: [],
escapeMarkup: function( m ){ return m; }
-/*
- sorter: function (data) { console.log('sorter %o', data);
- return data;
- },
-*/
};
@@ -9621,18 +10007,13 @@ var acf;
// multiple
if( args.multiple ) {
-/*
- // vars
- var name = $select.attr('name');
-
-
- // add hidden input to each multiple selection
- select2_args.templateSelection = function( selection ){
+ // reorder opts
+ $.each(value, function( k, item ){
- return selection.text + ' ';
-
- }
-*/
+ // detach and re-append to end
+ item.$el.detach().appendTo( $select );
+
+ });
} else {
@@ -9649,20 +10030,6 @@ var acf;
}
-
- // get data
- select2_args.data = this.get_data( $select );
-
-
- // initial selection
-/*
- select2_args.initSelection = function( element, callback ) {
-
- callback( value );
-
- };
-*/
-
// remove conflicting atts
if( !args.ajax ) {
@@ -9681,13 +10048,13 @@ var acf;
data: function( params ) {
// return
- return acf.select2.get_ajax_data(args, params, $select, $field);
+ return _select2.get_ajax_data(args, params, $select, $field);
},
processResults: function( data, params ){
// vars
- var results = acf.select2.get_ajax_results(data, params);
+ var results = _select2.get_ajax_results(data, params);
// change to more
@@ -9701,7 +10068,7 @@ var acf;
// merge together groups
setTimeout(function(){
- acf.select2.merge_results_v4();
+ _select24.merge_results();
}, 1);
@@ -9713,47 +10080,94 @@ var acf;
};
-
-
}
-
-
- // multiple
-/*
- if( args.multiple ) {
-
-
-
- $select.on('select2:select', function( e ){
-
- console.log( 'select2:select %o &o', $(this), e );
-
- // vars
- var $option = $(e.params.data.element);
-
-
- // move option to begining of select
- //$(this).prepend( $option );
-
- });
-
- }
-
-*/
-
-
-
- // reorder DOM
- // - no need to reorder, the select field is needed to $_POST values
-
// filter for 3rd party customization
select2_args = acf.apply_filters( 'select2_args', select2_args, $select, args, $field );
// add select2
- var $container = $select.select2( select2_args );
+ $select.select2( select2_args );
+
+
+ // get container (Select2 v4 deos not return this from constructor)
+ var $container = $select.next('.select2-container');
+
+
+ // reorder DOM
+ // - no need to reorder, the select field is needed to $_POST values
+
+
+ // multiple
+ if( args.multiple ) {
+
+ // vars
+ var $ul = $container.find('ul');
+
+
+ // sortable
+ $ul.sortable({
+
+ stop: function( e ) {
+
+ $ul.find('.select2-selection__choice').each(function() {
+
+ // vars
+ var $option = $( $(this).data('data').element );
+
+
+ // detach and re-append to end
+ $option.detach().appendTo( $select );
+
+
+ // trigger change on input (JS error if trigger on select)
+ $input.trigger('change');
+ // update input
+ //_select2.sync_input_value( $input, $select );
+
+ });
+
+ }
+
+ });
+
+
+ // on select, move to end
+ $select.on('select2:select', function( e ){
+
+ // vars
+ var $option = $(e.params.data.element);
+
+
+ // detach and re-append to end
+ $option.detach().appendTo( $select );
+
+
+ // trigger change
+ //$select.trigger('change');
+
+ });
+
+ }
+
+
+/*
+ // update input
+ $select.on('select2:select', function( e ){
+
+ // update input
+ _select2.sync_input_value( $input, $select );
+
+ });
+
+ $select.on('select2:unselect', function( e ){
+
+ // update input
+ _select2.sync_input_value( $input, $select );
+
+ });
+*/
// clear value (allows null to be saved)
@@ -9783,7 +10197,7 @@ var acf;
* @return $post_id (int)
*/
- merge_results_v4: function(){
+ merge_results: function(){
// vars
var $prev_options = null,
@@ -9818,36 +10232,33 @@ var acf;
},
+ add_value: function( $select, value, label ){
+
+ // add and select item
+ _select2.add_option($select, value, label);
+ _select2.select_option($select, value);
+
+ },
- /*
- * destroy
- *
- * This function will destroy a Select2
- *
- * @type function
- * @date 24/12/2015
- * @since 5.3.2
- *
- * @param $post_id (int)
- * @return $post_id (int)
- */
+ remove_value: function( $select, value ){
+
+ // unselect
+ _select2.unselect_option($select, value);
+
+ },
destroy: function( $select ){
- // remove select2 container
- $select.siblings('.select2-container').remove();
+ // bail early if no select2
+ if( !$select.data('select2') ) return;
- // show input so that select2 can correctly render visible select2 container
- $select.siblings('input').show();
-
-
- // enable select
- $select.prop('disabled', false).removeClass('acf-disabled acf-hidden');
-
+ // destroy
+ $select.select2('destroy');
+
}
- });
+ };
/*
@@ -9865,16 +10276,19 @@ var acf;
acf.add_select2 = function( $select, args ) {
- acf.select2.init( $select, args );
+ _select2.init( $select, args );
}
acf.remove_select2 = function( $select ) {
- acf.select2.destroy( $select );
+ _select2.destroy( $select );
}
-
+
+})(jQuery);
+
+(function($){
// select
acf.fields.select = acf.field.extend({
@@ -9993,7 +10407,7 @@ var acf;
// get options
this.o = this.$el.data();
this.o.key = this.$field.data('key');
- this.o.text = this.$el.text();
+ this.o.text = this.$el.html();
},
@@ -11104,11 +11518,19 @@ var acf;
// select
case 'select':
- this.$el.children('input').select2('data', item);
+ //this.$el.children('input').select2('data', item);
+
+
+ // vars
+ var $select = this.$el.children('select');
+ acf.select2.add_value($select, term.term_id, term.term_label);
+
+
break;
case 'multi_select':
+/*
// vars
var $input = this.$el.children('input'),
value = $input.select2('data') || [];
@@ -11120,6 +11542,14 @@ var acf;
// update
$input.select2('data', value);
+
+
+*/
+ // vars
+ var $select = this.$el.children('select');
+ acf.select2.add_value($select, term.term_id, term.term_label);
+
+
break;
case 'checkbox':
@@ -12245,6 +12675,10 @@ var acf;
if( typeof tinymce === 'undefined' ) return;
+ // bail early if no tinyMCEPreInit.mceInit
+ if( typeof tinyMCEPreInit.mceInit === 'undefined' ) return;
+
+
// vars
var mceInit = this.get_mceInit();
@@ -12281,6 +12715,10 @@ var acf;
if( typeof quicktags === 'undefined' ) return;
+ // bail early if no tinyMCEPreInit.qtInit
+ if( typeof tinyMCEPreInit.qtInit === 'undefined' ) return;
+
+
// vars
var qtInit = this.get_qtInit();
@@ -12620,7 +13058,7 @@ ed.on('ResizeEditor', function(e) {
// bail early if no tinymce
- if( typeof tinymce === 'undefined' ) return;
+ if( !acf.isset(window,'tinymce','on') ) return;
// restore default activeEditor
@@ -12665,6 +13103,7 @@ ed.on('ResizeEditor', function(e) {
// @codekit-prepend "../js/acf-oembed.js";
// @codekit-prepend "../js/acf-radio.js";
// @codekit-prepend "../js/acf-relationship.js";
+// @codekit-prepend "../js/acf-select2.js";
// @codekit-prepend "../js/acf-select.js";
// @codekit-prepend "../js/acf-tab.js";
// @codekit-prepend "../js/acf-time-picker.js";
diff --git a/assets/js/acf-input.min.js b/assets/js/acf-input.min.js
index 7d4382a..aa1f0f6 100644
--- a/assets/js/acf-input.min.js
+++ b/assets/js/acf-input.min.js
@@ -1,3 +1,3 @@
-!function(e,t){"use strict";var i=function(){function e(){return u}function t(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("actions",e,t,i,a)),f}function i(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&d("actions",t,e),f}function a(e,t){return"string"==typeof e&&r("actions",e,t),f}function n(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("filters",e,t,i,a)),f}function s(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?d("filters",t,e):f}function o(e,t){return"string"==typeof e&&r("filters",e,t),f}function r(e,t,i,a){if(u[e][t])if(i){var n=u[e][t],s;if(a)for(s=n.length;s--;){var o=n[s];o.callback===i&&o.context===a&&n.splice(s,1)}else for(s=n.length;s--;)n[s].callback===i&&n.splice(s,1)}else u[e][t]=[]}function l(e,t,i,a,n){var s={callback:i,priority:a,context:n},o=u[e][t];o?(o.push(s),o=c(o)):o=[s],u[e][t]=o}function c(e){for(var t,i,a,n=1,s=e.length;nt.priority;)e[i]=e[i-1],--i;e[i]=t}return e}function d(e,t,i){var a=u[e][t];if(!a)return"filters"===e&&i[0];var n=0,s=a.length;if("filters"===e)for(;n0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},acf={l10n:{},o:{},update:function(e,t){this.o[e]=t},get:function(e){return"undefined"!=typeof this.o[e]?this.o[e]:null},_e:function(e,t){t=t||!1;var i=this.l10n[e]||"";return t&&(i=i[t]||""),i},add_action:function(){for(var e=arguments[0].split(" "),t=e.length,i=0;ie.length?Array(1+(t-e.length)).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,i=e,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(this.php_js.uniqidSeed,5),t&&(i+=(10*Math.random()).toFixed(8).toString()),i},serialize_form:function(e){var t={},i={};return $selector=e.find("select, textarea, input"),$.each($selector.serializeArray(),function(e,a){"[]"===a.name.slice(-2)&&(a.name=a.name.replace("[]",""),"undefined"==typeof i[a.name]&&(i[a.name]=-1),i[a.name]++,a.name+="["+i[a.name]+"]"),t[a.name]=a.value}),t},serialize:function(e){return this.serialize_form(e)},disable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;if(e.prop("disabled",!0),t){var i=e.data("acf_disabled")||[],a=i.indexOf(t);a<0&&(i.push(t),e.data("acf_disabled",i))}return!0},enable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;var i=e.data("acf_disabled")||[];if(t){var a=i.indexOf(t);a>-1&&(i.splice(a,1),e.data("acf_disabled",i))}return!i.length&&(e.prop("disabled",!1),!0)},disable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.disable($(this),t)})},disable_form:function(e,t){this.disable_el.apply(this,arguments)},enable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.enable($(this),t)})},enable_form:function(e,t){this.enable_el.apply(this,arguments)},remove_tr:function(e,t){var i=e.height(),a=e.children().length;e.addClass("acf-remove-element"),setTimeout(function(){e.removeClass("acf-remove-element"),e.html(' '),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0,e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap('
'),e.animate({opacity:0},250),e.parent(".acf-temp-wrap").animate({height:i},250,function(){$(this).remove(),"function"==typeof t&&t()})},isset:function(){var e=arguments,t=e.length,a=null,n;if(0===t)throw new Error("Empty isset");for(a=e[0],i=1;i #acf-popup"),$popup.exists())return update_popup(e);var t=['"].join("");return $("body").append(t),$("#acf-popup").on("click",".bg, .acf-close-popup",function(e){e.preventDefault(),acf.close_popup()}),this.update_popup(e)},update_popup:function(e){return $popup=$("#acf-popup"),!!$popup.exists()&&(e=$.extend({},{title:"",content:"",width:0,height:0,loading:!1},e),e.title&&$popup.find(".title h3").html(e.title),e.content&&($inner=$popup.find(".inner:first"),$inner.html(e.content),acf.do_action("append",$inner),$inner.attr("style","position: relative;"),e.height=$inner.outerHeight(),$inner.removeAttr("style")),e.width&&$popup.find(".acf-popup-box").css({width:e.width,"margin-left":0-e.width/2}),e.height&&(e.height+=44,$popup.find(".acf-popup-box").css({height:e.height,"margin-top":0-e.height/2})),e.loading?$popup.find(".loading").show():$popup.find(".loading").hide(),$popup)},close_popup:function(){$popup=$("#acf-popup"),$popup.exists()&&$popup.remove()},update_user_setting:function(e,t){$.ajax({url:acf.get("ajaxurl"),dataType:"html",type:"post",data:acf.prepare_for_ajax({action:"acf/update_user_setting",name:e,value:t})})},prepare_for_ajax:function(e){return e.nonce=acf.get("nonce"),e.post_id=acf.get("post_id"),e=acf.apply_filters("prepare_for_ajax",e)},is_ajax_success:function(e){return!(!e||!e.success)},get_ajax_message:function(e){var t={text:"",type:"error"};return e?(e.success&&(t.type="success"),e.data&&e.data.message&&(t.text=e.data.message),e.data&&e.data.error&&(t.text=e.data.error),t):t},is_in_view:function(e){var t=e.offset().top,i=t+e.height();if(t===i)return!1;var a=$(window).scrollTop(),n=a+$(window).height();return i<=n&&t>=a},val:function(e,t){var i=e.val();e.val(t),t!=i&&e.trigger("change")},str_replace:function(e,t,i){return i.split(e).join(t)},str_sanitize:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,a=function(e){return"undefined"!=typeof t[e]?t[e]:e};return e=e.replace(i,a),e=e.toLowerCase()},addslashes:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},render_select:function(e,t){var i=e.val();e.html(""),t&&$.each(t,function(t,a){var n=e;a.group&&(n=e.find('optgroup[label="'+a.group+'"]'),n.exists()||(n=$(' '),e.append(n))),n.append(''+a.label+" "),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e){"undefined"!=typeof e.length&&(e={$el:e}),e=acf.parse_args(e,{$el:!1,search:"",replace:"",before:function(e){},after:function(e,t){},append:function(e,t){e.after(t)}});var t=e.$el,i;e.search||(e.search=t.attr("data-id")),e.replace||(e.replace=acf.get_uniqid()),e.before.apply(this,[t]),acf.do_action("before_duplicate",t);var i=t.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),e.search&&(i.attr("data-id",e.replace),i.find('[id*="'+e.search+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(e.search,e.replace))}),i.find('[name*="'+e.search+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(e.search,e.replace))}),i.find('label[for*="'+e.search+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(e.search,e.replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",t,i),e.after.apply(this,[t,i]),e.append.apply(this,[t,i]),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("").html(e).text()},parse_args:function(e,t){return $.extend({},t,e)},enqueue_script:function(e,t){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,i.readyState?i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(i.onreadystatechange=null,t())}:i.onload=function(){t()},document.body.appendChild(i)}},acf.model={actions:{},filters:{},events:{},extend:function(e){var t=$.extend({},this,e);return $.each(t.actions,function(e,i){t._add_action(e,i)}),$.each(t.filters,function(e,i){t._add_filter(e,i)}),$.each(t.events,function(e,i){t._add_event(e,i)}),t},_add_action:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_action(e,i[t],n,i)},_add_filter:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_filter(e,i[t],n,i)},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1);$(document).on(a,n,function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,[e])})},get:function(e,t){return t=t||null,"undefined"!=typeof this[e]&&(t=this[e]),t},set:function(e,t){return this[e]=t,"function"==typeof this["_set_"+e]&&this["_set_"+e].apply(this),this}},acf.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_action(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_filter(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),s=acf.get_selector(i.type);$(document).on(a,s+" "+n,function(e){e.$el=$(this),e.$field=acf.get_closest_field(e.$el,i.type),i.set("$field",e.$field),i[t].apply(i,[e])})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(e){return this.set("$field",e)}}),acf.fields=acf.model.extend({actions:{prepare:"_prepare",prepare_field:"_prepare_field",ready:"_ready",ready_field:"_ready_field",append:"_append",append_field:"_append_field",load:"_load",load_field:"_load_field",remove:"_remove",remove_field:"_remove_field",sortstart:"_sortstart",sortstart_field:"_sortstart_field",sortstop:"_sortstop",sortstop_field:"_sortstop_field",show:"_show",show_field:"_show_field",hide:"_hide",hide_field:"_hide_field"},_prepare:function(e){acf.get_fields("",e).each(function(){acf.do_action("prepare_field",$(this))})},_prepare_field:function(e){acf.do_action("prepare_field/type="+e.data("type"),e)},_ready:function(e){acf.get_fields("",e).each(function(){acf.do_action("ready_field",$(this))})},_ready_field:function(e){acf.do_action("ready_field/type="+e.data("type"),e)},_append:function(e){acf.get_fields("",e).each(function(){acf.do_action("append_field",$(this))})},_append_field:function(e){acf.do_action("append_field/type="+e.data("type"),e)},_load:function(e){acf.get_fields("",e).each(function(){acf.do_action("load_field",$(this))})},_load_field:function(e){acf.do_action("load_field/type="+e.data("type"),e)},_remove:function(e){acf.get_fields("",e).each(function(){acf.do_action("remove_field",$(this))})},_remove_field:function(e){acf.do_action("remove_field/type="+e.data("type"),e)},_sortstart:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstart_field",$(this),t)})},_sortstart_field:function(e,t){acf.do_action("sortstart_field/type="+e.data("type"),e,t)},_sortstop:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstop_field",$(this),t)})},_sortstop_field:function(e,t){acf.do_action("sortstop_field/type="+e.data("type"),e,t)},_hide:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("hide_field",$(this),t)})},_hide_field:function(e,t){acf.do_action("hide_field/type="+e.data("type"),e,t)},_show:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("show_field",$(this),t)})},_show_field:function(e,t){acf.do_action("show_field/type="+e.data("type"),e,t)}}),$(document).ready(function(){acf.do_action("ready",$("body"))}),$(window).on("load",function(){acf.do_action("load",$("body"))}),acf.layout=acf.model.extend({active:0,actions:{"prepare 99":"prepare",refresh:"refresh"},prepare:function(){this.active=1,this.refresh()},refresh:function(e){if(this.active){e=e||$("body");var t=this;this.render_tables(e),this.render_groups(e)}},render_tables:function(e){var t=this,i=e.find(".acf-table:visible");e.is("tr")&&(i=e.parent().parent()),i.each(function(){t.render_table($(this))})},render_table:function(e){var t=e.find("> thead th.acf-th"),i=1,a=100;if(t.exists()){var n=e.find("> tbody > tr"),s=n.find("> td.acf-field");n.hasClass("acf-clone")&&n.length>1&&(s=n.not(".acf-clone").find("> td.acf-field")),t.each(function(){var e=$(this),t=e.attr("data-key"),i=s.filter('[data-key="'+t+'"]');i.removeClass("appear-empty"),e.removeClass("hidden-by-conditional-logic"),i.exists()&&(0==i.not(".hidden-by-conditional-logic").length?e.addClass("hidden-by-conditional-logic"):i.filter(".hidden-by-conditional-logic").addClass("appear-empty"))}),t.css("width","auto"),t=t.not(".hidden-by-conditional-logic"),i=t.length,t.filter("[data-width]").each(function(){var e=parseInt($(this).attr("data-width"));a-=e,$(this).css("width",e+"%")}),t=t.not("[data-width]"),t.each(function(){var e=a/t.length;$(this).css("width",e+"%")}),e.find(".acf-row .acf-field.-collapsed-target").removeAttr("colspan"),e.find(".acf-row.-collapsed .acf-field.-collapsed-target").attr("colspan",i)}},render_groups:function(e){var t=this,i=e.find(".acf-fields:visible");e&&e.is(".acf-fields")&&(i=i.add(e)),i.each(function(){t.render_group($(this))})},render_group:function(e){var t=$(),i=0,a=0,n=-1,s=e.children(".acf-field[data-width]:visible");s.exists()&&(s.removeClass("acf-r0 acf-c0").css({"min-height":0}),s.each(function(e){var s=$(this),o=s.position().top;0==e&&(i=o),o!=i&&(t.css({"min-height":a+1+"px"}),t=$(),i=s.position().top,a=0,n=-1),n++,a=s.outerHeight()>a?s.outerHeight():a,t=t.add(s),0==o?s.addClass("acf-r0"):0==n&&s.addClass("acf-c0")}),t.exists()&&t.css({"min-height":a+1+"px"}))}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){$('#acf-form-data input[name="_acfchanged"]').exists()&&$('#acf-form-data input[name="_acfchanged"]').val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{change:"on",submit:"off"},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){!this.changed&&this.active&&(this.changed=1,$(window).on("beforeunload",this.unload))},off:function(){this.changed=0,$(window).off("beforeunload",this.unload)},unload:function(){return acf._e("unload")}}),acf.tooltip=acf.model.extend({$el:null,events:{"mouseenter .acf-js-tooltip":"on","mouseleave .acf-js-tooltip":"off"},on:function(e){var t=e.$el.attr("title");if(t){this.$el=$(''+t+"
"),$("body").append(this.$el);var i=10;target_w=e.$el.outerWidth(),target_h=e.$el.outerHeight(),target_t=e.$el.offset().top,target_l=e.$el.offset().left,tooltip_w=this.$el.outerWidth(),tooltip_h=this.$el.outerHeight();var a=target_t-tooltip_h,n=target_l+target_w/2-tooltip_w/2;n$(window).width()?(this.$el.addClass("left"),n=target_l-tooltip_w,a=target_t+target_h/2-tooltip_h/2):a-$(window).scrollTop()')}}),acf.add_action("sortstart",function(e,t){e.is("tr")&&(e.css("position","relative"),e.children().each(function(){$(this).width($(this).width())}),e.css("position","absolute"),t.html(' '))}),acf.add_action("before_duplicate",function(e){e.find("select option:selected").addClass("selected")}),acf.add_action("after_duplicate",function(e,t){t.find("select").each(function(){var e=$(this),t=[];e.find("option.selected").each(function(){t.push($(this).val())}),e.val(t)}),e.find("select option.selected").removeClass("selected"),t.find("select option.selected").removeClass("selected")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return $.inArray(e,this)})}(jQuery),function($){acf.ajax=acf.model.extend({active:!1,actions:{ready:"ready"},events:{"change #page_template":"_change_template","change #parent_id":"_change_parent","change #post-formats-select input":"_change_format","change .categorychecklist input":"_change_term","change .categorychecklist select":"_change_term",'change .acf-taxonomy-field[data-save="1"] input':"_change_term",'change .acf-taxonomy-field[data-save="1"] select':"_change_term"},o:{},xhr:null,update:function(e,t){return this.o[e]=t,this},get:function(e){return this.o[e]||null},ready:function(){this.update("post_id",acf.get("post_id")),this.active=!0},fetch:function(){if(this.active&&acf.get("ajax")){this.xhr&&this.xhr.abort();var e=this,t=this.o;t.action="acf/post/get_field_groups",t.exists=[],$(".acf-postbox").not(".acf-hidden").each(function(){t.exists.push($(this).attr("id").substr(4))}),this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(t),type:"post",dataType:"json",success:function(t){acf.is_ajax_success(t)&&e.render(t.data)}})}},render:function(e){$(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),$.each(e,function(e,t){var i=$("#acf-"+t.key),a=$("#acf-"+t.key+"-hide"),n=a.parent();i.removeClass("acf-hidden hide-if-js").show(),n.removeClass("acf-hidden hide-if-js").show(),a.prop("checked",!0);var s=i.find(".acf-replace-with-fields");s.exists()&&(s.replaceWith(t.html),acf.do_action("append",i)),0===e&&$("#acf-style").html(t.style),i.find(".acf-hidden-by-postbox").prop("disabled",!1)}),$(".acf-postbox.acf-hidden").find("select, textarea, input").not(":disabled").each(function(){$(this).addClass("acf-hidden-by-postbox").prop("disabled",!0)})},sync_taxonomy_terms:function(){var e=[""];$(".categorychecklist, .acf-taxonomy-field").each(function(){var t=$(this),i=t.find('input[type="checkbox"]').not(":disabled"),a=t.find('input[type="radio"]').not(":disabled"),n=t.find("select").not(":disabled"),s=t.find('input[type="hidden"]').not(":disabled");t.is(".acf-taxonomy-field")&&"1"!=t.attr("data-save")||t.closest(".media-frame").exists()||(i.exists()?i.filter(":checked").each(function(){e.push($(this).val())}):a.exists()?a.filter(":checked").each(function(){e.push($(this).val())}):n.exists()?n.find("option:selected").each(function(){e.push($(this).val())}):s.exists()&&s.each(function(){$(this).val()&&e.push($(this).val())}))}),e=e.filter(function(e,t,i){return i.indexOf(e)==t}),this.update("post_taxonomy",e).fetch()},_change_template:function(e){var t=e.$el.val();this.update("page_template",t).fetch()},_change_parent:function(e){var t="parent",i=0;""!=e.$el.val()&&(t="child",i=e.$el.val()),this.update("page_type",t).update("page_parent",i).fetch()},_change_format:function(e){var t=e.$el.val();"0"==t&&(t="standard"),this.update("post_format",t).fetch()},_change_term:function(e){var t=this;e.$el.closest(".media-frame").exists()||setTimeout(function(){t.sync_taxonomy_terms()},1)}})}(jQuery),function($){acf.fields.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"_change","click .acf-add-checkbox":"_add"},focus:function(){this.$ul=this.$field.find("ul"),this.$input=this.$field.find('input[type="hidden"]')},add:function(){var e=this.$input.attr("name")+"[]",t=' ';this.$ul.find(".acf-add-checkbox").parent("li").before(t)},_change:function(e){var t=this.$ul,i=t.find('input[type="checkbox"]').not(".acf-checkbox-toggle"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a).trigger("change");if(e.$el.hasClass("acf-checkbox-custom")){var n=e.$el.next('input[type="text"]');e.$el.next('input[type="text"]').prop("disabled",!a),a||""!=n.val()||e.$el.parent("li").remove()}if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}},_add:function(e){this.add()}})}(jQuery),function($){acf.fields.color_picker=acf.field.extend({type:"color_picker",$input:null,$hidden:null,actions:{ready:"initialize",append:"initialize"},focus:function(){this.$input=this.$field.find('input[type="text"]'),this.$hidden=this.$field.find('input[type="hidden"]')},initialize:function(){var e=this.$input,t=this.$hidden,i=function(){setTimeout(function(){acf.val(t,e.val())},1)},a={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},a=acf.apply_filters("color_picker_args",a,this.$field);this.$input.wpColorPicker(a)}})}(jQuery),function($){acf.conditional_logic=acf.model.extend({actions:{"prepare 20":"render","append 20":"render"},events:{"change .acf-field input":"change","change .acf-field textarea":"change","change .acf-field select":"change"},items:{},triggers:{},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n],o=s.field,r=this.triggers[o]||{};r[e]=e,this.triggers[o]=r}}this.items[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.render_fields(t),acf.do_action("refresh",e)},change:function(e){var t=e.$el,i=acf.get_field_wrap(t),a=i.data("key");if("undefined"==typeof this.triggers[a])return!1;$parent=i.parent();for(var n in this.triggers[a]){var s=this.triggers[a][n],o=acf.get_fields(s,$parent,!0);this.render_fields(o)}acf.do_action("refresh",$parent)},render_fields:function(e){var t=this;e.each(function(){t.render_field($(this))})},render_field:function(e){var t=e.data("key");if("undefined"==typeof this.items[t])return!1;for(var i=!1,a=this.items[t],n=0;n-1,match}})}(jQuery),function($){acf.datepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_picker"),l10n&&"undefined"!=typeof $.datepicker&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){"undefined"!=typeof $.datepicker&&(t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'))},destroy:function(e){}}),acf.fields.date_picker=acf.field.extend({type:"date_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(this.o.save_format)return this.initialize2();var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field),acf.datepicker.init(this.$input,e),acf.do_action("date_picker_init",this.$input,e,this.$field)},initialize2:function(){this.$input.val(this.$hidden.val());var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:this.o.save_format,changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field);var t=e.dateFormat;e.dateFormat=this.o.save_format,acf.datepicker.init(this.$input,e),this.$input.datepicker("option","dateFormat",t),acf.do_action("date_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&"undefined"!=typeof $.timepicker&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){"undefined"!=typeof $.timepicker&&(t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'))},destroy:function(e){}}),acf.fields.date_time_picker=acf.field.extend({type:"date_time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){var e={dateFormat:this.o.date_format,timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day,controlType:"select",oneLine:!0};e=acf.apply_filters("date_time_picker_args",e,this.$field),acf.datetimepicker.init(this.$input,e),acf.do_action("date_time_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.file=acf.field.extend({type:"file",$el:null,$input:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-file-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"};return e.id&&(t=e.attributes),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$el.find("img").attr({src:e.icon,alt:e.alt,title:e.title}),this.$el.find('[data-name="title"]').text(e.title),
-this.$el.find('[data-name="filename"]').text(e.filename).attr("href",e.url),this.$el.find('[data-name="filesize"]').text(e.filesizeHumanReadable);var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(t,"repeater"),a=acf.media.popup({title:acf._e("file","select"),mode:"select",type:"",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-file-uploader.has-value").exists()&&void(t=!1)}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("file","edit"),button:acf._e("file","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},get_file_info:function(e,t){var i=e.val(),a={};if(!i)return void t.val("");a.url=i;var n=e[0].files;if(n.length){var s=n[0];if(a.size=s.size,a.type=s.type,s.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,r=new Image;r.onload=function(){a.width=this.width,a.height=this.height,t.val(jQuery.param(a))},r.src=o.createObjectURL(s)}}t.val(jQuery.param(a))},change:function(e){this.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.google_map=acf.field.extend({type:"google_map",url:"",$el:null,$search:null,timeout:null,status:"",geocoder:!1,map:!1,maps:{},$pending:$(),actions:{ready:"initialize",append:"initialize",show:"show"},events:{'click a[data-name="clear"]':"_clear",'click a[data-name="locate"]':"_locate",'click a[data-name="search"]':"_search","keydown .search":"_keydown","keyup .search":"_keyup","focus .search":"_focus","blur .search":"_blur","mousedown .acf-google-map":"_mousedown"},focus:function(){this.$el=this.$field.find(".acf-google-map"),this.$search=this.$el.find(".search"),this.o=acf.get_data(this.$el),this.o.id=this.$el.attr("id"),this.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status||"loading"!=this.status&&(acf.isset(window,"google","maps","places")?(this.status="ready",!0):(acf.isset(window,"google","maps")&&(this.status="ready"),this.url&&(this.status="loading",acf.enqueue_script(this.url,function(){e.status="ready",e.initialize_pending()})),"ready"==this.status))},initialize_pending:function(){var e=this;this.$pending.each(function(){e.set("$field",$(this)).initialize()}),this.$pending=$()},initialize:function(){if(!this.is_ready())return this.$pending=this.$pending.add(this.$field),!1;this.geocoder||(this.geocoder=new google.maps.Geocoder);var e=this,t=this.$field,i=this.$el,a=this.$search;a.val(this.$el.find(".input-address").val());var n=acf.apply_filters("google_map_args",{scrollwheel:!1,zoom:parseInt(this.o.zoom),center:new google.maps.LatLng(this.o.lat,this.o.lng),mapTypeId:google.maps.MapTypeId.ROADMAP},this.$field);if(this.map=new google.maps.Map(this.$el.find(".canvas")[0],n),acf.isset(window,"google","maps","places","Autocomplete")){var s=new google.maps.places.Autocomplete(this.$search[0]);s.bindTo("bounds",this.map),google.maps.event.addListener(s,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=s}var o=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(o),this.map.$el=i,this.map.$field=t;var r=i.find(".input-lat").val(),l=i.find(".input-lng").val();r&&l&&this.update(r,l).center(),google.maps.event.addListener(this.map.marker,"dragend",function(){var t=this.map.marker.getPosition(),i=t.lat(),a=t.lng();e.update(i,a).sync()}),google.maps.event.addListener(this.map,"click",function(t){var i=t.latLng.lat(),a=t.latLng.lng();e.update(i,a).sync()}),acf.do_action("google_map_init",this.map,this.map.marker,this.$field),this.maps[this.o.id]=this.map},search:function(e){var t=this,i=this.$search.val();if(!i)return!1;this.$el.find(".input-address").val(i);var a=i.split(",");if(2==a.length){var n=a[0],s=a[1];if($.isNumeric(n)&&$.isNumeric(s))return n=parseFloat(n),s=parseFloat(s),void t.update(n,s).center()}if(e&&e.geometry){var n=e.geometry.location.lat(),s=e.geometry.location.lng();return void t.update(n,s).center()}this.$el.addClass("-loading"),t.geocoder.geocode({address:i},function(i,a){if(t.$el.removeClass("-loading"),a!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+a);if(!i[0])return void console.log("No results found");e=i[0];var n=e.geometry.location.lat(),s=e.geometry.location.lng();t.update(n,s).center()})},update:function(e,t){var i=new google.maps.LatLng(e,t);return acf.val(this.$el.find(".input-lat"),e),acf.val(this.$el.find(".input-lng"),t),this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.$el.addClass("-value"),this.$field.removeClass("error"),acf.do_action("google_map_change",i,this.map,this.$field),this.$search.blur(),this},center:function(){var e=this.map.marker.getPosition(),t=this.o.lat,i=this.o.lng;e&&(t=e.lat(),i=e.lng());var a=new google.maps.LatLng(t,i);this.map.setCenter(a)},sync:function(){var e=this,t=this.map.marker.getPosition(),i=new google.maps.LatLng(t.lat(),t.lng());return this.$el.addClass("-loading"),this.geocoder.geocode({latLng:i},function(t,i){if(e.$el.removeClass("-loading"),i!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+i);if(!t[0])return void console.log("No results found");var a=t[0];e.$search.val(a.formatted_address),acf.val(e.$el.find(".input-address"),a.formatted_address)}),this},refresh:function(){return!!this.is_ready()&&(google.maps.event.trigger(this.map,"resize"),void this.center())},show:function(){var e=this,t=this.$field;setTimeout(function(){e.set("$field",t).refresh()},10)},_clear:function(e){this.$el.removeClass("-value -loading -search"),this.$search.val(""),acf.val(this.$el.find(".input-address"),""),acf.val(this.$el.find(".input-lat"),""),acf.val(this.$el.find(".input-lng"),""),this.map.marker.setVisible(!1)},_locate:function(e){var t=this;return navigator.geolocation?(this.$el.addClass("-loading"),void navigator.geolocation.getCurrentPosition(function(e){t.$el.removeClass("-loading");var i=e.coords.latitude,a=e.coords.longitude;t.update(i,a).sync().center()})):(alert(acf._e("google_map","browser_support")),this)},_search:function(e){this.search()},_focus:function(e){this.$el.removeClass("-value"),this._keyup()},_blur:function(e){var t=this,i=this.$el.find(".input-address").val();i&&(this.timeout=setTimeout(function(){t.$el.addClass("-value"),t.$search.val(i)},100))},_keydown:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){var t=this.$search.val();t?this.$el.addClass("-search"):this.$el.removeClass("-search")},_mousedown:function(e){var t=this;setTimeout(function(){clearTimeout(t.timeout)},1)}})}(jQuery),function($){acf.fields.image=acf.field.extend({type:"image",$el:null,$input:null,$img:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-image-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.$img=this.$el.find("img"),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",caption:"",description:"",width:0,height:0};return e.id&&(t=e.attributes,t.url=acf.maybe_get(t,"sizes."+this.o.preview_size+".url",t.url)),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$img.attr({src:e.url,alt:e.alt,title:e.title});var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(this.$field,"repeater"),a=acf.media.popup({title:acf._e("image","select"),mode:"select",type:"image",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-image-uploader.has-value").exists()&&void(t=!1)}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("image","edit"),button:acf._e("image","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},change:function(e){acf.fields.file.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.media=acf.model.extend({frames:[],mime_types:{},actions:{ready:"ready"},frame:function(){var e=this.frames.length-1;return!(e<0)&&this.frames[e]},destroy:function(e){e.detach(),e.dispose(),e=null,this.frames.pop()},popup:function(e){var t=acf.get("post_id"),i=!1;$.isNumeric(t)||(t=0);var a=acf.parse_args(e,{mode:"select",title:"",button:"",type:"",field:"",mime_types:"",library:"all",multiple:!1,attachment:0,post_id:t,select:function(){}});a.id&&(a.attachment=a.id);var i=this.new_media_frame(a);return this.frames.push(i),setTimeout(function(){i.open()},1),i},_get_media_frame_settings:function(e,t){return"select"===t.mode?e=this._get_select_frame_settings(e,t):"edit"===t.mode&&(e=this._get_edit_frame_settings(e,t)),e},_get_select_frame_settings:function(e,t){return t.type&&(e.library.type=t.type),"uploadedTo"===t.library&&(e.library.uploadedTo=t.post_id),e._button=acf._e("media","select"),e},_get_edit_frame_settings:function(e,t){return e.library.post__in=[t.attachment],e._button=acf._e("media","update"),e},_add_media_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+t.mode)},e),e.on("content:render:edit-image",function(){var e=this.state().get("image"),t=new wp.media.view.EditImage({model:e,controller:this}).render();this.content.set(t),t.loadEditor()},e),e.on("toolbar:create:select",function(t){t.view=new wp.media.view.Toolbar.Select({text:e.options._button,controller:this})},e),e.on("select",function(){var i=e.state(),a=i.get("image"),n=i.get("selection");if(a)return void t.select.apply(e,[a,0]);if(n){var s=0;return void n.each(function(i){t.select.apply(e,[i,s]),s++})}}),e.on("close",function(){setTimeout(function(){acf.media.destroy(e)},500)}),"select"===t.mode?e=this._add_select_frame_events(e,t):"edit"===t.mode&&(e=this._add_edit_frame_events(e,t)),e},_add_select_frame_events:function(e,t){var i=this;return acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=t.field,e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){try{var a=e.content.get().toolbar,n=a.get("filters"),s=a.get("search")}catch(e){return}if("image"==t.type&&(n.filters.all.text=acf._e("image","all"),delete n.filters.audio,delete n.filters.video,$.each(n.filters,function(e,t){null===t.props.type&&(t.props.type="image")})),t.mime_types){var o=t.mime_types.split(" ").join("").split(".").join("").split(",");$.each(o,function(e,t){$.each(i.mime_types,function(e,i){if(e.indexOf(t)!==-1){var a={text:t,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};n.filters[i]=a}})})}"uploadedTo"==t.library&&(delete n.filters.unattached,delete n.filters.uploaded,n.$el.parent().append(''+acf._e("image","uploadedTo")+" "),$.each(n.filters,function(e,i){i.props.uploadedTo=t.post_id})),$.each(n.filters,function(e,i){i.props._acfuploader=t.field}),s.model.attributes._acfuploader=t.field,"function"==typeof n.refresh&&n.refresh()}),e},_add_edit_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),a=wp.media.attachment(t.attachment);i.add(a)},e),e},new_media_frame:function(e){var t={title:e.title,multiple:e.multiple,library:{},states:[]};t=this._get_media_frame_settings(t,e);var i=wp.media.query(t.library);acf.isset(i,"mirroring","args")&&(i.mirroring.args._acfuploader=e.field),t.states=[new wp.media.controller.Library({library:i,multiple:t.multiple,title:t.title,priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})],acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage);var a=wp.media(t);return a.acf=e,a=this._add_media_frame_events(a,e)},ready:function(){var e=acf.get("wp_version"),t=acf.get("browser"),i=acf.get("post_id");acf.isset(window,"wp","media","view","settings","post")&&$.isNumeric(i)&&(wp.media.view.settings.post.id=i),t&&$("body").addClass("browser-"+t),e&&(e+="",major=e.substr(0,1),$("body").addClass("major-"+major)),acf.isset(window,"wp","media","view")&&(this.customize_Attachment(),this.customize_AttachmentFiltersAll(),this.customize_AttachmentCompat())},customize_Attachment:function(){var e=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=e.extend({render:function(){var t=acf.media.frame(),i=acf.maybe_get(this,"model.attributes.acf_errors");return t&&i&&this.$el.addClass("acf-disabled"),e.prototype.render.apply(this,arguments)},toggleSelection:function(t){var i=this.collection,a=this.options.selection,n=this.model,s=a.single(),o=acf.media.frame(),r=acf.maybe_get(this,"model.attributes.acf_errors"),l=this.controller.$el.find(".media-frame-content .media-sidebar");if(l.children(".acf-selection-error").remove(),l.children().removeClass("acf-hidden"),o&&r){var c=acf.maybe_get(this,"model.attributes.filename","");return l.children().addClass("acf-hidden"),l.prepend(['',''+acf._e("restricted")+" ",''+c+" ",''+r+" ","
"].join("")),a.reset(),void a.single(n)}e.prototype.toggleSelection.apply(this,arguments)}})},customize_AttachmentFiltersAll:function(){wp.media.view.AttachmentFilters.All.prototype.refresh=function(){this.$el.html(_.chain(this.filters).map(function(e,t){return{el:$(" ").val(t).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())}},customize_AttachmentCompat:function(){var e=wp.media.view.AttachmentCompat;wp.media.view.AttachmentCompat=e.extend({add_acf_expand_button:function(){var e=this.$el.closest(".media-modal");if(!e.find(".media-frame-router .acf-expand-details").exists()){var t=$(['',' '+acf._e("expand_details")+" ",' '+acf._e("collapse_details")+" "," "].join(""));t.on("click",function(t){t.preventDefault(),e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),e.find(".media-frame-router").append(t)}},render:function(){if(this.ignore_render)return this;var t=this;return setTimeout(function(){t.add_acf_expand_button()},0),clearTimeout(acf.media.render_timout),acf.media.render_timout=setTimeout(function(){acf.do_action("append",t.$el)},50),e.prototype.render.apply(this,arguments)},dispose:function(){return acf.do_action("remove",this.$el),e.prototype.dispose.apply(this,arguments)},save:function(e){e&&e.preventDefault();var t=acf.serialize_form(this.$el);this.ignore_render=!0,this.model.saveCompat(t)}})}})}(jQuery),function($){acf.fields.oembed=acf.field.extend({type:"oembed",$el:null,events:{'click [data-name="search-button"]':"_search",'click [data-name="clear-button"]':"_clear",'click [data-name="value-title"]':"_edit",'keypress [data-name="search-input"]':"_keypress",'keyup [data-name="search-input"]':"_keyup",'blur [data-name="search-input"]':"_blur"},focus:function(){this.$el=this.$field.find(".acf-oembed"),this.$search=this.$el.find('[data-name="search-input"]'),this.$input=this.$el.find('[data-name="value-input"]'),this.$title=this.$el.find('[data-name="value-title"]'),this.$embed=this.$el.find('[data-name="value-embed"]'),this.o=acf.get_data(this.$el)},maybe_search:function(){var e=this.$input.val(),t=this.$search.val();return t?void(t!=e&&this.search()):void this.clear()},search:function(){var e=this.$search.val();"http"!=e.substr(0,4)&&(e="http://"+e,this.$search.val(e)),this.$el.addClass("is-loading");var t=acf.prepare_for_ajax({action:"acf/fields/oembed/search",s:e,field_key:this.$field.data("key")});this.$el.data("xhr")&&this.$el.data("xhr").abort();var i=$.ajax({url:acf.get("ajaxurl"),data:t,type:"post",dataType:"json",context:this,success:this.search_success});this.$el.data("xhr",i)},search_success:function(e){var t=this.$search.val();return this.$el.removeClass("is-loading"),e&&e.html?(this.$el.removeClass("has-error").addClass("has-value"),this.$input.val(t),this.$title.html(t),void this.$embed.html(e.html)):void this.$el.removeClass("has-value").addClass("has-error")},clear:function(){this.$el.removeClass("has-error has-value"),this.$el.find('[data-name="search-input"]').val(""),this.$input.val(""),this.$title.html(""),this.$embed.html("")},edit:function(){this.$el.addClass("is-editing"),this.$search.val(this.$title.text()).focus()},blur:function(e){this.$el.removeClass("is-editing"),this.maybe_search()},_search:function(e){this.search()},_clear:function(e){this.clear()},_edit:function(e){this.edit()},_keypress:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()&&this.maybe_search()},_blur:function(e){this.blur()}})}(jQuery),function($){acf.fields.radio=acf.field.extend({type:"radio",$ul:null,actions:{ready:"initialize",append:"initialize"},events:{'click input[type="radio"]':"click"},focus:function(){this.$ul=this.$field.find(".acf-radio-list"),this.o=acf.get_data(this.$ul)},initialize:function(){this.$ul.find(".selected input").prop("checked",!0)},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected"),n=t.val();if(this.$ul.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),n=!1,e.$el.trigger("change")),this.o.other_choice){var s=this.$ul.find('input[type="text"]');"other"===n?s.prop("disabled",!1).attr("name",t.attr("name")):s.prop("disabled",!0).attr("name","")}}})}(jQuery),function($){acf.fields.relationship=acf.field.extend({type:"relationship",$el:null,$input:null,$filters:null,$choices:null,$values:null,actions:{ready:"initialize",append:"initialize"},events:{"keypress [data-filter]":"submit_filter","change [data-filter]":"change_filter","keyup [data-filter]":"change_filter","click .choices .acf-rel-item":"add_item",'click [data-name="remove_item"]':"remove_item"},focus:function(){this.$el=this.$field.find(".acf-relationship"),this.$input=this.$el.find(".acf-hidden input"),this.$choices=this.$el.find(".choices"),this.$values=this.$el.find(".values"),this.o=acf.get_data(this.$el)},initialize:function(){var e=this,t=this.$field,i=this.$el,a=this.$input;this.$values.children(".list").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){a.trigger("change")}}),this.$choices.children(".list").scrollTop(0).on("scroll",function(a){if(!i.hasClass("is-loading")&&!i.hasClass("is-empty")&&Math.ceil($(this).scrollTop())+$(this).innerHeight()>=$(this).get(0).scrollHeight){var n=i.data("paged")||1;i.data("paged",n+1),e.set("$field",t).fetch()}}),this.fetch()},maybe_fetch:function(){var e=this,t=this.$field;this.o.timeout&&clearTimeout(this.o.timeout);var i=setTimeout(function(){e.doFocus(t),e.fetch()},300);this.$el.data("timeout",i)},fetch:function(){var e=this,t=this.$field;this.$el.addClass("is-loading"),this.o.xhr&&(this.o.xhr.abort(),this.o.xhr=!1),this.o.action="acf/fields/relationship/query",this.o.field_key=t.data("key"),this.o.post_id=acf.get("post_id");var i=acf.prepare_for_ajax(this.o);1==i.paged&&this.$choices.children(".list").html(""),this.$choices.find("ul:last").append(' '+acf._e("relationship","loading")+"
");var a=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:i,success:function(i){e.set("$field",t).render(i)}});this.$el.data("xhr",a)},render:function(e){if(this.$el.removeClass("is-loading is-empty"),this.$choices.find("p").remove(),!e||!e.results||!e.results.length)return this.$el.addClass("is-empty"),void(1==this.o.paged&&this.$choices.children(".list").append(""+acf._e("relationship","empty")+"
"));var t=$(this.walker(e.results));if(this.$values.find(".acf-rel-item").each(function(){t.find('.acf-rel-item[data-id="'+$(this).data("id")+'"]').addClass("disabled")}),this.o.s){var i=this.o.s;i=acf.addslashes(i),t.find(".acf-rel-item").each(function(){var e=$(this).text(),t=e.replace(new RegExp("("+i+")","gi"),"$1 ");$(this).html($(this).html().replace(e,t))})}this.$choices.children(".list").append(t);var a="",n=null;this.$choices.find(".acf-rel-label").each(function(){return $(this).text()==a?(n.append($(this).siblings("ul").html()),void $(this).parent().remove()):(a=$(this).text(),void(n=$(this).siblings("ul")))})},walker:function(e){var t="";if($.isArray(e))for(var i in e)t+=this.walker(e[i]);else $.isPlainObject(e)&&(void 0!==e.children?(t+=''+e.text+' ',t+=this.walker(e.children),t+=" "):t+=''+e.text+" ");return t},submit_filter:function(e){13==e.which&&e.preventDefault()},change_filter:function(e){var t=e.$el.val(),i=e.$el.data("filter");this.$el.data(i)!=t&&(this.$el.data(i,t),this.$el.data("paged",1),e.$el.is("select")?this.fetch():this.maybe_fetch())},add_item:function(e){if(this.o.max>0&&this.$values.find(".acf-rel-item").length>=this.o.max)return void alert(acf._e("relationship","max").replace("{max}",this.o.max));if(e.$el.hasClass("disabled"))return!1;e.$el.addClass("disabled");var t=["",' ',''+e.$el.html(),' '," "," "].join("");this.$values.children(".list").append(t),this.$input.trigger("change"),acf.validation.remove_error(this.$field)},remove_item:function(e){var t=e.$el.parent(),i=t.data("id");t.parent("li").remove(),this.$choices.find('.acf-rel-item[data-id="'+i+'"]').removeClass("disabled"),this.$input.trigger("change")}})}(jQuery),function($){acf.select2=acf.model.extend({version:0,actions:{"ready 1":"ready"},ready:function(){acf.maybe_get(window,"Select2")?(this.version=3,this.l10n_v3()):acf.maybe_get(window,"jQuery.fn.select2.amd")&&(this.version=4)},l10n_v3:function(){var e=acf.get("locale"),t=acf.get("rtl");if(l10n=acf._e("select"),l10n){var i={formatMatches:function(e){return 1===e?l10n.matches_1:l10n.matches_n.replace("%d",e)},formatNoMatches:function(){return l10n.matches_0},formatAjaxError:function(){return l10n.load_fail},formatInputTooShort:function(e,t){var i=t-e.length;return 1===i?l10n.input_too_short_1:l10n.input_too_short_n.replace("%d",i)},formatInputTooLong:function(e,t){var i=e.length-t;return 1===i?l10n.input_too_long_1:l10n.input_too_long_n.replace("%d",i)},formatSelectionTooBig:function(e){return 1===e?l10n.selection_too_long_1:l10n.selection_too_long_n.replace("%d",e)},formatLoadMore:function(){return l10n.load_more},formatSearching:function(){return l10n.searching}};$.fn.select2.locales=acf.maybe_get(window,"jQuery.fn.select2.locales",{}),$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}},init:function(e,t,i){if(this.version)return t=t||{},i=i||null,t=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},t),3==this.version?this.init_v3(e,t,i):4==this.version&&this.init_v4(e,t,i)},get_data:function(e,t){var i=this;return t=t||[],e.children().each(function(){var e=$(this);e.is("optgroup")?t.push({text:e.attr("label"),children:i.get_data(e)}):t.push({id:e.attr("value"),text:e.text()})}),t},decode_data:function(e){return e?($.each(e,function(t,i){e[t].text=acf.decode(i.text),"undefined"!=typeof i.children&&(e[t].children=acf.select2.decode_data(i.children))}),e):[]},count_data:function(e){var t=0;return e?($.each(e,function(e,i){t++,"undefined"!=typeof i.children&&(t+=i.children.length)}),t):t},get_ajax_data:function(e,t,i,a){var n=acf.prepare_for_ajax({action:e.ajax_action,field_key:e.key,s:t.term||"",paged:t.page||1});return n=acf.apply_filters("select2_ajax_data",n,e,i,a)},get_ajax_results:function(e,t){var i={results:[]};return e||(e=i),"undefined"==typeof e.results&&(i.results=e,e=i),e.results=this.decode_data(e.results),e=acf.apply_filters("select2_ajax_results",e,t)},get_value:function(e){var t=[],i=e.find("option:selected");return i.exists()?(i=i.sort(function(e,t){return+e.getAttribute("data-i")-+t.getAttribute("data-i")}),i.each(function(){var e=$(this);t.push({id:e.attr("value"),text:e.text()})}),t):t},init_v3:function(e,t,i){var a=e.siblings("input");if(a.exists()){var n={width:"100%",containerCssClass:"-acf",allowClear:t.allow_null,placeholder:t.placeholder,multiple:t.multiple,separator:"||",data:[],escapeMarkup:function(e){return e},formatResult:function(e,t,i,a){var n=$.fn.select2.defaults.formatResult(e,t,i,a);return e.description&&(n+=' '+e.description+" "),n}},s=this.get_value(e);if(t.multiple){var o=e.attr("name");n.formatSelection=function(e,t){var i=' ";return t.parent().append(i),e.text}}else s=acf.maybe_get(s,0,!1),!t.allow_null&&s&&a.val(s.id);t.allow_null&&e.find('option[value=""]').remove(),n.data=this.get_data(e),n.initSelection=function(e,t){t(s)},t.ajax&&(n.ajax={url:acf.get("ajaxurl"),dataType:"json",type:"post",cache:!1,quietMillis:250,data:function(e,n){var s={term:e,page:n};return acf.select2.get_ajax_data(t,s,a,i)},results:function(e,t){var i={page:t};return setTimeout(function(){acf.select2.merge_results_v3()},1),acf.select2.get_ajax_results(e,i)}}),n.dropdownCss={"z-index":"999999999"},n.acf=t,n=acf.apply_filters("select2_args",n,e,t,i),a.select2(n);var r=a.select2("container");r.before(e),r.before(a),t.multiple&&r.find("ul.select2-choices").sortable({start:function(){a.select2("onSortStart")},stop:function(){a.select2("onSortEnd")}}),e.prop("disabled",!0).addClass("acf-disabled acf-hidden"),a.on("change",function(t){t.added&&e.append(''+t.added.text+" "),e.val(t.val)}),acf.do_action("select2_init",a,n,t,i)}},merge_results_v3:function(){var e="",t=null;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children(".select2-result-label"),a=$(this).children(".select2-result-sub");return i.text()==e?(t.append(a.children()),void $(this).remove()):(e=i.text(),void(t=a))})},init_v4:function(e,t,i){var a=e.siblings("input");if(a.exists()){var n={width:"100%",allowClear:t.allow_null,placeholder:t.placeholder,multiple:t.multiple,separator:"||",data:[],escapeMarkup:function(e){return e}},s=this.get_value(e);t.multiple||(s=acf.maybe_get(s,0,"")),t.allow_null&&e.find('option[value=""]').remove(),n.data=this.get_data(e),t.ajax?n.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:function(a){return acf.select2.get_ajax_data(t,a,e,i)},processResults:function(e,t){var i=acf.select2.get_ajax_results(e,t);return i.more&&(i.pagination={more:!0}),setTimeout(function(){acf.select2.merge_results_v4()},1),i}}:(e.removeData("ajax"),e.removeAttr("data-ajax")),n=acf.apply_filters("select2_args",n,e,t,i);var o=e.select2(n);a.val(""),o.addClass("-acf"),acf.do_action("select2_init",e,n,t,i)}},merge_results_v4:function(){var e=null,t=null;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),a=$(this).children("strong");return null!==t&&a.text()==t.text()?(e.append(i.children()),void $(this).remove()):(e=i,void(t=a))})},destroy:function(e){e.siblings(".select2-container").remove(),e.siblings("input").show(),e.prop("disabled",!1).removeClass("acf-disabled acf-hidden")}}),acf.add_select2=function(e,t){acf.select2.init(e,t)},acf.remove_select2=function(e){acf.select2.destroy(e)},acf.fields.select=acf.field.extend({type:"select",$select:null,actions:{ready:"render",append:"render",remove:"remove"},focus:function(){this.$select=this.$field.find("select"),this.$select.exists()&&(this.o=acf.get_data(this.$select),this.o=acf.parse_args(this.o,{ajax_action:"acf/fields/"+this.type+"/query",key:this.$field.data("key")}))},render:function(){return!(!this.$select.exists()||!this.o.ui)&&void acf.select2.init(this.$select,this.o,this.$field)},remove:function(){return!(!this.$select.exists()||!this.o.ui)&&void acf.select2.destroy(this.$select)}}),acf.fields.user=acf.fields.select.extend({type:"user"}),acf.fields.post_object=acf.fields.select.extend({type:"post_object"}),acf.fields.page_link=acf.fields.select.extend({type:"page_link"})}(jQuery),function($){acf.fields.tab=acf.field.extend({type:"tab",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize",hide:"hide",show:"show"},focus:function(){this.$el=this.$field.find(".acf-tab"),this.o=this.$el.data(),this.o.key=this.$field.data("key"),this.o.text=this.$el.text()},initialize:function(){this.$field.is("td")||e.add_tab(this.$field,this.o)},hide:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.addClass("hidden-by-conditional-logic"),setTimeout(function(){e.nextUntil(".acf-field-tab",".acf-field").each(function(){$(this).hasClass("hidden-by-conditional-logic")||(acf.conditional_logic.hide_field($(this)),$(this).addClass("-hbcl-"+i))}),s.hasClass("active")&&a.find("li:not(.hidden-by-conditional-logic):first a").trigger("click")},0))}},show:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.removeClass("hidden-by-conditional-logic"),setTimeout(function(){e.siblings(".acf-field.-hbcl-"+i).each(function(){acf.conditional_logic.show_field($(this)),$(this).removeClass("-hbcl-"+i)});var t=s.siblings(".active");t.exists()&&!t.hasClass("hidden-by-conditional-logic")||n.trigger("click")},0))}}});var e=acf.model.extend({actions:{"prepare 15":"render","append 15":"render","refresh 15":"render"},events:{"click .acf-tab-button":"_click"},render:function(e){$(".acf-tab-wrap",e).each(function(){var e=$(this),t=e.parent();if(e.find("li.active").exists()||e.find("li:not(.hidden-by-conditional-logic):first a").trigger("click"),t.hasClass("-sidebar")){var i=t.is("td")?"height":"min-height",a=e.position().top+e.children("ul").outerHeight(!0)-1;t.css(i,a)}})},add_group:function(e,t){var i=e.parent(),a="";return i.hasClass("acf-fields")&&"left"==t.placement?i.addClass("-sidebar"):t.placement="top",a=i.is("tbody")?' ':'',$group=$(a),e.before($group),$group},add_tab:function(e,t){var i=e.siblings(".acf-tab-wrap").last();i.exists()?t.endpoint&&(i=this.add_group(e,t)):i=this.add_group(e,t);
-var a=$(''+t.text+" ");""===t.text&&a.hide(),i.find("ul").append(a),e.hasClass("hidden-by-conditional-logic")&&a.addClass("hidden-by-conditional-logic")},_click:function(e){e.preventDefault();var t=this,i=e.$el,a=i.closest(".acf-tab-wrap"),n=i.data("key"),s="";i.parent().addClass("active").siblings().removeClass("active"),a.nextUntil(".acf-tab-wrap",".acf-field").each(function(){var e=$(this);return("tab"!=e.data("type")||(s=e.data("key"),!e.hasClass("endpoint")))&&void(s===n?e.hasClass("hidden-by-tab")&&(e.removeClass("hidden-by-tab"),acf.do_action("show_field",$(this),"tab")):e.hasClass("hidden-by-tab")||(e.addClass("hidden-by-tab"),acf.do_action("hide_field",$(this),"tab")))}),acf.do_action("refresh",a.parent()),i.trigger("blur")}}),t=acf.model.extend({active:1,actions:{add_field_error:"add_field_error"},add_field_error:function(e){if(this.active&&e.hasClass("hidden-by-tab")){var t=this,i=e.prevAll(".acf-field-tab:first"),a=e.prevAll(".acf-tab-wrap:first");a.find('a[data-key="'+i.data("key")+'"]').trigger("click"),this.active=0,setTimeout(function(){t.active=1},1e3)}}})}(jQuery),function($){acf.fields.time_picker=acf.field.extend({type:"time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if("undefined"!=typeof $.timepicker){var e={timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf._e("date_time_picker","selectText")};e.onClose=function(e,t){var i=t.dpDiv,a=i.find(".ui-datepicker-close");if(!e&&a.is(":hover")){if(e=acf.maybe_get(t,"settings.timepicker.formattedTime"),!e)return;$.datepicker._setTime(t)}},e=acf.apply_filters("time_picker_args",e,this.$field),this.$input.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'),acf.do_action("time_picker_init",this.$input,e,this.$field)}},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.true_false=acf.field.extend({type:"true_false",$switch:null,$input:null,actions:{prepare:"render",append:"render",show:"render"},events:{"change .acf-switch-input":"_change","focus .acf-switch-input":"_focus","blur .acf-switch-input":"_blur","keypress .acf-switch-input":"_keypress"},focus:function(){this.$input=this.$field.find(".acf-switch-input"),this.$switch=this.$field.find(".acf-switch")},render:function(){if(this.$switch.exists()){var e=this.$switch.children(".acf-switch-on"),t=this.$switch.children(".acf-switch-off");width=Math.max(e.width(),t.width()),width&&(e.css("min-width",width),t.css("min-width",width))}},on:function(){this.$input.prop("checked",!0),this.$switch.addClass("-on")},off:function(){this.$input.prop("checked",!1),this.$switch.removeClass("-on")},_change:function(e){var t=e.$el.prop("checked");t?this.on():this.off()},_focus:function(e){this.$switch.addClass("-focus")},_blur:function(e){this.$switch.removeClass("-focus")},_keypress:function(e){return 37===e.keyCode?this.off():39===e.keyCode?this.on():void 0}})}(jQuery),function($){acf.fields.taxonomy=acf.field.extend({type:"taxonomy",$el:null,actions:{ready:"render",append:"render",remove:"remove"},events:{'click a[data-name="add"]':"add_term"},focus:function(){this.$el=this.$field.find(".acf-taxonomy-field"),this.o=acf.get_data(this.$el),this.o.key=this.$field.data("key")},render:function(){var e=this.$field.find("select");if(e.exists()){var t=acf.get_data(e);t=acf.parse_args(t,{pagination:!0,ajax_action:"acf/fields/taxonomy/query",key:this.o.key}),acf.select2.init(e,t)}},remove:function(){var e=this.$field.find("select");return!!e.exists()&&void acf.select2.destroy(e)},add_term:function(e){var t=this;acf.open_popup({title:e.$el.attr("title")||e.$el.data("title"),loading:!0,height:220});var i=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key});$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(e){t.add_term_confirm(e)}})},add_term_confirm:function(e){var t=this;acf.update_popup({content:e}),$('#acf-popup input[name="term_name"]').focus(),$("#acf-popup form").on("submit",function(e){e.preventDefault(),t.add_term_submit($(this))})},add_term_submit:function(e){var t=this,i=e.find(".acf-submit"),a=e.find('input[name="term_name"]'),n=e.find('select[name="term_parent"]');if(""===a.val())return a.focus(),!1;i.find("button").attr("disabled","disabled"),i.find(".acf-spinner").addClass("is-active");var s=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key,term_name:a.val(),term_parent:n.exists()?n.val():0});$.ajax({url:acf.get("ajaxurl"),data:s,type:"post",dataType:"json",success:function(e){var n=acf.get_ajax_message(e);acf.is_ajax_success(e)&&(a.val(""),t.append_new_term(e.data)),n.text&&i.find("span").html(n.text)},complete:function(){i.find("button").removeAttr("disabled"),i.find(".acf-spinner").removeClass("is-active"),i.find("span").delay(1500).fadeOut(250,function(){$(this).html(""),$(this).show()}),a.focus()}})},append_new_term:function(e){var t={id:e.term_id,text:e.term_label};switch($('.acf-taxonomy-field[data-taxonomy="'+this.o.taxonomy+'"]').each(function(){var t=$(this).data("type");if("radio"==t||"checkbox"==t){var i=$(this).children('input[type="hidden"]'),a=$(this).find("ul:first"),n=i.attr("name");"checkbox"==t&&(n+="[]");var s=$(['',"",' ',""+e.term_label+" "," "," "].join(""));if(e.term_parent){var o=a.find('li[data-id="'+e.term_parent+'"]');a=o.children("ul"),a.exists()||(a=$(''),o.append(a))}a.append(s)}}),$("#acf-popup #term_parent").each(function(){var t=$(''+e.term_label+" ");e.term_parent?$(this).children('option[value="'+e.term_parent+'"]').after(t):$(this).append(t)}),this.o.type){case"select":this.$el.children("input").select2("data",t);break;case"multi_select":var i=this.$el.children("input"),a=i.select2("data")||[];a.push(t),i.select2("data",a);break;case"checkbox":case"radio":var n=this.$el.find(".categorychecklist-holder"),s=n.find('li[data-id="'+e.term_id+'"]'),o=n.get(0).scrollTop+(s.offset().top-n.offset().top);s.find("input").prop("checked",!0),n.animate({scrollTop:o},"250")}}})}(jQuery),function($){acf.fields.url=acf.field.extend({type:"url",$input:null,actions:{ready:"render",append:"render"},events:{'keyup input[type="url"]':"render"},focus:function(){this.$input=this.$field.find('input[type="url"]')},is_valid:function(){var e=this.$input.val();if(e.indexOf("://")!==-1);else if(0!==e.indexOf("//"))return!1;return!0},render:function(){this.is_valid()?this.$input.parent().addClass("valid"):this.$input.parent().removeClass("valid")}})}(jQuery),function($){acf.validation=acf.model.extend({actions:{ready:"ready",append:"ready"},filters:{validation_complete:"validation_complete"},events:{"click #save-post":"click_ignore",'click [type="submit"]':"click_publish","submit form":"submit_form","click .acf-error-message a":"click_message"},active:1,ignore:0,busy:0,valid:!0,errors:[],error_class:"acf-error",message_class:"acf-error-message",$trigger:null,ready:function(e){e.find(".acf-field input").filter('[type="number"], [type="email"], [type="url"]').on("invalid",function(e){e.preventDefault(),acf.validation.errors.push({input:$(this).attr("name"),message:e.target.validationMessage}),acf.validation.fetch($(this).closest("form"))})},validation_complete:function(e,t){if(!this.errors.length)return e;e.valid=0,e.errors=e.errors||[];var a=[];if(e.errors.length)for(i in e.errors)a.push(e.errors[i].input);if(this.errors.length)for(i in this.errors){var n=this.errors[i];$.inArray(n.input,a)===-1&&e.errors.push(n)}return this.errors=[],e},click_message:function(e){e.preventDefault(),acf.remove_el(e.$el.parent())},click_ignore:function(e){this.ignore=1,this.$trigger=e.$el},click_publish:function(e){this.$trigger=e.$el},submit_form:function(e){if(!this.active)return!0;if(this.ignore)return this.ignore=0,!0;if(!e.$el.find("#acf-form-data").exists())return!0;var t=e.$el.find("#wp-preview");return t.exists()&&t.val()?(this.toggle(e.$el,"unlock"),!0):(e.preventDefault(),void this.fetch(e.$el))},toggle:function(e,t){t=t||"unlock";var i=null,a=null,n=$("#submitdiv");n.exists()||(n=$("#submitpost")),n.exists()||(n=e.find("p.submit").last()),n.exists()||(n=e.find(".acf-form-submit")),n.exists()||(n=e),i=n.find('input[type="submit"], .button'),a=n.find(".spinner, .acf-spinner"),this.hide_spinner(a),"unlock"==t?this.enable_submit(i):"lock"==t&&(this.disable_submit(i),this.show_spinner(a.last()))},fetch:function(e){if(this.busy)return!1;var t=this;acf.do_action("validation_begin");var i=acf.serialize_form(e);i.action="acf/validate_save_post",i=acf.prepare_for_ajax(i),this.busy=1,this.toggle(e,"lock"),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"json",success:function(i){acf.is_ajax_success(i)&&t.fetch_success(e,i.data)},complete:function(){t.fetch_complete(e)}})},fetch_complete:function(e){if(this.busy=0,this.toggle(e,"unlock"),this.valid){this.ignore=1;var t=e.children(".acf-error-message");t.exists()&&(t.addClass("-success"),t.children("p").html(acf._e("validation_successful")),setTimeout(function(){acf.remove_el(t)},2e3)),e.find(".acf-postbox.acf-hidden").remove(),acf.do_action("submit",e),this.$trigger?this.$trigger.click():e.submit(),this.toggle(e,"lock")}},fetch_success:function(e,t){if(t=acf.apply_filters("validation_complete",t,e),!t||t.valid||!t.errors)return this.valid=!0,void acf.do_action("validation_success");acf.do_action("validation_failure"),this.valid=!1,this.$trigger=null;var i=null,a=0,n=acf._e("validation_failed");if(t.errors&&t.errors.length>0){for(var s in t.errors){var o=t.errors[s];if(o.input){var r=e.find('[name="'+o.input+'"]').first();if(r.exists()||(r=e.find('[name^="'+o.input+'"]').first()),r.exists()){a++;var l=acf.get_field_wrap(r);this.add_error(l,o.message),null===i&&(i=l)}}else n+=". "+o.message}1==a?n+=". "+acf._e("validation_failed_1"):a>1&&(n+=". "+acf._e("validation_failed_2").replace("%d",a))}var c=e.children(".acf-error-message");c.exists()||(c=$(''),e.prepend(c)),c.children("p").html(n),null===i&&(i=c),setTimeout(function(){$("html, body").animate({scrollTop:i.offset().top-$(window).height()/2},500)},1)},add_error:function(e,t){var i=this;e.addClass(this.error_class),void 0!==t&&(e.children(".acf-input").children("."+this.message_class).remove(),e.children(".acf-input").prepend('"));var a=function(){i.remove_error(e),e.off("focus change","input, textarea, select",a)};e.on("focus change","input, textarea, select",a),acf.do_action("add_field_error",e)},remove_error:function(e){var t=e.children(".acf-input").children("."+this.message_class);e.removeClass(this.error_class),setTimeout(function(){acf.remove_el(t)},250),acf.do_action("remove_field_error",e)},add_warning:function(e,t){this.add_error(e,t),setTimeout(function(){acf.validation.remove_error(e)},1e3)},show_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.addClass("is-active"):e.css("display","inline-block")}},hide_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.removeClass("is-active"):e.css("display","none")}},disable_submit:function(e){e.exists()&&e.addClass("disabled button-disabled button-primary-disabled")},enable_submit:function(e){e.exists()&&e.removeClass("disabled button-disabled button-primary-disabled")}})}(jQuery),function($){acf.fields.wysiwyg=acf.field.extend({type:"wysiwyg",$el:null,$textarea:null,toolbars:{},events:{"mousedown .acf-editor-wrap.delay":"mousedown"},actions:{load:"initialize",append:"initialize",remove:"disable",sortstart:"disable",sortstop:"enable"},focus:function(){this.$el=this.$field.find(".wp-editor-wrap").last(),this.$textarea=this.$el.find("textarea"),this.o=acf.get_data(this.$el),this.o.id=this.$textarea.attr("id")},mousedown:function(e){e.preventDefault(),this.$el.removeClass("delay"),this.$el.find(".acf-editor-toolbar").remove(),this.initialize()},initialize:function(){if(!this.$el.hasClass("delay")&&"undefined"!=typeof tinyMCEPreInit){var e=this.o.id,t=acf.get_uniqid("acf-editor-"),i=this.$el.outerHTML();i=acf.str_replace(e,t,i),this.$el.replaceWith(i),this.o.id=t,this.initialize_tinymce(),this.initialize_quicktags()}},initialize_tinymce:function(){if("undefined"!=typeof tinymce){var e=this.get_mceInit();if(tinyMCEPreInit.mceInit[e.id]=e,this.$el.hasClass("tmce-active"))try{tinymce.init(e);var t=tinyMCE.get(e.id);acf.do_action("wysiwyg_tinymce_init",t,t.id,e,this.$field)}catch(e){}}},initialize_quicktags:function(){if("undefined"!=typeof quicktags){var e=this.get_qtInit();tinyMCEPreInit.qtInit[e.id]=e;try{var t=quicktags(e);this._buttonsInit(t),acf.do_action("wysiwyg_quicktags_init",t,t.id,e,this.$field)}catch(e){}}},get_mceInit:function(){var e=this.$field,t=this.get_toolbar(this.o.toolbar),i=$.extend({},tinyMCEPreInit.mceInit.acf_content);if(i.selector="#"+this.o.id,i.id=this.o.id,i.elements=this.o.id,t)for(var a=tinymce.majorVersion<4?"theme_advanced_buttons":"toolbar",n=1;n<5;n++)i[a+n]=acf.isset(t,n)?t[n]:"";return tinymce.majorVersion<4?i.setup=function(t){t.onInit.add(function(t,i){$(t.getBody()).on("focus",function(){acf.validation.remove_error(e)}),$(t.getBody()).on("blur",function(){t.save(),e.find("textarea").trigger("change")})})}:i.setup=function(t){t.on("focus",function(t){acf.validation.remove_error(e)}),t.on("change",function(i){t.save(),e.find("textarea").trigger("change")})},i.wp_autoresize_on=!1,i=acf.apply_filters("wysiwyg_tinymce_settings",i,i.id,this.$field)},get_qtInit:function(){var e=$.extend({},tinyMCEPreInit.qtInit.acf_content);return e.id=this.o.id,e=acf.apply_filters("wysiwyg_quicktags_settings",e,e.id,this.$field)},disable:function(){try{var e=tinyMCE.get(this.o.id);e.save(),e.destroy()}catch(e){}},enable:function(){try{this.$el.hasClass("tmce-active")&&switchEditors.go(this.o.id,"tmce")}catch(e){}},get_toolbar:function(e){return"undefined"!=typeof this.toolbars[e]&&this.toolbars[e]},_buttonsInit:function(e){var t=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";canvas=e.canvas,name=e.name,settings=e.settings,html="",theButtons={},use="",settings.buttons&&(use=","+settings.buttons+",");for(i in edButtons)edButtons[i]&&(id=edButtons[i].id,use&&t.indexOf(","+id+",")!==-1&&use.indexOf(","+id+",")===-1||edButtons[i].instance&&edButtons[i].instance!==inst||(theButtons[id]=edButtons[i],edButtons[i].html&&(html+=edButtons[i].html(name+"_"))));use&&use.indexOf(",fullscreen,")!==-1&&(theButtons.fullscreen=new qt.FullscreenButton,html+=theButtons.fullscreen.html(name+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(theButtons.textdirection=new qt.TextDirectionButton,html+=theButtons.textdirection.html(name+"_")),e.toolbar.innerHTML=html,e.theButtons=theButtons}});var e=acf.model.extend({$div:null,actions:{ready:"ready"},ready:function(){this.$div=$("#acf-hidden-wp-editor"),this.$div.exists()&&(this.$div.appendTo("body"),"undefined"!=typeof tinymce&&tinymce.on("AddEditor",function(e){var t=e.editor;"acf"===t.id.substr(0,3)&&(t=tinymce.editors.content||t,tinymce.activeEditor=t,wpActiveEditor=t.id)}))}})}(jQuery);
\ No newline at end of file
+!function(e,t){"use strict";var i=function(){function e(){return u}function t(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("actions",e,t,i,a)),f}function i(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&d("actions",t,e),f}function a(e,t){return"string"==typeof e&&r("actions",e,t),f}function n(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("filters",e,t,i,a)),f}function s(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?d("filters",t,e):f}function o(e,t){return"string"==typeof e&&r("filters",e,t),f}function r(e,t,i,a){if(u[e][t])if(i){var n=u[e][t],s;if(a)for(s=n.length;s--;){var o=n[s];o.callback===i&&o.context===a&&n.splice(s,1)}else for(s=n.length;s--;)n[s].callback===i&&n.splice(s,1)}else u[e][t]=[]}function l(e,t,i,a,n){var s={callback:i,priority:a,context:n},o=u[e][t];o?(o.push(s),o=c(o)):o=[s],u[e][t]=o}function c(e){for(var t,i,a,n=1,s=e.length;nt.priority;)e[i]=e[i-1],--i;e[i]=t}return e}function d(e,t,i){var a=u[e][t];if(!a)return"filters"===e&&i[0];var n=0,s=a.length;if("filters"===e)for(;n0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},acf={l10n:{},o:{},update:function(e,t){this.o[e]=t},get:function(e){return"undefined"!=typeof this.o[e]?this.o[e]:null},_e:function(e,t){t=t||!1;var i=this.l10n[e]||"";return t&&(i=i[t]||""),i},add_action:function(){for(var e=arguments[0].split(" "),t=e.length,i=0;ie.length?Array(1+(t-e.length)).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,i=e,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(this.php_js.uniqidSeed,5),t&&(i+=(10*Math.random()).toFixed(8).toString()),i},serialize_form:function(e,t){t=t||"";var i={},a={},n=e.find("select, textarea, input").serializeArray();return $.each(n,function(e,n){var s=n.name,o=n.value;if(t){if(0!==s.indexOf(t))return;s=s.substr(t.length),"["==s.slice(0,1)&&(s=s.replace("[",""),s=s.replace("]",""))}"[]"===s.slice(-2)&&(s=s.slice(0,-2),"undefined"==typeof a[s]&&(a[s]=-1),a[s]++,s+="["+a[s]+"]"),i[s]=o}),i},serialize:function(e,t){return this.serialize_form.apply(this,arguments)},disable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;if(e.prop("disabled",!0),t){var i=e.data("acf_disabled")||[],a=i.indexOf(t);a<0&&(i.push(t),e.data("acf_disabled",i))}return!0},enable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;var i=e.data("acf_disabled")||[];if(t){var a=i.indexOf(t);a>-1&&(i.splice(a,1),e.data("acf_disabled",i))}return!i.length&&(e.prop("disabled",!1),!0)},disable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.disable($(this),t)})},disable_form:function(e,t){this.disable_el.apply(this,arguments)},enable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.enable($(this),t)})},enable_form:function(e,t){this.enable_el.apply(this,arguments)},remove_tr:function(e,t){var i=e.height(),a=e.children().length;e.addClass("acf-remove-element"),setTimeout(function(){e.removeClass("acf-remove-element"),e.html(' '),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0,e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap('
'),e.animate({opacity:0},250),e.parent(".acf-temp-wrap").animate({height:i},250,function(){$(this).remove(),"function"==typeof t&&t()})},isset:function(){var e=arguments,t=e.length,a=null,n;if(0===t)throw new Error("Empty isset");for(a=e[0],i=1;i #acf-popup"),$popup.exists())return update_popup(e);var t=['"].join("");return $("body").append(t),$("#acf-popup").on("click",".bg, .acf-close-popup",function(e){e.preventDefault(),acf.close_popup()}),this.update_popup(e)},update_popup:function(e){return $popup=$("#acf-popup"),!!$popup.exists()&&(e=$.extend({},{title:"",content:"",width:0,height:0,loading:!1},e),e.title&&$popup.find(".title h3").html(e.title),e.content&&($inner=$popup.find(".inner:first"),$inner.html(e.content),acf.do_action("append",$inner),$inner.attr("style","position: relative;"),e.height=$inner.outerHeight(),$inner.removeAttr("style")),e.width&&$popup.find(".acf-popup-box").css({width:e.width,"margin-left":0-e.width/2}),e.height&&(e.height+=44,$popup.find(".acf-popup-box").css({height:e.height,"margin-top":0-e.height/2})),e.loading?$popup.find(".loading").show():$popup.find(".loading").hide(),$popup)},close_popup:function(){$popup=$("#acf-popup"),$popup.exists()&&$popup.remove()},update_user_setting:function(e,t){$.ajax({url:acf.get("ajaxurl"),dataType:"html",type:"post",data:acf.prepare_for_ajax({action:"acf/update_user_setting",name:e,value:t})})},prepare_for_ajax:function(e){return e.nonce=acf.get("nonce"),e.post_id=acf.get("post_id"),e=acf.apply_filters("prepare_for_ajax",e)},is_ajax_success:function(e){return!(!e||!e.success)},get_ajax_message:function(e){var t={text:"",type:"error"};return e?(e.success&&(t.type="success"),e.data&&e.data.message&&(t.text=e.data.message),e.data&&e.data.error&&(t.text=e.data.error),t):t},is_in_view:function(e){var t=e.offset().top,i=t+e.height();if(t===i)return!1;var a=$(window).scrollTop(),n=a+$(window).height();return i<=n&&t>=a},val:function(e,t){var i=e.val();e.val(t),t!=i&&e.trigger("change")},str_replace:function(e,t,i){return i.split(e).join(t)},str_sanitize:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,a=function(e){return"undefined"!=typeof t[e]?t[e]:e};return e=e.replace(i,a),e=e.toLowerCase()},addslashes:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},render_select:function(e,t){var i=e.val();e.html(""),t&&$.each(t,function(t,a){var n=e;a.group&&(n=e.find('optgroup[label="'+a.group+'"]'),n.exists()||(n=$(' '),e.append(n))),n.append(''+a.label+" "),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e){"undefined"!=typeof e.length&&(e={$el:e}),e=acf.parse_args(e,{$el:!1,search:"",replace:"",before:function(e){},after:function(e,t){},append:function(e,t){e.after(t)}});var t=e.$el,i;e.search||(e.search=t.attr("data-id")),e.replace||(e.replace=acf.get_uniqid()),e.before.apply(this,[t]),acf.do_action("before_duplicate",t);var i=t.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),e.search&&(i.attr("data-id",e.replace),i.find('[id*="'+e.search+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(e.search,e.replace))}),i.find('[name*="'+e.search+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(e.search,e.replace))}),i.find('label[for*="'+e.search+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(e.search,e.replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",t,i),e.after.apply(this,[t,i]),e.append.apply(this,[t,i]),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("").html(e).text()},parse_args:function(e,t){return $.extend({},t,e)},enqueue_script:function(e,t){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,i.readyState?i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(i.onreadystatechange=null,t())}:i.onload=function(){t()},document.body.appendChild(i)}},acf.model={actions:{},filters:{},events:{},extend:function(e){var t=$.extend({},this,e);return $.each(t.actions,function(e,i){t._add_action(e,i)}),$.each(t.filters,function(e,i){t._add_filter(e,i)}),$.each(t.events,function(e,i){t._add_event(e,i)}),t},_add_action:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_action(e,i[t],n,i)},_add_filter:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_filter(e,i[t],n,i)},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1);$(document).on(a,n,function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,[e])})},get:function(e,t){return t=t||null,"undefined"!=typeof this[e]&&(t=this[e]),t},set:function(e,t){return this[e]=t,"function"==typeof this["_set_"+e]&&this["_set_"+e].apply(this),this}},acf.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_action(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_filter(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),s=acf.get_selector(i.type);$(document).on(a,s+" "+n,function(e){e.$el=$(this),e.$field=acf.get_closest_field(e.$el,i.type),i.set("$field",e.$field),i[t].apply(i,[e])})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(e){return this.set("$field",e)}}),acf.fields=acf.model.extend({actions:{prepare:"_prepare",prepare_field:"_prepare_field",ready:"_ready",ready_field:"_ready_field",append:"_append",append_field:"_append_field",load:"_load",load_field:"_load_field",remove:"_remove",remove_field:"_remove_field",sortstart:"_sortstart",sortstart_field:"_sortstart_field",sortstop:"_sortstop",sortstop_field:"_sortstop_field",show:"_show",show_field:"_show_field",hide:"_hide",hide_field:"_hide_field"},_prepare:function(e){acf.get_fields("",e).each(function(){acf.do_action("prepare_field",$(this))})},_prepare_field:function(e){acf.do_action("prepare_field/type="+e.data("type"),e)},_ready:function(e){acf.get_fields("",e).each(function(){acf.do_action("ready_field",$(this))})},_ready_field:function(e){acf.do_action("ready_field/type="+e.data("type"),e)},_append:function(e){acf.get_fields("",e).each(function(){acf.do_action("append_field",$(this))})},_append_field:function(e){acf.do_action("append_field/type="+e.data("type"),e)},_load:function(e){acf.get_fields("",e).each(function(){acf.do_action("load_field",$(this))})},_load_field:function(e){acf.do_action("load_field/type="+e.data("type"),e)},_remove:function(e){acf.get_fields("",e).each(function(){acf.do_action("remove_field",$(this))})},_remove_field:function(e){acf.do_action("remove_field/type="+e.data("type"),e)},_sortstart:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstart_field",$(this),t)})},_sortstart_field:function(e,t){acf.do_action("sortstart_field/type="+e.data("type"),e,t)},_sortstop:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstop_field",$(this),t)})},_sortstop_field:function(e,t){acf.do_action("sortstop_field/type="+e.data("type"),e,t)},_hide:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("hide_field",$(this),t)})},_hide_field:function(e,t){acf.do_action("hide_field/type="+e.data("type"),e,t)},_show:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("show_field",$(this),t)})},_show_field:function(e,t){acf.do_action("show_field/type="+e.data("type"),e,t)}}),$(document).ready(function(){acf.do_action("ready",$("body"))}),$(window).on("load",function(){acf.do_action("load",$("body"))}),acf.layout=acf.model.extend({active:0,actions:{"prepare 99":"prepare",refresh:"refresh"},prepare:function(){this.active=1,this.refresh()},refresh:function(e){if(this.active){e=e||$("body");var t=this;this.render_tables(e),this.render_groups(e)}},render_tables:function(e){var t=this,i=e.find(".acf-table:visible");e.is("tr")&&(i=e.parent().parent()),i.each(function(){t.render_table($(this))})},render_table:function(e){var t=e.find("> thead th.acf-th"),i=1,a=100;if(t.exists()){var n=e.find("> tbody > tr"),s=n.find("> td.acf-field");n.hasClass("acf-clone")&&n.length>1&&(s=n.not(".acf-clone").find("> td.acf-field")),t.each(function(){var e=$(this),t=e.attr("data-key"),i=s.filter('[data-key="'+t+'"]');i.removeClass("appear-empty"),e.removeClass("hidden-by-conditional-logic"),i.exists()&&(0==i.not(".hidden-by-conditional-logic").length?e.addClass("hidden-by-conditional-logic"):i.filter(".hidden-by-conditional-logic").addClass("appear-empty"))}),t.css("width","auto"),t=t.not(".hidden-by-conditional-logic"),i=t.length,t.filter("[data-width]").each(function(){var e=parseInt($(this).attr("data-width"));a-=e,$(this).css("width",e+"%")}),t=t.not("[data-width]"),t.each(function(){var e=a/t.length;$(this).css("width",e+"%")}),e.find(".acf-row .acf-field.-collapsed-target").removeAttr("colspan"),e.find(".acf-row.-collapsed .acf-field.-collapsed-target").attr("colspan",i)}},render_groups:function(e){var t=this,i=e.find(".acf-fields:visible");e&&e.is(".acf-fields")&&(i=i.add(e)),i.each(function(){t.render_group($(this))})},render_group:function(e){var t=$(),i=0,a=0,n=-1,s=e.children(".acf-field[data-width]:visible");s.exists()&&(s.removeClass("acf-r0 acf-c0").css({"min-height":0}),s.each(function(e){var s=$(this),o=s.position().top;0==e&&(i=o),o!=i&&(t.css({"min-height":a+1+"px"}),t=$(),i=s.position().top,a=0,n=-1),n++,a=s.outerHeight()>a?s.outerHeight():a,t=t.add(s),0==o?s.addClass("acf-r0"):0==n&&s.addClass("acf-c0")}),t.exists()&&t.css({"min-height":a+1+"px"}))}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){$('#acf-form-data input[name="_acfchanged"]').exists()&&$('#acf-form-data input[name="_acfchanged"]').val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{change:"on",submit:"off"},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){!this.changed&&this.active&&(this.changed=1,$(window).on("beforeunload",this.unload))},off:function(){this.changed=0,$(window).off("beforeunload",this.unload)},unload:function(){return acf._e("unload")}}),acf.tooltip=acf.model.extend({$el:null,events:{"mouseenter .acf-js-tooltip":"on","mouseleave .acf-js-tooltip":"off"},on:function(e){var t=e.$el.attr("title");if(t){this.$el=$(''+t+"
"),$("body").append(this.$el);var i=10;target_w=e.$el.outerWidth(),target_h=e.$el.outerHeight(),target_t=e.$el.offset().top,target_l=e.$el.offset().left,tooltip_w=this.$el.outerWidth(),tooltip_h=this.$el.outerHeight();var a=target_t-tooltip_h,n=target_l+target_w/2-tooltip_w/2;n$(window).width()?(this.$el.addClass("left"),n=target_l-tooltip_w,a=target_t+target_h/2-tooltip_h/2):a-$(window).scrollTop()')}}),acf.add_action("sortstart",function(e,t){e.is("tr")&&(e.css("position","relative"),e.children().each(function(){$(this).width($(this).width())}),e.css("position","absolute"),t.html(' '))}),acf.add_action("before_duplicate",function(e){e.find("select option:selected").addClass("selected")}),acf.add_action("after_duplicate",function(e,t){t.find("select").each(function(){var e=$(this),t=[];e.find("option.selected").each(function(){t.push($(this).val())}),e.val(t)}),e.find("select option.selected").removeClass("selected"),t.find("select option.selected").removeClass("selected")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return $.inArray(e,this)})}(jQuery),function($){acf.ajax=acf.model.extend({active:!1,actions:{ready:"ready"},events:{"change #page_template":"_change_template","change #parent_id":"_change_parent","change #post-formats-select input":"_change_format","change .categorychecklist input":"_change_term","change .categorychecklist select":"_change_term",'change .acf-taxonomy-field[data-save="1"] input':"_change_term",'change .acf-taxonomy-field[data-save="1"] select':"_change_term"},o:{},xhr:null,update:function(e,t){return this.o[e]=t,this},get:function(e){return this.o[e]||null},ready:function(){this.update("post_id",acf.get("post_id")),this.active=!0},fetch:function(){if(this.active&&acf.get("ajax")){this.xhr&&this.xhr.abort();var e=this,t=this.o;t.action="acf/post/get_field_groups",t.exists=[],$(".acf-postbox").not(".acf-hidden").each(function(){t.exists.push($(this).attr("id").substr(4))}),this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(t),type:"post",dataType:"json",success:function(t){acf.is_ajax_success(t)&&e.render(t.data)}})}},render:function(e){$(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),$.each(e,function(e,t){var i=$("#acf-"+t.key),a=$("#acf-"+t.key+"-hide"),n=a.parent();i.removeClass("acf-hidden hide-if-js").show(),n.removeClass("acf-hidden hide-if-js").show(),a.prop("checked",!0);var s=i.find(".acf-replace-with-fields");s.exists()&&(s.replaceWith(t.html),acf.do_action("append",i)),0===e&&$("#acf-style").html(t.style),i.find(".acf-hidden-by-postbox").prop("disabled",!1)}),$(".acf-postbox.acf-hidden").find("select, textarea, input").not(":disabled").each(function(){$(this).addClass("acf-hidden-by-postbox").prop("disabled",!0)})},sync_taxonomy_terms:function(){var e=[""];$(".categorychecklist, .acf-taxonomy-field").each(function(){var t=$(this),i=t.find('input[type="checkbox"]').not(":disabled"),a=t.find('input[type="radio"]').not(":disabled"),n=t.find("select").not(":disabled"),s=t.find('input[type="hidden"]').not(":disabled");t.is(".acf-taxonomy-field")&&"1"!=t.attr("data-save")||t.closest(".media-frame").exists()||(i.exists()?i.filter(":checked").each(function(){e.push($(this).val())}):a.exists()?a.filter(":checked").each(function(){e.push($(this).val())}):n.exists()?n.find("option:selected").each(function(){e.push($(this).val())}):s.exists()&&s.each(function(){$(this).val()&&e.push($(this).val())}))}),e=e.filter(function(e,t,i){return i.indexOf(e)==t}),this.update("post_taxonomy",e).fetch()},_change_template:function(e){var t=e.$el.val();this.update("page_template",t).fetch()},_change_parent:function(e){var t="parent",i=0;""!=e.$el.val()&&(t="child",i=e.$el.val()),this.update("page_type",t).update("page_parent",i).fetch()},_change_format:function(e){var t=e.$el.val();"0"==t&&(t="standard"),this.update("post_format",t).fetch()},_change_term:function(e){var t=this;e.$el.closest(".media-frame").exists()||setTimeout(function(){t.sync_taxonomy_terms()},1)}})}(jQuery),function($){acf.fields.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"_change","click .acf-add-checkbox":"_add"},focus:function(){this.$ul=this.$field.find("ul"),this.$input=this.$field.find('input[type="hidden"]')},add:function(){var e=this.$input.attr("name")+"[]",t=' ';this.$ul.find(".acf-add-checkbox").parent("li").before(t)},_change:function(e){var t=this.$ul,i=t.find('input[type="checkbox"]').not(".acf-checkbox-toggle"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a).trigger("change");if(e.$el.hasClass("acf-checkbox-custom")){var n=e.$el.next('input[type="text"]');e.$el.next('input[type="text"]').prop("disabled",!a),a||""!=n.val()||e.$el.parent("li").remove()}if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}},_add:function(e){this.add()}})}(jQuery),function($){acf.fields.color_picker=acf.field.extend({type:"color_picker",$input:null,$hidden:null,actions:{ready:"initialize",append:"initialize"},focus:function(){this.$input=this.$field.find('input[type="text"]'),this.$hidden=this.$field.find('input[type="hidden"]')},initialize:function(){var e=this.$input,t=this.$hidden,i=function(){setTimeout(function(){acf.val(t,e.val())},1)},a={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},a=acf.apply_filters("color_picker_args",a,this.$field);this.$input.wpColorPicker(a)}})}(jQuery),function($){acf.conditional_logic=acf.model.extend({actions:{"prepare 20":"render","append 20":"render"},events:{"change .acf-field input":"change","change .acf-field textarea":"change","change .acf-field select":"change"},items:{},triggers:{},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n],o=s.field,r=this.triggers[o]||{};r[e]=e,this.triggers[o]=r}}this.items[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.render_fields(t),acf.do_action("refresh",e)},change:function(e){var t=e.$el,i=acf.get_field_wrap(t),a=i.data("key");if("undefined"==typeof this.triggers[a])return!1;$parent=i.parent();for(var n in this.triggers[a]){var s=this.triggers[a][n],o=acf.get_fields(s,$parent,!0);this.render_fields(o)}acf.do_action("refresh",$parent)},render_fields:function(e){var t=this;e.each(function(){t.render_field($(this))})},render_field:function(e){var t=e.data("key");if("undefined"==typeof this.items[t])return!1;for(var i=!1,a=this.items[t],n=0;n-1,match}})}(jQuery),function($){acf.datepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_picker"),l10n&&"undefined"!=typeof $.datepicker&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){"undefined"!=typeof $.datepicker&&(t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'))},destroy:function(e){}}),acf.fields.date_picker=acf.field.extend({type:"date_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(this.o.save_format)return this.initialize2();var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field),acf.datepicker.init(this.$input,e),acf.do_action("date_picker_init",this.$input,e,this.$field)},initialize2:function(){this.$input.val(this.$hidden.val());var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:this.o.save_format,changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field);var t=e.dateFormat;e.dateFormat=this.o.save_format,acf.datepicker.init(this.$input,e),this.$input.datepicker("option","dateFormat",t),acf.do_action("date_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&"undefined"!=typeof $.timepicker&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){"undefined"!=typeof $.timepicker&&(t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'))},destroy:function(e){}}),acf.fields.date_time_picker=acf.field.extend({type:"date_time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){var e={dateFormat:this.o.date_format,timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day,controlType:"select",oneLine:!0};e=acf.apply_filters("date_time_picker_args",e,this.$field),acf.datetimepicker.init(this.$input,e),acf.do_action("date_time_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.file=acf.field.extend({type:"file",$el:null,$input:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-file-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"};return e.id&&(t=e.attributes),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$el.find("img").attr({
+src:e.icon,alt:e.alt,title:e.title}),this.$el.find('[data-name="title"]').text(e.title),this.$el.find('[data-name="filename"]').text(e.filename).attr("href",e.url),this.$el.find('[data-name="filesize"]').text(e.filesizeHumanReadable);var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(t,"repeater"),a=acf.media.popup({title:acf._e("file","select"),mode:"select",type:"",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-file-uploader.has-value").exists()&&void(t=!1)}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("file","edit"),button:acf._e("file","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},get_file_info:function(e,t){var i=e.val(),a={};if(!i)return void t.val("");a.url=i;var n=e[0].files;if(n.length){var s=n[0];if(a.size=s.size,a.type=s.type,s.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,r=new Image;r.onload=function(){a.width=this.width,a.height=this.height,t.val(jQuery.param(a))},r.src=o.createObjectURL(s)}}t.val(jQuery.param(a))},change:function(e){this.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.google_map=acf.field.extend({type:"google_map",url:"",$el:null,$search:null,timeout:null,status:"",geocoder:!1,map:!1,maps:{},$pending:$(),actions:{ready:"initialize",append:"initialize",show:"show"},events:{'click a[data-name="clear"]':"_clear",'click a[data-name="locate"]':"_locate",'click a[data-name="search"]':"_search","keydown .search":"_keydown","keyup .search":"_keyup","focus .search":"_focus","blur .search":"_blur","mousedown .acf-google-map":"_mousedown"},focus:function(){this.$el=this.$field.find(".acf-google-map"),this.$search=this.$el.find(".search"),this.o=acf.get_data(this.$el),this.o.id=this.$el.attr("id"),this.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status||"loading"!=this.status&&(acf.isset(window,"google","maps","places")?(this.status="ready",!0):(acf.isset(window,"google","maps")&&(this.status="ready"),this.url&&(this.status="loading",acf.enqueue_script(this.url,function(){e.status="ready",e.initialize_pending()})),"ready"==this.status))},initialize_pending:function(){var e=this;this.$pending.each(function(){e.set("$field",$(this)).initialize()}),this.$pending=$()},initialize:function(){if(!this.is_ready())return this.$pending=this.$pending.add(this.$field),!1;this.geocoder||(this.geocoder=new google.maps.Geocoder);var e=this,t=this.$field,i=this.$el,a=this.$search;a.val(this.$el.find(".input-address").val());var n=acf.apply_filters("google_map_args",{scrollwheel:!1,zoom:parseInt(this.o.zoom),center:new google.maps.LatLng(this.o.lat,this.o.lng),mapTypeId:google.maps.MapTypeId.ROADMAP},this.$field);if(this.map=new google.maps.Map(this.$el.find(".canvas")[0],n),acf.isset(window,"google","maps","places","Autocomplete")){var s=new google.maps.places.Autocomplete(this.$search[0]);s.bindTo("bounds",this.map),google.maps.event.addListener(s,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=s}var o=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(o),this.map.$el=i,this.map.$field=t;var r=i.find(".input-lat").val(),l=i.find(".input-lng").val();r&&l&&this.update(r,l).center(),google.maps.event.addListener(this.map.marker,"dragend",function(){var t=this.map.marker.getPosition(),i=t.lat(),a=t.lng();e.update(i,a).sync()}),google.maps.event.addListener(this.map,"click",function(t){var i=t.latLng.lat(),a=t.latLng.lng();e.update(i,a).sync()}),acf.do_action("google_map_init",this.map,this.map.marker,this.$field),this.maps[this.o.id]=this.map},search:function(e){var t=this,i=this.$search.val();if(!i)return!1;this.$el.find(".input-address").val(i);var a=i.split(",");if(2==a.length){var n=a[0],s=a[1];if($.isNumeric(n)&&$.isNumeric(s))return n=parseFloat(n),s=parseFloat(s),void t.update(n,s).center()}if(e&&e.geometry){var n=e.geometry.location.lat(),s=e.geometry.location.lng();return void t.update(n,s).center()}this.$el.addClass("-loading"),t.geocoder.geocode({address:i},function(i,a){if(t.$el.removeClass("-loading"),a!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+a);if(!i[0])return void console.log("No results found");e=i[0];var n=e.geometry.location.lat(),s=e.geometry.location.lng();t.update(n,s).center()})},update:function(e,t){var i=new google.maps.LatLng(e,t);return acf.val(this.$el.find(".input-lat"),e),acf.val(this.$el.find(".input-lng"),t),this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.$el.addClass("-value"),this.$field.removeClass("error"),acf.do_action("google_map_change",i,this.map,this.$field),this.$search.blur(),this},center:function(){var e=this.map.marker.getPosition(),t=this.o.lat,i=this.o.lng;e&&(t=e.lat(),i=e.lng());var a=new google.maps.LatLng(t,i);this.map.setCenter(a)},sync:function(){var e=this,t=this.map.marker.getPosition(),i=new google.maps.LatLng(t.lat(),t.lng());return this.$el.addClass("-loading"),this.geocoder.geocode({latLng:i},function(t,i){if(e.$el.removeClass("-loading"),i!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+i);if(!t[0])return void console.log("No results found");var a=t[0];e.$search.val(a.formatted_address),acf.val(e.$el.find(".input-address"),a.formatted_address)}),this},refresh:function(){return!!this.is_ready()&&(google.maps.event.trigger(this.map,"resize"),void this.center())},show:function(){var e=this,t=this.$field;setTimeout(function(){e.set("$field",t).refresh()},10)},_clear:function(e){this.$el.removeClass("-value -loading -search"),this.$search.val(""),acf.val(this.$el.find(".input-address"),""),acf.val(this.$el.find(".input-lat"),""),acf.val(this.$el.find(".input-lng"),""),this.map.marker.setVisible(!1)},_locate:function(e){var t=this;return navigator.geolocation?(this.$el.addClass("-loading"),void navigator.geolocation.getCurrentPosition(function(e){t.$el.removeClass("-loading");var i=e.coords.latitude,a=e.coords.longitude;t.update(i,a).sync().center()})):(alert(acf._e("google_map","browser_support")),this)},_search:function(e){this.search()},_focus:function(e){this.$el.removeClass("-value"),this._keyup()},_blur:function(e){var t=this,i=this.$el.find(".input-address").val();i&&(this.timeout=setTimeout(function(){t.$el.addClass("-value"),t.$search.val(i)},100))},_keydown:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){var t=this.$search.val();t?this.$el.addClass("-search"):this.$el.removeClass("-search")},_mousedown:function(e){var t=this;setTimeout(function(){clearTimeout(t.timeout)},1)}})}(jQuery),function($){acf.fields.image=acf.field.extend({type:"image",$el:null,$input:null,$img:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-image-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.$img=this.$el.find("img"),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",caption:"",description:"",width:0,height:0};return e.id&&(t=e.attributes,t.url=acf.maybe_get(t,"sizes."+this.o.preview_size+".url",t.url)),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$img.attr({src:e.url,alt:e.alt,title:e.title});var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(this.$field,"repeater"),a=acf.media.popup({title:acf._e("image","select"),mode:"select",type:"image",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-image-uploader.has-value").exists()&&void(t=!1)}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("image","edit"),button:acf._e("image","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},change:function(e){acf.fields.file.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.media=acf.model.extend({frames:[],mime_types:{},actions:{ready:"ready"},frame:function(){var e=this.frames.length-1;return!(e<0)&&this.frames[e]},destroy:function(e){e.detach(),e.dispose(),e=null,this.frames.pop()},popup:function(e){var t=acf.get("post_id"),i=!1;$.isNumeric(t)||(t=0);var a=acf.parse_args(e,{mode:"select",title:"",button:"",type:"",field:"",mime_types:"",library:"all",multiple:!1,attachment:0,post_id:t,select:function(){}});a.id&&(a.attachment=a.id);var i=this.new_media_frame(a);return this.frames.push(i),setTimeout(function(){i.open()},1),i},_get_media_frame_settings:function(e,t){return"select"===t.mode?e=this._get_select_frame_settings(e,t):"edit"===t.mode&&(e=this._get_edit_frame_settings(e,t)),e},_get_select_frame_settings:function(e,t){return t.type&&(e.library.type=t.type),"uploadedTo"===t.library&&(e.library.uploadedTo=t.post_id),e._button=acf._e("media","select"),e},_get_edit_frame_settings:function(e,t){return e.library.post__in=[t.attachment],e._button=acf._e("media","update"),e},_add_media_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+t.mode)},e),e.on("content:render:edit-image",function(){var e=this.state().get("image"),t=new wp.media.view.EditImage({model:e,controller:this}).render();this.content.set(t),t.loadEditor()},e),e.on("toolbar:create:select",function(t){t.view=new wp.media.view.Toolbar.Select({text:e.options._button,controller:this})},e),e.on("select",function(){var i=e.state(),a=i.get("image"),n=i.get("selection");if(a)return void t.select.apply(e,[a,0]);if(n){var s=0;return void n.each(function(i){t.select.apply(e,[i,s]),s++})}}),e.on("close",function(){setTimeout(function(){acf.media.destroy(e)},500)}),"select"===t.mode?e=this._add_select_frame_events(e,t):"edit"===t.mode&&(e=this._add_edit_frame_events(e,t)),e},_add_select_frame_events:function(e,t){var i=this;return acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=t.field,e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){try{var a=e.content.get().toolbar,n=a.get("filters"),s=a.get("search")}catch(e){return}if("image"==t.type&&(n.filters.all.text=acf._e("image","all"),delete n.filters.audio,delete n.filters.video,$.each(n.filters,function(e,t){null===t.props.type&&(t.props.type="image")})),t.mime_types){var o=t.mime_types.split(" ").join("").split(".").join("").split(",");$.each(o,function(e,t){$.each(i.mime_types,function(e,i){if(e.indexOf(t)!==-1){var a={text:t,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};n.filters[i]=a}})})}"uploadedTo"==t.library&&(delete n.filters.unattached,delete n.filters.uploaded,n.$el.parent().append(''+acf._e("image","uploadedTo")+" "),$.each(n.filters,function(e,i){i.props.uploadedTo=t.post_id})),$.each(n.filters,function(e,i){i.props._acfuploader=t.field}),s.model.attributes._acfuploader=t.field,"function"==typeof n.refresh&&n.refresh()}),e},_add_edit_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),a=wp.media.attachment(t.attachment);i.add(a)},e),e},new_media_frame:function(e){var t={title:e.title,multiple:e.multiple,library:{},states:[]};t=this._get_media_frame_settings(t,e);var i=wp.media.query(t.library);acf.isset(i,"mirroring","args")&&(i.mirroring.args._acfuploader=e.field),t.states=[new wp.media.controller.Library({library:i,multiple:t.multiple,title:t.title,priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})],acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage);var a=wp.media(t);return a.acf=e,a=this._add_media_frame_events(a,e)},ready:function(){var e=acf.get("wp_version"),t=acf.get("browser"),i=acf.get("post_id");acf.isset(window,"wp","media","view","settings","post")&&$.isNumeric(i)&&(wp.media.view.settings.post.id=i),t&&$("body").addClass("browser-"+t),e&&(e+="",major=e.substr(0,1),$("body").addClass("major-"+major)),acf.isset(window,"wp","media","view")&&(this.customize_Attachment(),this.customize_AttachmentFiltersAll(),this.customize_AttachmentCompat())},customize_Attachment:function(){var e=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=e.extend({render:function(){var t=acf.media.frame(),i=acf.maybe_get(this,"model.attributes.acf_errors");return t&&i&&this.$el.addClass("acf-disabled"),e.prototype.render.apply(this,arguments)},toggleSelection:function(t){var i=this.collection,a=this.options.selection,n=this.model,s=a.single(),o=acf.media.frame(),r=acf.maybe_get(this,"model.attributes.acf_errors"),l=this.controller.$el.find(".media-frame-content .media-sidebar");if(l.children(".acf-selection-error").remove(),l.children().removeClass("acf-hidden"),o&&r){var c=acf.maybe_get(this,"model.attributes.filename","");return l.children().addClass("acf-hidden"),l.prepend(['',''+acf._e("restricted")+" ",''+c+" ",''+r+" ","
"].join("")),a.reset(),void a.single(n)}e.prototype.toggleSelection.apply(this,arguments)}})},customize_AttachmentFiltersAll:function(){wp.media.view.AttachmentFilters.All.prototype.refresh=function(){this.$el.html(_.chain(this.filters).map(function(e,t){return{el:$(" ").val(t).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())}},customize_AttachmentCompat:function(){var e=wp.media.view.AttachmentCompat;wp.media.view.AttachmentCompat=e.extend({add_acf_expand_button:function(){var e=this.$el.closest(".media-modal");if(!e.find(".media-frame-router .acf-expand-details").exists()){var t=$(['',' '+acf._e("expand_details")+" ",' '+acf._e("collapse_details")+" "," "].join(""));t.on("click",function(t){t.preventDefault(),e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),e.find(".media-frame-router").append(t)}},render:function(){if(this.ignore_render)return this;var t=this;return setTimeout(function(){t.add_acf_expand_button()},0),clearTimeout(acf.media.render_timout),acf.media.render_timout=setTimeout(function(){acf.do_action("append",t.$el)},50),e.prototype.render.apply(this,arguments)},dispose:function(){return acf.do_action("remove",this.$el),e.prototype.dispose.apply(this,arguments)},save:function(e){e&&e.preventDefault();var t=acf.serialize_form(this.$el);this.ignore_render=!0,this.model.saveCompat(t)}})}})}(jQuery),function($){acf.fields.oembed=acf.field.extend({type:"oembed",$el:null,events:{'click [data-name="search-button"]':"_search",'click [data-name="clear-button"]':"_clear",'click [data-name="value-title"]':"_edit",'keypress [data-name="search-input"]':"_keypress",'keyup [data-name="search-input"]':"_keyup",'blur [data-name="search-input"]':"_blur"},focus:function(){this.$el=this.$field.find(".acf-oembed"),this.$search=this.$el.find('[data-name="search-input"]'),this.$input=this.$el.find('[data-name="value-input"]'),this.$title=this.$el.find('[data-name="value-title"]'),this.$embed=this.$el.find('[data-name="value-embed"]'),this.o=acf.get_data(this.$el)},maybe_search:function(){var e=this.$input.val(),t=this.$search.val();return t?void(t!=e&&this.search()):void this.clear()},search:function(){var e=this.$search.val();"http"!=e.substr(0,4)&&(e="http://"+e,this.$search.val(e)),this.$el.addClass("is-loading");var t=acf.prepare_for_ajax({action:"acf/fields/oembed/search",s:e,field_key:this.$field.data("key")});this.$el.data("xhr")&&this.$el.data("xhr").abort();var i=$.ajax({url:acf.get("ajaxurl"),data:t,type:"post",dataType:"json",context:this,success:this.search_success});this.$el.data("xhr",i)},search_success:function(e){var t=this.$search.val();return this.$el.removeClass("is-loading"),e&&e.html?(this.$el.removeClass("has-error").addClass("has-value"),this.$input.val(t),this.$title.html(t),void this.$embed.html(e.html)):void this.$el.removeClass("has-value").addClass("has-error")},clear:function(){this.$el.removeClass("has-error has-value"),this.$el.find('[data-name="search-input"]').val(""),this.$input.val(""),this.$title.html(""),this.$embed.html("")},edit:function(){this.$el.addClass("is-editing"),this.$search.val(this.$title.text()).focus()},blur:function(e){this.$el.removeClass("is-editing"),this.maybe_search()},_search:function(e){this.search()},_clear:function(e){this.clear()},_edit:function(e){this.edit()},_keypress:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()&&this.maybe_search()},_blur:function(e){this.blur()}})}(jQuery),function($){acf.fields.radio=acf.field.extend({type:"radio",$ul:null,actions:{ready:"initialize",append:"initialize"},events:{'click input[type="radio"]':"click"},focus:function(){this.$ul=this.$field.find(".acf-radio-list"),this.o=acf.get_data(this.$ul)},initialize:function(){this.$ul.find(".selected input").prop("checked",!0)},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected"),n=t.val();if(this.$ul.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),n=!1,e.$el.trigger("change")),this.o.other_choice){var s=this.$ul.find('input[type="text"]');"other"===n?s.prop("disabled",!1).attr("name",t.attr("name")):s.prop("disabled",!0).attr("name","")}}})}(jQuery),function($){acf.fields.relationship=acf.field.extend({type:"relationship",$el:null,$input:null,$filters:null,$choices:null,$values:null,actions:{ready:"initialize",append:"initialize"},events:{"keypress [data-filter]":"submit_filter","change [data-filter]":"change_filter","keyup [data-filter]":"change_filter","click .choices .acf-rel-item":"add_item",'click [data-name="remove_item"]':"remove_item"},focus:function(){this.$el=this.$field.find(".acf-relationship"),this.$input=this.$el.find(".acf-hidden input"),this.$choices=this.$el.find(".choices"),this.$values=this.$el.find(".values"),this.o=acf.get_data(this.$el)},initialize:function(){var e=this,t=this.$field,i=this.$el,a=this.$input;this.$values.children(".list").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){a.trigger("change")}}),this.$choices.children(".list").scrollTop(0).on("scroll",function(a){if(!i.hasClass("is-loading")&&!i.hasClass("is-empty")&&Math.ceil($(this).scrollTop())+$(this).innerHeight()>=$(this).get(0).scrollHeight){var n=i.data("paged")||1;i.data("paged",n+1),e.set("$field",t).fetch()}}),this.fetch()},maybe_fetch:function(){var e=this,t=this.$field;this.o.timeout&&clearTimeout(this.o.timeout);var i=setTimeout(function(){e.doFocus(t),e.fetch()},300);this.$el.data("timeout",i)},fetch:function(){var e=this,t=this.$field;this.$el.addClass("is-loading"),this.o.xhr&&(this.o.xhr.abort(),this.o.xhr=!1),this.o.action="acf/fields/relationship/query",this.o.field_key=t.data("key"),this.o.post_id=acf.get("post_id");var i=acf.prepare_for_ajax(this.o);1==i.paged&&this.$choices.children(".list").html(""),this.$choices.find("ul:last").append(' '+acf._e("relationship","loading")+"
");var a=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:i,success:function(i){e.set("$field",t).render(i)}});this.$el.data("xhr",a)},render:function(e){if(this.$el.removeClass("is-loading is-empty"),this.$choices.find("p").remove(),!e||!e.results||!e.results.length)return this.$el.addClass("is-empty"),void(1==this.o.paged&&this.$choices.children(".list").append(""+acf._e("relationship","empty")+"
"));var t=$(this.walker(e.results));if(this.$values.find(".acf-rel-item").each(function(){t.find('.acf-rel-item[data-id="'+$(this).data("id")+'"]').addClass("disabled")}),this.o.s){var i=this.o.s;i=acf.addslashes(i),t.find(".acf-rel-item").each(function(){var e=$(this).text(),t=e.replace(new RegExp("("+i+")","gi"),"$1 ");$(this).html($(this).html().replace(e,t))})}this.$choices.children(".list").append(t);var a="",n=null;this.$choices.find(".acf-rel-label").each(function(){return $(this).text()==a?(n.append($(this).siblings("ul").html()),void $(this).parent().remove()):(a=$(this).text(),void(n=$(this).siblings("ul")))})},walker:function(e){var t="";if($.isArray(e))for(var i in e)t+=this.walker(e[i]);else $.isPlainObject(e)&&(void 0!==e.children?(t+=''+e.text+' ',t+=this.walker(e.children),t+=" "):t+=''+e.text+" ");return t},submit_filter:function(e){13==e.which&&e.preventDefault()},change_filter:function(e){var t=e.$el.val(),i=e.$el.data("filter");this.$el.data(i)!=t&&(this.$el.data(i,t),this.$el.data("paged",1),e.$el.is("select")?this.fetch():this.maybe_fetch())},add_item:function(e){if(this.o.max>0&&this.$values.find(".acf-rel-item").length>=this.o.max)return void alert(acf._e("relationship","max").replace("{max}",this.o.max));if(e.$el.hasClass("disabled"))return!1;e.$el.addClass("disabled");var t=["",' ',''+e.$el.html(),' '," "," "].join("");this.$values.children(".list").append(t),this.$input.trigger("change"),acf.validation.remove_error(this.$field)},remove_item:function(e){var t=e.$el.parent(),i=t.data("id");t.parent("li").remove(),this.$choices.find('.acf-rel-item[data-id="'+i+'"]').removeClass("disabled"),this.$input.trigger("change")}})}(jQuery),function($){var e,t,i;e=acf.select2=acf.model.extend({version:0,version3:null,version4:null,actions:{"ready 1":"ready"},ready:function(){this.version=this.get_version(),this.do_function("ready")},get_version:function(){return acf.maybe_get(window,"Select2")?3:acf.maybe_get(window,"jQuery.fn.select2.amd")?4:0},do_function:function(e,t){t=t||[];var i="version"+this.version;return"undefined"!=typeof this[i]&&"undefined"!=typeof this[i][e]&&this[i][e].apply(this,t)},get_data:function(e,t){var i=this;return t=t||[],e.children().each(function(){var e=$(this);e.is("optgroup")?t.push({text:e.attr("label"),children:i.get_data(e)}):t.push({id:e.attr("value"),text:e.text()})}),t},decode_data:function(t){return t?($.each(t,function(i,a){t[i].text=acf.decode(a.text),"undefined"!=typeof a.children&&(t[i].children=e.decode_data(a.children))}),t):[]},count_data:function(e){var t=0;return e?($.each(e,function(e,i){t++,"undefined"!=typeof i.children&&(t+=i.children.length)}),t):t},get_ajax_data:function(e,t,i,a){var n=acf.prepare_for_ajax({action:e.ajax_action,field_key:e.key,s:t.term||"",paged:t.page||1});return n=acf.apply_filters("select2_ajax_data",n,e,i,a)},get_ajax_results:function(e,t){var i={results:[]};return e||(e=i),"undefined"==typeof e.results&&(i.results=e,e=i),e.results=this.decode_data(e.results),e=acf.apply_filters("select2_ajax_results",e,t)},get_value:function(e){var t=[],i=e.find("option:selected");return i.exists()?(i=i.sort(function(e,t){return+e.getAttribute("data-i")-+t.getAttribute("data-i")}),i.each(function(){var e=$(this);t.push({id:e.attr("value"),text:e.text(),$el:e})}),t):t},get_input_value:function(e){return e.val().split("||")},sync_input_value:function(e,t){e.val(t.val().join("||"))},add_option:function(e,t,i){e.find('option[value="'+t+'"]').length||e.append(''+i+" ")},select_option:function(e,t){e.find('option[value="'+t+'"]').prop("selected",!0),e.trigger("change")},unselect_option:function(e,t){e.find('option[value="'+t+'"]').prop("selected",!1),e.trigger("change")},init:function(e,t,i){this.do_function("init",arguments)},destroy:function(e){this.do_function("destroy",arguments)},add_value:function(e,t,i){this.do_function("add_value",arguments)},remove_value:function(e,t){this.do_function("remove_value",arguments)},remove_value:function(e,t){this.do_function("remove_value",arguments)}}),t=e.version3={ready:function(){var e=acf.get("locale"),t=acf.get("rtl");if(l10n=acf._e("select"),l10n){var i={formatMatches:function(e){return 1===e?l10n.matches_1:l10n.matches_n.replace("%d",e)},formatNoMatches:function(){return l10n.matches_0},formatAjaxError:function(){return l10n.load_fail},formatInputTooShort:function(e,t){var i=t-e.length;return 1===i?l10n.input_too_short_1:l10n.input_too_short_n.replace("%d",i)},formatInputTooLong:function(e,t){var i=e.length-t;return 1===i?l10n.input_too_long_1:l10n.input_too_long_n.replace("%d",i)},formatSelectionTooBig:function(e){return 1===e?l10n.selection_too_long_1:l10n.selection_too_long_n.replace("%d",e)},formatLoadMore:function(){return l10n.load_more},formatSearching:function(){return l10n.searching}};$.fn.select2.locales=acf.maybe_get(window,"jQuery.fn.select2.locales",{}),$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}},set_data:function(e,t){3==this.version&&(e=e.siblings("input")),e.select2("data",t)},append_data:function(e,t){3==this.version&&(e=e.siblings("input"));var i=e.select2("data")||[];i.push(t),e.select2("data",i)},init:function(i,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=i.siblings("input");if(s.exists()){var o={width:"100%",containerCssClass:"-acf",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e},formatResult:function(e,t,i,a){var n=$.fn.select2.defaults.formatResult(e,t,i,a);return e.description&&(n+=' '+e.description+" "),n}},r=this.get_value(i);if(a.multiple){var l=i.attr("name");o.formatSelection=function(e,t){var i=' ";return t.parent().append(i),e.text}}else r=acf.maybe_get(r,0,!1),!a.allow_null&&r&&s.val(r.id);a.allow_null&&i.find('option[value=""]').remove(),o.data=this.get_data(i),o.initSelection=function(e,t){t(r)},a.ajax&&(o.ajax={url:acf.get("ajaxurl"),dataType:"json",type:"post",cache:!1,quietMillis:250,data:function(t,i){var o={term:t,page:i};return e.get_ajax_data(a,o,s,n)},results:function(i,a){var n={page:a};return setTimeout(function(){t.merge_results()},1),e.get_ajax_results(i,n)}}),o.dropdownCss={"z-index":"999999999"},o.acf=a,o=acf.apply_filters("select2_args",o,i,a,n),s.select2(o);var c=s.select2("container");c.before(i),c.before(s),a.multiple&&c.find("ul.select2-choices").sortable({start:function(){s.select2("onSortStart")},stop:function(){s.select2("onSortEnd")}}),i.prop("disabled",!0).addClass("acf-disabled acf-hidden"),s.on("change",function(t){t.added&&e.add_option(i,t.added.id,t.added.text),e.select_option(i,t.val)}),acf.do_action("select2_init",s,o,a,n)}},merge_results:function(){var e="",t=null;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children(".select2-result-label"),a=$(this).children(".select2-result-sub");return i.text()==e?(t.append(a.children()),void $(this).remove()):(e=i.text(),void(t=a))})},destroy:function(e){var t=e.siblings("input");t.data("select2")&&(t.select2("destroy"),e.prop("disabled",!1).removeClass("acf-disabled acf-hidden"))},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i);var n=t.siblings("input"),s={id:i,text:a};if(!t.data("multiple"))return n.select2("data",s);var o=n.select2("data")||[];return o.push(s),n.select2("data",o)},remove_value:function(t,i){e.unselect_option(t,i);var a=t.siblings("input"),n=a.select2("data");t.data("multiple")?(n=$.grep(n,function(e){return e.id!=i}),a.select2("data",n)):n&&n.id==i&&a.select2("data",null)}},i=e.version4={init:function(t,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=t.siblings("input");if(s.exists()){var o={width:"100%",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e}},r=this.get_value(t);a.multiple?$.each(r,function(e,i){i.$el.detach().appendTo(t)}):r=acf.maybe_get(r,0,""),a.allow_null&&t.find('option[value=""]').remove(),a.ajax?o.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:function(i){return e.get_ajax_data(a,i,t,n)},processResults:function(t,a){var n=e.get_ajax_results(t,a);return n.more&&(n.pagination={more:!0}),setTimeout(function(){i.merge_results()},1),n}}:(t.removeData("ajax"),t.removeAttr("data-ajax")),o=acf.apply_filters("select2_args",o,t,a,n),t.select2(o);var l=t.next(".select2-container");if(a.multiple){var c=l.find("ul");c.sortable({stop:function(e){c.find(".select2-selection__choice").each(function(){var e=$($(this).data("data").element);e.detach().appendTo(t),s.trigger("change")})}}),t.on("select2:select",function(e){var i=$(e.params.data.element);i.detach().appendTo(t)})}s.val(""),l.addClass("-acf"),acf.do_action("select2_init",t,o,a,n)}},merge_results:function(){var e=null,t=null;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),a=$(this).children("strong");return null!==t&&a.text()==t.text()?(e.append(i.children()),void $(this).remove()):(e=i,void(t=a))})},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i)},remove_value:function(t,i){e.unselect_option(t,i)},destroy:function(e){e.data("select2")&&e.select2("destroy")}},acf.add_select2=function(t,i){e.init(t,i)},acf.remove_select2=function(t){e.destroy(t)}}(jQuery),function($){acf.fields.select=acf.field.extend({type:"select",$select:null,actions:{ready:"render",append:"render",remove:"remove"},focus:function(){this.$select=this.$field.find("select"),this.$select.exists()&&(this.o=acf.get_data(this.$select),this.o=acf.parse_args(this.o,{ajax_action:"acf/fields/"+this.type+"/query",key:this.$field.data("key")}))},render:function(){return!(!this.$select.exists()||!this.o.ui)&&void acf.select2.init(this.$select,this.o,this.$field)},remove:function(){return!(!this.$select.exists()||!this.o.ui)&&void acf.select2.destroy(this.$select)}}),acf.fields.user=acf.fields.select.extend({type:"user"}),acf.fields.post_object=acf.fields.select.extend({type:"post_object"}),acf.fields.page_link=acf.fields.select.extend({type:"page_link"})}(jQuery),function($){acf.fields.tab=acf.field.extend({type:"tab",$el:null,$wrap:null,actions:{prepare:"initialize",
+append:"initialize",hide:"hide",show:"show"},focus:function(){this.$el=this.$field.find(".acf-tab"),this.o=this.$el.data(),this.o.key=this.$field.data("key"),this.o.text=this.$el.html()},initialize:function(){this.$field.is("td")||e.add_tab(this.$field,this.o)},hide:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.addClass("hidden-by-conditional-logic"),setTimeout(function(){e.nextUntil(".acf-field-tab",".acf-field").each(function(){$(this).hasClass("hidden-by-conditional-logic")||(acf.conditional_logic.hide_field($(this)),$(this).addClass("-hbcl-"+i))}),s.hasClass("active")&&a.find("li:not(.hidden-by-conditional-logic):first a").trigger("click")},0))}},show:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.removeClass("hidden-by-conditional-logic"),setTimeout(function(){e.siblings(".acf-field.-hbcl-"+i).each(function(){acf.conditional_logic.show_field($(this)),$(this).removeClass("-hbcl-"+i)});var t=s.siblings(".active");t.exists()&&!t.hasClass("hidden-by-conditional-logic")||n.trigger("click")},0))}}});var e=acf.model.extend({actions:{"prepare 15":"render","append 15":"render","refresh 15":"render"},events:{"click .acf-tab-button":"_click"},render:function(e){$(".acf-tab-wrap",e).each(function(){var e=$(this),t=e.parent();if(e.find("li.active").exists()||e.find("li:not(.hidden-by-conditional-logic):first a").trigger("click"),t.hasClass("-sidebar")){var i=t.is("td")?"height":"min-height",a=e.position().top+e.children("ul").outerHeight(!0)-1;t.css(i,a)}})},add_group:function(e,t){var i=e.parent(),a="";return i.hasClass("acf-fields")&&"left"==t.placement?i.addClass("-sidebar"):t.placement="top",a=i.is("tbody")?' ':'',$group=$(a),e.before($group),$group},add_tab:function(e,t){var i=e.siblings(".acf-tab-wrap").last();i.exists()?t.endpoint&&(i=this.add_group(e,t)):i=this.add_group(e,t);var a=$(''+t.text+" ");""===t.text&&a.hide(),i.find("ul").append(a),e.hasClass("hidden-by-conditional-logic")&&a.addClass("hidden-by-conditional-logic")},_click:function(e){e.preventDefault();var t=this,i=e.$el,a=i.closest(".acf-tab-wrap"),n=i.data("key"),s="";i.parent().addClass("active").siblings().removeClass("active"),a.nextUntil(".acf-tab-wrap",".acf-field").each(function(){var e=$(this);return("tab"!=e.data("type")||(s=e.data("key"),!e.hasClass("endpoint")))&&void(s===n?e.hasClass("hidden-by-tab")&&(e.removeClass("hidden-by-tab"),acf.do_action("show_field",$(this),"tab")):e.hasClass("hidden-by-tab")||(e.addClass("hidden-by-tab"),acf.do_action("hide_field",$(this),"tab")))}),acf.do_action("refresh",a.parent()),i.trigger("blur")}}),t=acf.model.extend({active:1,actions:{add_field_error:"add_field_error"},add_field_error:function(e){if(this.active&&e.hasClass("hidden-by-tab")){var t=this,i=e.prevAll(".acf-field-tab:first"),a=e.prevAll(".acf-tab-wrap:first");a.find('a[data-key="'+i.data("key")+'"]').trigger("click"),this.active=0,setTimeout(function(){t.active=1},1e3)}}})}(jQuery),function($){acf.fields.time_picker=acf.field.extend({type:"time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if("undefined"!=typeof $.timepicker){var e={timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf._e("date_time_picker","selectText")};e.onClose=function(e,t){var i=t.dpDiv,a=i.find(".ui-datepicker-close");if(!e&&a.is(":hover")){if(e=acf.maybe_get(t,"settings.timepicker.formattedTime"),!e)return;$.datepicker._setTime(t)}},e=acf.apply_filters("time_picker_args",e,this.$field),this.$input.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('
'),acf.do_action("time_picker_init",this.$input,e,this.$field)}},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.true_false=acf.field.extend({type:"true_false",$switch:null,$input:null,actions:{prepare:"render",append:"render",show:"render"},events:{"change .acf-switch-input":"_change","focus .acf-switch-input":"_focus","blur .acf-switch-input":"_blur","keypress .acf-switch-input":"_keypress"},focus:function(){this.$input=this.$field.find(".acf-switch-input"),this.$switch=this.$field.find(".acf-switch")},render:function(){if(this.$switch.exists()){var e=this.$switch.children(".acf-switch-on"),t=this.$switch.children(".acf-switch-off");width=Math.max(e.width(),t.width()),width&&(e.css("min-width",width),t.css("min-width",width))}},on:function(){this.$input.prop("checked",!0),this.$switch.addClass("-on")},off:function(){this.$input.prop("checked",!1),this.$switch.removeClass("-on")},_change:function(e){var t=e.$el.prop("checked");t?this.on():this.off()},_focus:function(e){this.$switch.addClass("-focus")},_blur:function(e){this.$switch.removeClass("-focus")},_keypress:function(e){return 37===e.keyCode?this.off():39===e.keyCode?this.on():void 0}})}(jQuery),function($){acf.fields.taxonomy=acf.field.extend({type:"taxonomy",$el:null,actions:{ready:"render",append:"render",remove:"remove"},events:{'click a[data-name="add"]':"add_term"},focus:function(){this.$el=this.$field.find(".acf-taxonomy-field"),this.o=acf.get_data(this.$el),this.o.key=this.$field.data("key")},render:function(){var e=this.$field.find("select");if(e.exists()){var t=acf.get_data(e);t=acf.parse_args(t,{pagination:!0,ajax_action:"acf/fields/taxonomy/query",key:this.o.key}),acf.select2.init(e,t)}},remove:function(){var e=this.$field.find("select");return!!e.exists()&&void acf.select2.destroy(e)},add_term:function(e){var t=this;acf.open_popup({title:e.$el.attr("title")||e.$el.data("title"),loading:!0,height:220});var i=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key});$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(e){t.add_term_confirm(e)}})},add_term_confirm:function(e){var t=this;acf.update_popup({content:e}),$('#acf-popup input[name="term_name"]').focus(),$("#acf-popup form").on("submit",function(e){e.preventDefault(),t.add_term_submit($(this))})},add_term_submit:function(e){var t=this,i=e.find(".acf-submit"),a=e.find('input[name="term_name"]'),n=e.find('select[name="term_parent"]');if(""===a.val())return a.focus(),!1;i.find("button").attr("disabled","disabled"),i.find(".acf-spinner").addClass("is-active");var s=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key,term_name:a.val(),term_parent:n.exists()?n.val():0});$.ajax({url:acf.get("ajaxurl"),data:s,type:"post",dataType:"json",success:function(e){var n=acf.get_ajax_message(e);acf.is_ajax_success(e)&&(a.val(""),t.append_new_term(e.data)),n.text&&i.find("span").html(n.text)},complete:function(){i.find("button").removeAttr("disabled"),i.find(".acf-spinner").removeClass("is-active"),i.find("span").delay(1500).fadeOut(250,function(){$(this).html(""),$(this).show()}),a.focus()}})},append_new_term:function(e){var t={id:e.term_id,text:e.term_label};switch($('.acf-taxonomy-field[data-taxonomy="'+this.o.taxonomy+'"]').each(function(){var t=$(this).data("type");if("radio"==t||"checkbox"==t){var i=$(this).children('input[type="hidden"]'),a=$(this).find("ul:first"),n=i.attr("name");"checkbox"==t&&(n+="[]");var s=$(['',"",' ',""+e.term_label+" "," "," "].join(""));if(e.term_parent){var o=a.find('li[data-id="'+e.term_parent+'"]');a=o.children("ul"),a.exists()||(a=$(''),o.append(a))}a.append(s)}}),$("#acf-popup #term_parent").each(function(){var t=$(''+e.term_label+" ");e.term_parent?$(this).children('option[value="'+e.term_parent+'"]').after(t):$(this).append(t)}),this.o.type){case"select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"multi_select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"checkbox":case"radio":var a=this.$el.find(".categorychecklist-holder"),n=a.find('li[data-id="'+e.term_id+'"]'),s=a.get(0).scrollTop+(n.offset().top-a.offset().top);n.find("input").prop("checked",!0),a.animate({scrollTop:s},"250")}}})}(jQuery),function($){acf.fields.url=acf.field.extend({type:"url",$input:null,actions:{ready:"render",append:"render"},events:{'keyup input[type="url"]':"render"},focus:function(){this.$input=this.$field.find('input[type="url"]')},is_valid:function(){var e=this.$input.val();if(e.indexOf("://")!==-1);else if(0!==e.indexOf("//"))return!1;return!0},render:function(){this.is_valid()?this.$input.parent().addClass("valid"):this.$input.parent().removeClass("valid")}})}(jQuery),function($){acf.validation=acf.model.extend({actions:{ready:"ready",append:"ready"},filters:{validation_complete:"validation_complete"},events:{"click #save-post":"click_ignore",'click [type="submit"]':"click_publish","submit form":"submit_form","click .acf-error-message a":"click_message"},active:1,ignore:0,busy:0,valid:!0,errors:[],error_class:"acf-error",message_class:"acf-error-message",$trigger:null,ready:function(e){e.find(".acf-field input").filter('[type="number"], [type="email"], [type="url"]').on("invalid",function(e){e.preventDefault(),acf.validation.errors.push({input:$(this).attr("name"),message:e.target.validationMessage}),acf.validation.fetch($(this).closest("form"))})},validation_complete:function(e,t){if(!this.errors.length)return e;e.valid=0,e.errors=e.errors||[];var a=[];if(e.errors.length)for(i in e.errors)a.push(e.errors[i].input);if(this.errors.length)for(i in this.errors){var n=this.errors[i];$.inArray(n.input,a)===-1&&e.errors.push(n)}return this.errors=[],e},click_message:function(e){e.preventDefault(),acf.remove_el(e.$el.parent())},click_ignore:function(e){this.ignore=1,this.$trigger=e.$el},click_publish:function(e){this.$trigger=e.$el},submit_form:function(e){if(!this.active)return!0;if(this.ignore)return this.ignore=0,!0;if(!e.$el.find("#acf-form-data").exists())return!0;var t=e.$el.find("#wp-preview");return t.exists()&&t.val()?(this.toggle(e.$el,"unlock"),!0):(e.preventDefault(),void this.fetch(e.$el))},toggle:function(e,t){t=t||"unlock";var i=null,a=null,n=$("#submitdiv");n.exists()||(n=$("#submitpost")),n.exists()||(n=e.find("p.submit").last()),n.exists()||(n=e.find(".acf-form-submit")),n.exists()||(n=e),i=n.find('input[type="submit"], .button'),a=n.find(".spinner, .acf-spinner"),this.hide_spinner(a),"unlock"==t?this.enable_submit(i):"lock"==t&&(this.disable_submit(i),this.show_spinner(a.last()))},fetch:function(e){if(this.busy)return!1;var t=this;acf.do_action("validation_begin");var i=acf.serialize_form(e);i.action="acf/validate_save_post",i=acf.prepare_for_ajax(i),this.busy=1,this.toggle(e,"lock"),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"json",success:function(i){acf.is_ajax_success(i)&&t.fetch_success(e,i.data)},complete:function(){t.fetch_complete(e)}})},fetch_complete:function(e){if(this.busy=0,this.toggle(e,"unlock"),this.valid){this.ignore=1;var t=e.children(".acf-error-message");t.exists()&&(t.addClass("-success"),t.children("p").html(acf._e("validation_successful")),setTimeout(function(){acf.remove_el(t)},2e3)),e.find(".acf-postbox.acf-hidden").remove(),acf.do_action("submit",e),this.$trigger?this.$trigger.click():e.submit(),this.toggle(e,"lock")}},fetch_success:function(e,t){if(t=acf.apply_filters("validation_complete",t,e),!t||t.valid||!t.errors)return this.valid=!0,void acf.do_action("validation_success");acf.do_action("validation_failure"),this.valid=!1,this.$trigger=null;var i=null,a=0,n=acf._e("validation_failed");if(t.errors&&t.errors.length>0){for(var s in t.errors){var o=t.errors[s];if(o.input){var r=e.find('[name="'+o.input+'"]').first();if(r.exists()||(r=e.find('[name^="'+o.input+'"]').first()),r.exists()){a++;var l=acf.get_field_wrap(r);this.add_error(l,o.message),null===i&&(i=l)}}else n+=". "+o.message}1==a?n+=". "+acf._e("validation_failed_1"):a>1&&(n+=". "+acf._e("validation_failed_2").replace("%d",a))}var c=e.children(".acf-error-message");c.exists()||(c=$(''),e.prepend(c)),c.children("p").html(n),null===i&&(i=c),setTimeout(function(){$("html, body").animate({scrollTop:i.offset().top-$(window).height()/2},500)},1)},add_error:function(e,t){var i=this;e.addClass(this.error_class),void 0!==t&&(e.children(".acf-input").children("."+this.message_class).remove(),e.children(".acf-input").prepend('"));var a=function(){i.remove_error(e),e.off("focus change","input, textarea, select",a)};e.on("focus change","input, textarea, select",a),acf.do_action("add_field_error",e)},remove_error:function(e){var t=e.children(".acf-input").children("."+this.message_class);e.removeClass(this.error_class),setTimeout(function(){acf.remove_el(t)},250),acf.do_action("remove_field_error",e)},add_warning:function(e,t){this.add_error(e,t),setTimeout(function(){acf.validation.remove_error(e)},1e3)},show_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.addClass("is-active"):e.css("display","inline-block")}},hide_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.removeClass("is-active"):e.css("display","none")}},disable_submit:function(e){e.exists()&&e.addClass("disabled button-disabled button-primary-disabled")},enable_submit:function(e){e.exists()&&e.removeClass("disabled button-disabled button-primary-disabled")}})}(jQuery),function($){acf.fields.wysiwyg=acf.field.extend({type:"wysiwyg",$el:null,$textarea:null,toolbars:{},events:{"mousedown .acf-editor-wrap.delay":"mousedown"},actions:{load:"initialize",append:"initialize",remove:"disable",sortstart:"disable",sortstop:"enable"},focus:function(){this.$el=this.$field.find(".wp-editor-wrap").last(),this.$textarea=this.$el.find("textarea"),this.o=acf.get_data(this.$el),this.o.id=this.$textarea.attr("id")},mousedown:function(e){e.preventDefault(),this.$el.removeClass("delay"),this.$el.find(".acf-editor-toolbar").remove(),this.initialize()},initialize:function(){if(!this.$el.hasClass("delay")&&"undefined"!=typeof tinyMCEPreInit){var e=this.o.id,t=acf.get_uniqid("acf-editor-"),i=this.$el.outerHTML();i=acf.str_replace(e,t,i),this.$el.replaceWith(i),this.o.id=t,this.initialize_tinymce(),this.initialize_quicktags()}},initialize_tinymce:function(){if("undefined"!=typeof tinymce&&"undefined"!=typeof tinyMCEPreInit.mceInit){var e=this.get_mceInit();if(tinyMCEPreInit.mceInit[e.id]=e,this.$el.hasClass("tmce-active"))try{tinymce.init(e);var t=tinyMCE.get(e.id);acf.do_action("wysiwyg_tinymce_init",t,t.id,e,this.$field)}catch(e){}}},initialize_quicktags:function(){if("undefined"!=typeof quicktags&&"undefined"!=typeof tinyMCEPreInit.qtInit){var e=this.get_qtInit();tinyMCEPreInit.qtInit[e.id]=e;try{var t=quicktags(e);this._buttonsInit(t),acf.do_action("wysiwyg_quicktags_init",t,t.id,e,this.$field)}catch(e){}}},get_mceInit:function(){var e=this.$field,t=this.get_toolbar(this.o.toolbar),i=$.extend({},tinyMCEPreInit.mceInit.acf_content);if(i.selector="#"+this.o.id,i.id=this.o.id,i.elements=this.o.id,t)for(var a=tinymce.majorVersion<4?"theme_advanced_buttons":"toolbar",n=1;n<5;n++)i[a+n]=acf.isset(t,n)?t[n]:"";return tinymce.majorVersion<4?i.setup=function(t){t.onInit.add(function(t,i){$(t.getBody()).on("focus",function(){acf.validation.remove_error(e)}),$(t.getBody()).on("blur",function(){t.save(),e.find("textarea").trigger("change")})})}:i.setup=function(t){t.on("focus",function(t){acf.validation.remove_error(e)}),t.on("change",function(i){t.save(),e.find("textarea").trigger("change")})},i.wp_autoresize_on=!1,i=acf.apply_filters("wysiwyg_tinymce_settings",i,i.id,this.$field)},get_qtInit:function(){var e=$.extend({},tinyMCEPreInit.qtInit.acf_content);return e.id=this.o.id,e=acf.apply_filters("wysiwyg_quicktags_settings",e,e.id,this.$field)},disable:function(){try{var e=tinyMCE.get(this.o.id);e.save(),e.destroy()}catch(e){}},enable:function(){try{this.$el.hasClass("tmce-active")&&switchEditors.go(this.o.id,"tmce")}catch(e){}},get_toolbar:function(e){return"undefined"!=typeof this.toolbars[e]&&this.toolbars[e]},_buttonsInit:function(e){var t=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";canvas=e.canvas,name=e.name,settings=e.settings,html="",theButtons={},use="",settings.buttons&&(use=","+settings.buttons+",");for(i in edButtons)edButtons[i]&&(id=edButtons[i].id,use&&t.indexOf(","+id+",")!==-1&&use.indexOf(","+id+",")===-1||edButtons[i].instance&&edButtons[i].instance!==inst||(theButtons[id]=edButtons[i],edButtons[i].html&&(html+=edButtons[i].html(name+"_"))));use&&use.indexOf(",fullscreen,")!==-1&&(theButtons.fullscreen=new qt.FullscreenButton,html+=theButtons.fullscreen.html(name+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(theButtons.textdirection=new qt.TextDirectionButton,html+=theButtons.textdirection.html(name+"_")),e.toolbar.innerHTML=html,e.theButtons=theButtons}});var e=acf.model.extend({$div:null,actions:{ready:"ready"},ready:function(){this.$div=$("#acf-hidden-wp-editor"),this.$div.exists()&&(this.$div.appendTo("body"),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(e){var t=e.editor;"acf"===t.id.substr(0,3)&&(t=tinymce.editors.content||t,tinymce.activeEditor=t,wpActiveEditor=t.id)}))}})}(jQuery);
\ No newline at end of file
diff --git a/core/cache.php b/core/cache.php
index 74a5391..e8cc1c9 100644
--- a/core/cache.php
+++ b/core/cache.php
@@ -7,8 +7,7 @@ if( ! class_exists('acf_cache') ) :
class acf_cache {
// vars
- var $cache = array(),
- $reference = array();
+ var $reference = array();
/*
diff --git a/core/json.php b/core/json.php
index 30a0454..2e865ac 100644
--- a/core/json.php
+++ b/core/json.php
@@ -19,7 +19,7 @@ class acf_json {
add_action('acf/untrash_field_group', array($this, 'update_field_group'), 10, 1);
add_action('acf/trash_field_group', array($this, 'delete_field_group'), 10, 1);
add_action('acf/delete_field_group', array($this, 'delete_field_group'), 10, 1);
- add_action('acf/include_fields', array($this, 'include_fields'), 10, 0);
+ add_action('acf/include_fields', array($this, 'include_json_folders'), 10, 0);
}
@@ -83,19 +83,19 @@ class acf_json {
/*
- * include_fields
+ * include_json_folders
*
- * This function will include any JSON files found in the active theme
+ * This function will include all registered .json files
*
* @type function
* @date 10/03/2014
* @since 5.0.0
*
- * @param $version (int)
+ * @param n/a
* @return n/a
*/
- function include_fields() {
+ function include_json_folders() {
// validate
if( !acf_get_setting('json') ) return;
@@ -108,51 +108,74 @@ class acf_json {
// loop through and add to cache
foreach( $paths as $path ) {
- // remove trailing slash
- $path = untrailingslashit( $path );
-
-
- // check that path exists
- if( !file_exists( $path ) ) {
-
- continue;
-
- }
-
-
- $dir = opendir( $path );
-
- while(false !== ( $file = readdir($dir)) ) {
-
- // validate type
- if( pathinfo($file, PATHINFO_EXTENSION) !== 'json' ) continue;
-
-
- // read json
- $json = file_get_contents("{$path}/{$file}");
-
-
- // validate json
- if( empty($json) ) continue;
-
-
- // decode
- $json = json_decode($json, true);
-
-
- // add local
- $json['local'] = 'json';
-
-
- // add field group
- acf_add_local_field_group( $json );
-
- }
+ $this->include_json_folder( $path );
}
}
+
+ /*
+ * include_json_folder
+ *
+ * This function will include all .json files within a folder
+ *
+ * @type function
+ * @date 1/5/17
+ * @since 5.5.13
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ function include_json_folder( $path = '' ) {
+
+ // remove trailing slash
+ $path = untrailingslashit( $path );
+
+
+ // bail early if path does not exist
+ if( !is_dir($path) ) return false;
+
+
+ // open
+ $dir = opendir( $path );
+
+
+ // loop over files
+ while(false !== ( $file = readdir($dir)) ) {
+
+ // validate type
+ if( pathinfo($file, PATHINFO_EXTENSION) !== 'json' ) continue;
+
+
+ // read json
+ $json = file_get_contents("{$path}/{$file}");
+
+
+ // validate json
+ if( empty($json) ) continue;
+
+
+ // decode
+ $json = json_decode($json, true);
+
+
+ // add local
+ $json['local'] = 'json';
+
+
+ // add field group
+ acf_add_local_field_group( $json );
+
+ }
+
+
+ // return
+ return true;
+
+ }
+
}
diff --git a/core/updates.php b/core/updates.php
index a677a18..9cdd44d 100644
--- a/core/updates.php
+++ b/core/updates.php
@@ -6,6 +6,12 @@ if( ! class_exists('acf_updates') ) :
class acf_updates {
+ // vars
+ var $version = '2.0',
+ $plugins = array(),
+ $updates = false,
+ $dev = 0;
+
/*
* __construct
@@ -22,23 +28,273 @@ class acf_updates {
function __construct() {
- // append plugin information
- // Note: is_admin() was used previously, however this prevents jetpack manage & ManageWP from working
- add_filter('plugins_api', array($this, 'modify_plugin_details'), 20, 3);
-
-
- // append update information
- add_filter('pre_set_site_transient_update_plugins', array($this, 'modify_plugin_update'));
+ // append update information to transient
+ add_filter('pre_set_site_transient_update_plugins', array($this, 'modify_plugins_transient'), 10, 1);
- // add custom message when PRO not activated but update available
- add_action('in_plugin_update_message-' . acf_get_setting('basename'), array($this, 'modify_plugin_update_message'), 10, 2 );
+ // modify plugin data visible in the 'View details' popup
+ add_filter('plugins_api', array($this, 'modify_plugin_details'), 10, 3);
+
+ }
+
+
+ /*
+ * add_plugin
+ *
+ * This function will register a plugin
+ *
+ * @type function
+ * @date 8/4/17
+ * @since 5.5.10
+ *
+ * @param $plugin (array)
+ * @return n/a
+ */
+
+ function add_plugin( $plugin ) {
+
+ // validate
+ $plugin = wp_parse_args($plugin, array(
+ 'id' => '',
+ 'key' => '',
+ 'slug' => '',
+ 'basename' => '',
+ 'version' => '',
+ ));
+
+
+ // Check if is_plugin_active() function exists. This is required on the front end of the
+ // site, since it is in a file that is normally only loaded in the admin.
+ if( !function_exists( 'is_plugin_active' ) ) {
+
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+
+ }
+
+
+ // bail early if not active plugin (included in theme)
+ if( !is_plugin_active($plugin['basename']) ) return;
+
+
+ // add custom message in plugin update row
+ // removed: decided this message will have a negative impact on user
+ // if( is_admin() ) {
+ //
+ // add_action('in_plugin_update_message-' . $plugin['basename'], array($this, 'modify_plugin_update_message'), 10, 2 );
+ //
+ // }
+
+
+ // append
+ $this->plugins[ $plugin['basename'] ] = $plugin;
+
+ }
+
+
+ /*
+ * request
+ *
+ * This function will make a request to the ACF update server
+ *
+ * @type function
+ * @date 8/4/17
+ * @since 5.5.10
+ *
+ * @param $query (string)
+ * @param $body (array)
+ * @return (mixed)
+ */
+
+ function request( $query = 'index.php', $body = array() ) {
+
+ // vars
+ $url = 'https://connect.advancedcustomfields.com/' . $query;
+
+
+ // test
+ if( $this->dev ) $url = 'http://connect/' . $query;
+
+
+ // log
+ //acf_log('acf connect: '. $url);
+
+
+ // post
+ $raw_response = wp_remote_post( $url, array(
+ 'timeout' => 10,
+ 'body' => $body
+ ));
+
+
+ // wp error
+ if( is_wp_error($raw_response) ) {
+
+ return $raw_response;
+
+ // http error
+ } elseif( wp_remote_retrieve_response_code($raw_response) != 200 ) {
+
+ return new WP_Error( 'server_error', wp_remote_retrieve_response_message($raw_response) );
+
+ }
+
+
+ // decode response
+ $json = json_decode( wp_remote_retrieve_body($raw_response), true );
+
+
+ // allow non json value
+ if( $json === null ) {
+
+ return wp_remote_retrieve_body($raw_response);
+
+ }
+
+
+ // return
+ return $json;
}
/*
- * modify_plugin_information
+ * get_plugin_info
+ *
+ * This function will get plugin info and save as transient
+ *
+ * @type function
+ * @date 9/4/17
+ * @since 5.5.10
+ *
+ * @param $id (string)
+ * @return (mixed)
+ */
+
+ function get_plugin_info( $id = '' ) {
+
+ // var
+ $transient_name = 'acf_plugin_info_'.$id;
+
+
+ // delete transient (force-check is used to refresh)
+ if( !empty($_GET['force-check']) ) {
+
+ delete_transient($transient_name);
+
+ }
+
+
+ // try transient
+ $transient = get_transient($transient_name);
+ if( $transient !== false ) return $transient;
+
+
+ // connect
+ $response = $this->request('v2/plugins/get-info?p='.$id);
+
+
+ // update transient
+ set_transient($transient_name, $response, HOUR_IN_SECONDS );
+
+
+ // return
+ return $response;
+
+ }
+
+
+ /*
+ * refresh_plugins_transient
+ *
+ * This function will refresh plugin update info to the transient
+ *
+ * @type function
+ * @date 11/4/17
+ * @since 5.5.10
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ function refresh_plugins_transient() {
+
+ // vars
+ $transient = get_site_transient('update_plugins');
+
+
+ // bail early if no transient
+ if( empty($transient) ) return;
+
+
+ // update (will trigger modify function)
+ set_site_transient( 'update_plugins', $transient );
+
+ }
+
+
+ /*
+ * modify_plugins_transient
+ *
+ * This function will connect to the ACF website and find update information
+ *
+ * @type function
+ * @date 16/01/2014
+ * @since 5.0.0
+ *
+ * @param $transient (object)
+ * @return $transient
+ */
+
+ function modify_plugins_transient( $transient ) {
+
+ // bail early if no response (error)
+ if( !isset($transient->response) ) return $transient;
+
+
+ // fetch updates once (this filter is called multiple times during a single page load)
+ if( !$this->updates ) {
+
+ // vars
+ $plugins = $this->plugins;
+ $wp = array(
+ 'wp_name' => get_bloginfo('name'),
+ 'wp_url' => home_url(),
+ 'wp_version' => get_bloginfo('version'),
+ 'wp_language' => get_bloginfo('language'),
+ 'wp_timezone' => get_option('timezone_string'),
+ );
+ $post = array(
+ 'plugins' => wp_json_encode($plugins),
+ 'wp' => wp_json_encode($wp),
+ );
+
+
+ // connect
+ $this->updates = $this->request('v2/plugins/update-check', $post);
+
+ }
+
+
+ // append
+ if( is_array($this->updates) ) {
+
+ foreach( $this->updates['plugins'] as $basename => $update ) {
+
+ $transient->response[ $basename ] = (object) $update;
+
+ }
+
+ }
+
+
+ // return
+ return $transient;
+
+ }
+
+
+ /*
+ * modify_plugin_details
*
* This function will populate the plugin data visible in the 'View details' popup
*
@@ -55,88 +311,60 @@ class acf_updates {
function modify_plugin_details( $result, $action = null, $args = null ) {
// vars
- $slug = acf_get_setting('slug');
-
+ $plugin = false;
- // validate
- if( isset($args->slug) && $args->slug === $slug && acf_is_plugin_active() ) {
-
- // filter
- $result = apply_filters('acf/updates/plugin_details', $result, $action, $args);
-
- }
+
+ // only for 'plugin_information' action
+ if( $action !== 'plugin_information' ) return $result;
+
+
+ // find plugin via slug
+ foreach( $this->plugins as $p ) {
+
+ if( $args->slug == $p['slug'] ) $plugin = $p;
+
+ }
+
+
+ // bail early if plugin not found
+ if( !$plugin ) return $result;
+
+
+ // connect
+ $response = $this->get_plugin_info($plugin['id']);
+
+
+ // bail early if no response
+ if( !is_array($response) ) return $result;
+
+
+ // remove tags (different context)
+ unset($response['tags']);
+
+
+ // convert to object
+ $response = (object) $response;
+
+
+ // sections
+ $sections = array(
+ 'description' => '',
+ 'installation' => '',
+ 'changelog' => '',
+ 'upgrade_notice' => ''
+ );
+
+ foreach( $sections as $k => $v ) {
+
+ $sections[ $k ] = $response->$k;
+
+ }
+
+ $response->sections = $sections;
// return
- return $result;
-
- }
-
-
- /*
- * modify_plugin_update_information
- *
- * This function will connect to the ACF website and find release details
- *
- * @type function
- * @date 16/01/2014
- * @since 5.0.0
- *
- * @param $transient (object)
- * @return $transient
- */
-
- function modify_plugin_update( $transient ) {
-
- // bail early if no response (dashboard showed an error)
- if( !isset($transient->response) ) return $transient;
-
-
- // vars
- $basename = acf_get_setting('basename');
- $show_updates = acf_get_setting('show_updates');
-
-
- // bail early if not a plugin (included in theme)
- if( !acf_is_plugin_active() ) $show_updates = false;
-
-
- // bail early if no show_updates
- if( !$show_updates ) {
-
- // remove from transient
- unset( $transient->response[ $basename ] );
-
-
- // return
- return $transient;
-
- }
-
-
- // get update
- $update = acf_maybe_get( $transient->response, $basename );
-
-
- // filter
- $update = apply_filters('acf/updates/plugin_update', $update, $transient);
-
-
- // update
- if( $update ) {
-
- $transient->response[ $basename ] = $update;
-
- } else {
-
- unset($transient->response[ $basename ]);
-
- }
-
-
-
- // return
- return $transient;
+ return $response;
}
@@ -156,255 +384,73 @@ class acf_updates {
* @return n/a
*/
- function modify_plugin_update_message( $plugin_data, $r ) {
+/*
+ function modify_plugin_update_message( $plugin_data, $response ) {
- // vars
- $message = '';
- $info = acf_get_remote_plugin_info();
-
-
- // check for upgrade notice
- if( $info['upgrade_notice'] ) {
+ // show notice if exists in transient data
+ if( isset($response->notice) ) {
- $message = '' . $info['upgrade_notice'] . '
';
+ echo '' . $response->notice . '
';
}
-
-
- // filter
- $message = apply_filters('acf/updates/plugin_update_message', $message, $plugin_data, $r );
-
-
- // return
- echo $message;
}
+*/
}
-// initialize
-acf()->updates = new acf_updates();
-
-endif; // class_exists check
-
-
/*
-* acf_get_remote_plugin_info
+* acf_updates
*
-* This function will return an array of data from the plugin's readme.txt file (remote)
+* The main function responsible for returning the one true acf_updates instance to functions everywhere.
+* Use this function like you would a global variable, except without needing to declare the global.
+*
+* Example:
*
* @type function
-* @date 8/06/2016
-* @since 5.3.9
+* @date 9/4/17
+* @since 5.5.12
*
* @param n/a
-* @return (array)
+* @return (object)
*/
-function acf_get_remote_plugin_info() {
-
- // vars
- $transient_name = 'acf_get_remote_plugin_info';
-
-
- // clear transient if force check is enabled
- if( !empty($_GET['force-check']) ) {
-
- // only allow transient to be deleted once per page load
- if( empty($_GET['acf-ignore-force-check']) ) {
-
- delete_transient( 'acf_get_remote_plugin_info' );
-
- }
-
-
- // update $_GET
- $_GET['acf-ignore-force-check'] = true;
-
- }
-
-
- // get transient
- $transient = get_transient( $transient_name );
-
- // fake
-/*
- if( $transient ) {
-
- $transient['upgrade_notice'] .= '5.3.8.1 This update will do this and that ';
-
- }
-*/
-
-
- // bail early if transiente exists
- if( $transient !== false ) return $transient;
-
-
- // allow bypass
- $info = apply_filters( 'acf/get_remote_plugin_info', false );
+function acf_updates() {
- if( $info === false ) {
-
- $info = acf_get_wporg_remote_plugin_info();
-
- }
+ global $acf_updates;
+ if( !isset($acf_updates) ) {
- // store only relevant changelog / upgrade notice
- foreach( array('changelog', 'upgrade_notice') as $k ) {
-
- // bail early if not set
- if( empty($info[ $k ]) ) continue;
-
-
- // vars
- $new = '';
- $orig = $info[ $k ];
-
-
- // explode
- $bits = array_filter( explode('', $orig) );
-
-
- // loop
- foreach( $bits as $bit ) {
-
- // vars
- $bit = explode(' ', $bit);
- $version = trim($bit[0]);
- $text = trim($bit[1]);
-
-
- // is relevant?
- if( version_compare($info['version'], $version, '==') ) {
-
- $new = '' . $version . ' ' . $text;
- break;
-
- }
-
- }
-
-
- // update
- $info[ $k ] = $new;
+ $acf_updates = new acf_updates();
}
-
- // allow transient to save empty
- if( empty($info) ) $info = 0;
-
-
- // update transient
- set_transient( $transient_name, $info, DAY_IN_SECONDS );
-
-
- // return
- return $info;
+ return $acf_updates;
}
/*
-* acf_get_wporg_remote_plugin_info
+* acf_register_plugin_update
*
-* This function will return an array of data from the wordpress.org plugin's readme.txt file (remote)
+* alias of acf_updates()->add_plugin()
*
* @type function
-* @date 8/06/2016
-* @since 5.3.9
-*
-* @param n/a
-* @return (array)
-*/
-
-
-function acf_get_wporg_remote_plugin_info() {
-
- // create basic version of plugin info.
- // this should replicate the data available via plugin_api()
- // doing so allows ACF PRO to load data from external source
- $info = array(
- 'name' => acf_get_setting('name'),
- 'slug' => acf_get_setting('slug'),
- 'version' => acf_get_setting('version'),
- 'changelog' => '',
- 'upgrade_notice' => ''
- );
-
-
- // get readme
- $response = wp_safe_remote_get('https://plugins.svn.wordpress.org/advanced-custom-fields/trunk/readme.txt');
-
-
- // bail early if no response
- if( is_wp_error($response) || empty($response['body']) ) return $info;
-
-
- // use regex to find upgrade notice
- $matches = null;
- $regexp = '/(== Upgrade Notice ==)([\s\S]+?)(==|$)/';
-
-
- // bail early if no match
- if( !preg_match($regexp, $response['body'], $matches) ) return $info;
-
-
- // convert to html
- $text = wp_kses_post( trim($matches[2]) );
-
-
- // pretify
- $text = preg_replace('/^= (.*?) =/m', '$1 ', $text);
- $text = preg_replace('/^[\*] (.*?)(\n|$)/m', '$1 ', $text);
- $text = preg_replace('/\n(.*?)/', "\n" . '$1', $text);
- $text = preg_replace('/(<\/li>)(?! )/', '$1 ' . "\n", $text);
-
-
- // update
- $info['upgrade_notice'] = $text;
-
-
- // return
- return $info;
-
-}
-
-
-/*
-* acf_refresh_plugin_updates_transient
-*
-* This function will refresh teh WP transient containing plugin update data
-*
-* @type function
-* @date 11/08/2016
-* @since 5.4.0
+* @date 12/4/17
+* @since 5.5.10
*
* @param $post_id (int)
* @return $post_id (int)
*/
-function acf_refresh_plugin_updates_transient() {
+function acf_register_plugin_update( $plugin ) {
- // vars
- $transient = get_site_transient('update_plugins');
+ acf_updates()->add_plugin( $plugin );
-
- // bail early if no transient
- if( empty($transient) ) return;
-
-
- // update transient
- $transient = acf()->updates->modify_plugin_update( $transient );
-
-
- // update
- set_site_transient( 'update_plugins', $transient );
-
}
+endif; // class_exists check
+
?>
\ No newline at end of file
diff --git a/fields/date_picker.php b/fields/date_picker.php
index f18d4d6..eb45a7c 100644
--- a/fields/date_picker.php
+++ b/fields/date_picker.php
@@ -211,6 +211,13 @@ class acf_field_date_picker extends acf_field {
global $wp_locale;
+ // vars
+ $d_m_Y = date_i18n('d/m/Y');
+ $m_d_Y = date_i18n('m/d/Y');
+ $F_j_Y = date_i18n('F j, Y');
+ $Ymd = date_i18n('Ymd');
+
+
// display_format
acf_render_field_setting( $field, array(
'label' => __('Display Format','acf'),
@@ -219,9 +226,10 @@ class acf_field_date_picker extends acf_field {
'name' => 'display_format',
'other_choice' => 1,
'choices' => array(
- 'd/m/Y' => date_i18n('d/m/Y'),
- 'm/d/Y' => date_i18n('m/d/Y'),
- 'F j, Y' => date_i18n('F j, Y'),
+ 'd/m/Y' => '' . $d_m_Y . ' d/m/Y',
+ 'm/d/Y' => '' . $m_d_Y . ' m/d/Y',
+ 'F j, Y' => '' . $F_j_Y . ' F j, Y',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
@@ -248,10 +256,11 @@ class acf_field_date_picker extends acf_field {
'name' => 'return_format',
'other_choice' => 1,
'choices' => array(
- 'd/m/Y' => date_i18n('d/m/Y'),
- 'm/d/Y' => date_i18n('m/d/Y'),
- 'F j, Y' => date_i18n('F j, Y'),
- 'Ymd' => date_i18n('Ymd'),
+ 'd/m/Y' => '' . $d_m_Y . ' d/m/Y',
+ 'm/d/Y' => '' . $m_d_Y . ' m/d/Y',
+ 'F j, Y' => '' . $F_j_Y . ' F j, Y',
+ 'Ymd' => '' . $Ymd . ' Ymd',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
diff --git a/fields/date_time_picker.php b/fields/date_time_picker.php
index 509221a..6c1b892 100644
--- a/fields/date_time_picker.php
+++ b/fields/date_time_picker.php
@@ -185,6 +185,13 @@ class acf_field_date_and_time_picker extends acf_field {
global $wp_locale;
+ // vars
+ $d_m_Y = date_i18n('d/m/Y g:i a');
+ $m_d_Y = date_i18n('m/d/Y g:i a');
+ $F_j_Y = date_i18n('F j, Y g:i a');
+ $Ymd = date_i18n('Y-m-d H:i:s');
+
+
// display_format
acf_render_field_setting( $field, array(
'label' => __('Display Format','acf'),
@@ -193,10 +200,11 @@ class acf_field_date_and_time_picker extends acf_field {
'name' => 'display_format',
'other_choice' => 1,
'choices' => array(
- 'd/m/Y g:i a' => date_i18n('d/m/Y g:i a'),
- 'm/d/Y g:i a' => date_i18n('m/d/Y g:i a'),
- 'F j, Y g:i a' => date_i18n('F j, Y g:i a'),
- 'Y-m-d H:i:s' => date_i18n('Y-m-d H:i:s'),
+ 'd/m/Y g:i a' => '' . $d_m_Y . ' d/m/Y g:i a',
+ 'm/d/Y g:i a' => '' . $m_d_Y . ' m/d/Y g:i a',
+ 'F j, Y g:i a' => '' . $F_j_Y . ' F j, Y g:i a',
+ 'Y-m-d H:i:s' => '' . $Ymd . ' Y-m-d H:i:s',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
@@ -209,10 +217,11 @@ class acf_field_date_and_time_picker extends acf_field {
'name' => 'return_format',
'other_choice' => 1,
'choices' => array(
- 'd/m/Y g:i a' => date_i18n('d/m/Y g:i a'),
- 'm/d/Y g:i a' => date_i18n('m/d/Y g:i a'),
- 'F j, Y g:i a' => date_i18n('F j, Y g:i a'),
- 'Y-m-d H:i:s' => date_i18n('Y-m-d H:i:s'),
+ 'd/m/Y g:i a' => '' . $d_m_Y . ' d/m/Y g:i a',
+ 'm/d/Y g:i a' => '' . $m_d_Y . ' m/d/Y g:i a',
+ 'F j, Y g:i a' => '' . $F_j_Y . ' F j, Y g:i a',
+ 'Y-m-d H:i:s' => '' . $Ymd . ' Y-m-d H:i:s',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
diff --git a/fields/radio.php b/fields/radio.php
index cee4bcc..458f7eb 100644
--- a/fields/radio.php
+++ b/fields/radio.php
@@ -138,8 +138,16 @@ class acf_field_radio extends acf_field {
}
+ // allow custom 'other' choice to be defined
+ if( !isset($field['choices']['other']) ) {
+
+ $field['choices']['other'] = '';
+
+ }
+
+
// append other choice
- $field['choices']['other'] = '';
+ $field['choices']['other'] .= ' ';
}
diff --git a/fields/time_picker.php b/fields/time_picker.php
index 22458cc..bd19505 100644
--- a/fields/time_picker.php
+++ b/fields/time_picker.php
@@ -117,8 +117,9 @@ class acf_field_time_picker extends acf_field {
function render_field_settings( $field ) {
- // global
- global $wp_locale;
+ // vars
+ $g_i_a = date('g:i a');
+ $H_i_s = date('H:i:s');
// display_format
@@ -129,8 +130,9 @@ class acf_field_time_picker extends acf_field {
'name' => 'display_format',
'other_choice' => 1,
'choices' => array(
- 'g:i a' => date('g:i a'),
- 'H:i:s' => date('H:i:s'),
+ 'g:i a' => '' . $g_i_a . ' g:i a',
+ 'H:i:s' => '' . $H_i_s . ' H:i:s',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
@@ -143,8 +145,9 @@ class acf_field_time_picker extends acf_field {
'name' => 'return_format',
'other_choice' => 1,
'choices' => array(
- 'g:i a' => date('g:i a'),
- 'H:i:s' => date('H:i:s'),
+ 'g:i a' => '' . $g_i_a . ' g:i a',
+ 'H:i:s' => '' . $H_i_s . ' H:i:s',
+ 'other' => '' . __('Custom:','acf') . ' '
)
));
diff --git a/forms/post.php b/forms/post.php
index 258ca5b..8636dc7 100644
--- a/forms/post.php
+++ b/forms/post.php
@@ -223,7 +223,15 @@ class acf_form_post {
add_action('edit_form_after_title', array($this, 'edit_form_after_title'));
- // remove ACF from meta postbox
+ // remove postcustom metabox (removes expensive SQL query)
+ if( acf_get_setting('remove_wp_meta_box') ) {
+
+ remove_meta_box( 'postcustom', false, 'normal' );
+
+ }
+
+
+ // remove ACF values from meta postbox ()
add_filter('is_protected_meta', array($this, 'is_protected_meta'), 10, 3);
}
diff --git a/lang/acf-pt_BR.mo b/lang/acf-pt_BR.mo
index fba9802..8bd41ba 100644
Binary files a/lang/acf-pt_BR.mo and b/lang/acf-pt_BR.mo differ
diff --git a/lang/acf-pt_BR.po b/lang/acf-pt_BR.po
index 92fd795..2f444d3 100644
--- a/lang/acf-pt_BR.po
+++ b/lang/acf-pt_BR.po
@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Advanced Custom Fields PRO 5.4\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
-"POT-Creation-Date: 2016-08-04 15:51-0300\n"
-"PO-Revision-Date: 2016-11-03 17:12+1000\n"
+"POT-Creation-Date: 2017-04-05 16:09-0300\n"
+"PO-Revision-Date: 2017-05-15 21:46-0300\n"
"Last-Translator: Elliot Condon \n"
"Language-Team: Augusto Simão \n"
"Language: pt_BR\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 1.8.1\n"
+"X-Generator: Poedit 2.0\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
@@ -26,98 +26,97 @@ msgstr ""
msgid "Advanced Custom Fields"
msgstr "Advanced Custom Fields"
-#: acf.php:271 admin/admin.php:61
+#: acf.php:283 admin/admin.php:117
msgid "Field Groups"
msgstr "Grupos de Campos"
-#: acf.php:272
+#: acf.php:284
msgid "Field Group"
msgstr "Grupo de Campos"
-#: acf.php:273 acf.php:305 admin/admin.php:62
-#: pro/fields/flexible-content.php:500
+#: acf.php:322 acf.php:354 admin/admin.php:118
+#: pro/fields/flexible-content.php:581
msgid "Add New"
msgstr "Adicionar Novo"
-#: acf.php:274
+#: acf.php:286
msgid "Add New Field Group"
msgstr "Adicionar Novo Grupo de Campos"
-#: acf.php:275
+#: acf.php:287
msgid "Edit Field Group"
msgstr "Editar Grupo de Campos"
-#: acf.php:276
+#: acf.php:288
msgid "New Field Group"
msgstr "Novo Grupo de Campos"
-#: acf.php:277
+#: acf.php:289
msgid "View Field Group"
msgstr "Ver Grupo de Campos"
-#: acf.php:278
+#: acf.php:290
msgid "Search Field Groups"
msgstr "Pesquisar Grupos de Campos"
-#: acf.php:279
+#: acf.php:291
msgid "No Field Groups found"
msgstr "Nenhum Grupo de Campos encontrado"
-#: acf.php:280
+#: acf.php:292
msgid "No Field Groups found in Trash"
msgstr "Nenhum Grupo de Campos encontrado na Lixeira"
-#: acf.php:303 admin/field-group.php:182 admin/field-group.php:280
-#: admin/field-groups.php:528 pro/fields/clone.php:679
+#: acf.php:315 admin/field-group.php:182 admin/field-group.php:280
+#: admin/field-groups.php:510 pro/fields/clone.php:857
msgid "Fields"
msgstr "Campos"
-#: acf.php:304
+#: acf.php:316
msgid "Field"
msgstr "Campo"
-#: acf.php:306
+#: acf.php:318
msgid "Add New Field"
msgstr "Adicionar Novo Campo"
-#: acf.php:307
+#: acf.php:319
msgid "Edit Field"
msgstr "Editar Campo"
-#: acf.php:308 admin/views/field-group-fields.php:54
+#: acf.php:320 admin/views/field-group-fields.php:51
#: admin/views/settings-info.php:111
msgid "New Field"
msgstr "Novo Campo"
-#: acf.php:309
+#: acf.php:321
msgid "View Field"
msgstr "Ver Campo"
-#: acf.php:310
+#: acf.php:322
msgid "Search Fields"
msgstr "Pesquisar Campos"
-#: acf.php:311
+#: acf.php:323
msgid "No Fields found"
msgstr "Nenhum Campo encontrado"
-#: acf.php:312
+#: acf.php:324
msgid "No Fields found in Trash"
msgstr "Nenhum Campo encontrado na Lixeira"
-#: acf.php:351 admin/field-group.php:395 admin/field-groups.php:585
-#: admin/views/field-group-options.php:13
-msgid "Disabled"
-msgstr "Desabilitado"
+#: acf.php:363 admin/field-group.php:395 admin/field-groups.php:567
+msgid "Inactive"
+msgstr "Inativo"
-#: acf.php:356
+#: acf.php:368
#, php-format
-msgid "Disabled (%s) "
-msgid_plural "Disabled (%s) "
-msgstr[0] "Desabilitado (%s) "
-msgstr[1] "Desabilitados (%s) "
+msgid "Inactive (%s) "
+msgid_plural "Inactive (%s) "
+msgstr[0] "Ativo (%s) "
+msgstr[1] "Ativos (%s) "
-#: admin/admin.php:57 admin/views/field-group-options.php:115
+#: admin/admin.php:113 admin/views/field-group-options.php:114
msgid "Custom Fields"
msgstr "Campos Personalizados"
@@ -173,15 +172,15 @@ msgstr "Nenhum campo de opções disponível"
msgid "Field group title is required"
msgstr "O título do grupo de campos é obrigatório"
-#: admin/field-group.php:278 api/api-field-group.php:651
+#: admin/field-group.php:278 api/api-field-group.php:667
msgid "copy"
msgstr "copiar"
#: admin/field-group.php:279
-#: admin/views/field-group-field-conditional-logic.php:62
-#: admin/views/field-group-field-conditional-logic.php:162
-#: admin/views/field-group-locations.php:59
-#: admin/views/field-group-locations.php:135 api/api-helpers.php:3952
+#: admin/views/field-group-field-conditional-logic.php:55
+#: admin/views/field-group-field-conditional-logic.php:155
+#: admin/views/field-group-locations.php:68
+#: admin/views/field-group-locations.php:144 api/api-helpers.php:4072
msgid "or"
msgstr "ou"
@@ -217,83 +216,83 @@ msgstr "O termo “field_” não pode ser utilizado no início do nome de um ca
msgid "Field Keys"
msgstr "Chaves dos Campos"
-#: admin/field-group.php:395 admin/views/field-group-options.php:12
+#: admin/field-group.php:395 admin/views/field-group-options.php:5
msgid "Active"
msgstr "Ativo"
-#: admin/field-group.php:842
-msgid "Front Page"
-msgstr "Página Inicial"
-
-#: admin/field-group.php:843
-msgid "Posts Page"
-msgstr "Página de Posts"
-
-#: admin/field-group.php:844
-msgid "Top Level Page (no parent)"
-msgstr "Página de Nível mais Alto (sem mãe)"
-
-#: admin/field-group.php:845
-msgid "Parent Page (has children)"
-msgstr "Página Mãe (tem filhas)"
-
-#: admin/field-group.php:846
-msgid "Child Page (has parent)"
-msgstr "Página Filha (possui mãe)"
-
-#: admin/field-group.php:862
+#: admin/field-group.php:759 admin/field-group.php:897
msgid "Default Template"
msgstr "Modelo Padrão"
-#: admin/field-group.php:885
+#: admin/field-group.php:876
+msgid "Front Page"
+msgstr "Página Inicial"
+
+#: admin/field-group.php:877
+msgid "Posts Page"
+msgstr "Página de Posts"
+
+#: admin/field-group.php:878
+msgid "Top Level Page (no parent)"
+msgstr "Página de Nível mais Alto (sem mãe)"
+
+#: admin/field-group.php:879
+msgid "Parent Page (has children)"
+msgstr "Página Mãe (tem filhas)"
+
+#: admin/field-group.php:880
+msgid "Child Page (has parent)"
+msgstr "Página Filha (possui mãe)"
+
+#: admin/field-group.php:914
msgid "Logged in"
msgstr "Logado"
-#: admin/field-group.php:886
+#: admin/field-group.php:915
msgid "Viewing front end"
msgstr "Visualizando a parte pública do site (front-end)"
-#: admin/field-group.php:887
+#: admin/field-group.php:916
msgid "Viewing back end"
msgstr "Visualizando a parte administrativa do site (back-end)"
-#: admin/field-group.php:906
+#: admin/field-group.php:935
msgid "Super Admin"
msgstr "Super Admin"
-#: admin/field-group.php:917 admin/field-group.php:925
-#: admin/field-group.php:939 admin/field-group.php:946
-#: admin/field-group.php:963 admin/field-group.php:980 fields/file.php:241
+#: admin/field-group.php:946 admin/field-group.php:954
+#: admin/field-group.php:968 admin/field-group.php:975
+#: admin/field-group.php:992 admin/field-group.php:1009 fields/file.php:240
#: fields/image.php:237 pro/fields/gallery.php:676
msgid "All"
msgstr "Todos"
-#: admin/field-group.php:926
+#: admin/field-group.php:955
msgid "Add / Edit"
msgstr "Adicionar / Editar"
-#: admin/field-group.php:927
+#: admin/field-group.php:956
msgid "Register"
msgstr "Registrar"
-#: admin/field-group.php:1167
+#: admin/field-group.php:1193
msgid "Move Complete."
msgstr "Movimentação realizada."
-#: admin/field-group.php:1168
+#: admin/field-group.php:1194
#, php-format
msgid "The %s field can now be found in the %s field group"
msgstr "O campo %s pode agora ser encontrado no grupo de campos %s"
-#: admin/field-group.php:1170
+#: admin/field-group.php:1196
msgid "Close Window"
msgstr "Fechar Janela"
-#: admin/field-group.php:1205
+#: admin/field-group.php:1238
msgid "Please select the destination for this field"
msgstr "Selecione o destino para este campo"
-#: admin/field-group.php:1212
+#: admin/field-group.php:1245
msgid "Move Field"
msgstr "Mover Campo"
@@ -316,114 +315,151 @@ msgid_plural "%s field groups duplicated."
msgstr[0] "%s grupo de campos duplicado."
msgstr[1] "%s grupos de campos duplicados."
-#: admin/field-groups.php:228
+#: admin/field-groups.php:227
#, php-format
msgid "Field group synchronised. %s"
msgstr "Grupo de campos sincronizado. %s"
-#: admin/field-groups.php:232
+#: admin/field-groups.php:231
#, php-format
msgid "%s field group synchronised."
msgid_plural "%s field groups synchronised."
msgstr[0] "%s grupo de campos sincronizado."
msgstr[1] "%s grupos de campos sincronizados."
-#: admin/field-groups.php:412 admin/field-groups.php:575
+#: admin/field-groups.php:394 admin/field-groups.php:557
msgid "Sync available"
msgstr "Sincronização disponível"
-#: admin/field-groups.php:525 api/api-template.php:1077
-#: api/api-template.php:1290 pro/fields/gallery.php:370
+#: admin/field-groups.php:507 core/form.php:36 pro/fields/gallery.php:370
msgid "Title"
msgstr "Título"
-#: admin/field-groups.php:526 admin/views/field-group-options.php:93
-#: admin/views/update-network.php:25 admin/views/update-network.php:33
+#: admin/field-groups.php:508 admin/views/field-group-options.php:92
+#: admin/views/install-network.php:25 admin/views/install-network.php:33
#: pro/fields/gallery.php:397
msgid "Description"
msgstr "Descrição"
-#: admin/field-groups.php:527 admin/views/field-group-options.php:5
+#: admin/field-groups.php:509
msgid "Status"
msgstr "Status"
-#: admin/field-groups.php:623 admin/settings-info.php:76
+#: admin/field-groups.php:609 admin/settings-info.php:76
#: pro/admin/views/settings-updates.php:111
msgid "Changelog"
msgstr "Registro de alterações"
-#: admin/field-groups.php:624
+#: admin/field-groups.php:610
#, php-format
msgid "See what's new in version %s ."
msgstr "Veja o que há de novo na versão %s ."
-#: admin/field-groups.php:626
+#: admin/field-groups.php:612
msgid "Resources"
msgstr "Recursos (em inglês)"
-#: admin/field-groups.php:628
+#: admin/field-groups.php:614
+msgid "Documentation"
+msgstr "Documentação"
+
+#: admin/field-groups.php:616
msgid "Getting Started"
msgstr "Primeiros Passos"
-#: admin/field-groups.php:629 pro/admin/settings-updates.php:57
-#: pro/admin/views/settings-updates.php:17
-msgid "Updates"
-msgstr "Atualizações"
-
-#: admin/field-groups.php:630
+#: admin/field-groups.php:617
msgid "Field Types"
msgstr "Tipos de Campos"
-#: admin/field-groups.php:631
+#: admin/field-groups.php:618
msgid "Functions"
msgstr "Funções"
-#: admin/field-groups.php:632
+#: admin/field-groups.php:619
msgid "Actions"
msgstr "Ações"
-#: admin/field-groups.php:633 fields/relationship.php:737
+#: admin/field-groups.php:620 fields/relationship.php:732
msgid "Filters"
msgstr "Filtros"
-#: admin/field-groups.php:634
-msgid "'How to' guides"
-msgstr "Guias práticos"
+#: admin/field-groups.php:621
+msgid "Features"
+msgstr "Características"
-#: admin/field-groups.php:635
+#: admin/field-groups.php:622
+msgid "How to"
+msgstr "Como"
+
+#: admin/field-groups.php:623
msgid "Tutorials"
msgstr "Tutoriais"
-#: admin/field-groups.php:636
+#: admin/field-groups.php:624
msgid "FAQ"
msgstr "Perguntas Frequentes"
-#: admin/field-groups.php:641
-msgid "Created by"
-msgstr "Criado por"
+#: admin/field-groups.php:625
+#, fuzzy
+msgid "Support"
+msgstr "Apoio, suporte"
-#: admin/field-groups.php:684
+#: admin/field-groups.php:629
+#, fuzzy, php-format
+msgid "Thank you for creating with ACF ."
+msgstr "Obrigado por criar com a ACF ."
+
+#: admin/field-groups.php:671
msgid "Duplicate this item"
msgstr "Duplicar este item"
-#: admin/field-groups.php:684 admin/field-groups.php:700
-#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:499
+#: admin/field-groups.php:671 admin/field-groups.php:687
+#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:580
msgid "Duplicate"
msgstr "Duplicar"
-#: admin/field-groups.php:751
+#: admin/field-groups.php:704 fields/google-map.php:132
+#: fields/relationship.php:737
+msgid "Search"
+msgstr "Pesquisa"
+
+#: admin/field-groups.php:754
#, php-format
msgid "Select %s"
msgstr "Selecionar %s"
-#: admin/field-groups.php:759
+#: admin/field-groups.php:762
msgid "Synchronise field group"
msgstr "Sincronizar grupo de campos"
-#: admin/field-groups.php:759 admin/field-groups.php:776
+#: admin/field-groups.php:762 admin/field-groups.php:792
msgid "Sync"
msgstr "Sincronizar"
+#: admin/field-groups.php:774
+msgid "Apply"
+msgstr "Aplicar"
+
+#: admin/field-groups.php:792
+msgid "Bulk Actions"
+msgstr "Ações em massa"
+
+#: admin/install-network.php:88 admin/install.php:70 admin/install.php:121
+msgid "Upgrade Database"
+msgstr "Atualizar Banco de Dados"
+
+#: admin/install-network.php:140
+msgid "Review sites & upgrade"
+msgstr "Revisar sites e atualizar"
+
+#: admin/install.php:186
+msgid "Error validating request"
+msgstr "Erro ao validar solicitação"
+
+#: admin/install.php:209 admin/views/install.php:110
+msgid "No updates available."
+msgstr "Nenhuma atualização disponível."
+
#: admin/settings-addons.php:51 admin/views/settings-addons.php:9
msgid "Add-ons"
msgstr "Complementos"
@@ -449,7 +485,7 @@ msgstr "Ferramentas"
msgid "No field groups selected"
msgstr "Nenhum grupo de campos selecionado"
-#: admin/settings-tools.php:184 fields/file.php:175
+#: admin/settings-tools.php:184 fields/file.php:174
msgid "No file selected"
msgstr "Nenhum arquivo selecionado"
@@ -472,84 +508,36 @@ msgid_plural "Imported %s field groups"
msgstr[0] "Importado 1 grupo de campos"
msgstr[1] "Importados %s grupos de campos"
-#: admin/update-network.php:96 admin/update.php:104 admin/update.php:155
-msgid "Upgrade Database"
-msgstr "Atualizar Banco de Dados"
-
-#: admin/update-network.php:148
-msgid "Review sites & upgrade"
-msgstr "Revisar sites e atualizar"
-
-#: admin/update.php:220
-msgid "Error validating request"
-msgstr "Erro ao validar solicitação"
-
-#: admin/update.php:243 admin/views/update.php:110
-msgid "No updates available."
-msgstr "Nenhuma atualização disponível."
-
-#: admin/update.php:260
-msgid "Error loading update"
-msgstr "Erro ao carregar atualização"
-
#: admin/views/field-group-field-conditional-logic.php:29
msgid "Conditional Logic"
msgstr "Condições para exibição"
-#: admin/views/field-group-field-conditional-logic.php:40
-#: admin/views/field-group-field.php:141 fields/checkbox.php:244
-#: fields/message.php:144 fields/page_link.php:533 fields/page_link.php:547
-#: fields/page_link.php:561 fields/post_object.php:432
-#: fields/post_object.php:446 fields/radio.php:255 fields/select.php:469
-#: fields/select.php:483 fields/select.php:497 fields/select.php:511
-#: fields/tab.php:130 fields/taxonomy.php:785 fields/taxonomy.php:799
-#: fields/taxonomy.php:813 fields/taxonomy.php:827 fields/user.php:399
-#: fields/user.php:413 fields/wysiwyg.php:418
-#: pro/admin/views/settings-updates.php:93 pro/fields/clone.php:733
-#: pro/fields/clone.php:751
-msgid "Yes"
-msgstr "Sim"
-
-#: admin/views/field-group-field-conditional-logic.php:41
-#: admin/views/field-group-field.php:142 fields/checkbox.php:245
-#: fields/message.php:145 fields/page_link.php:534 fields/page_link.php:548
-#: fields/page_link.php:562 fields/post_object.php:433
-#: fields/post_object.php:447 fields/radio.php:256 fields/select.php:470
-#: fields/select.php:484 fields/select.php:498 fields/select.php:512
-#: fields/tab.php:131 fields/taxonomy.php:700 fields/taxonomy.php:786
-#: fields/taxonomy.php:800 fields/taxonomy.php:814 fields/taxonomy.php:828
-#: fields/user.php:400 fields/user.php:414 fields/wysiwyg.php:419
-#: pro/admin/views/settings-updates.php:103 pro/fields/clone.php:734
-#: pro/fields/clone.php:752
-msgid "No"
-msgstr "Não"
-
-#: admin/views/field-group-field-conditional-logic.php:62
+#: admin/views/field-group-field-conditional-logic.php:55
msgid "Show this field if"
msgstr "Mostrar este campo se"
-#: admin/views/field-group-field-conditional-logic.php:111
-#: admin/views/field-group-locations.php:34
+#: admin/views/field-group-field-conditional-logic.php:104
+#: admin/views/field-group-locations.php:43
msgid "is equal to"
msgstr "é igual a"
-#: admin/views/field-group-field-conditional-logic.php:112
-#: admin/views/field-group-locations.php:35
+#: admin/views/field-group-field-conditional-logic.php:105
+#: admin/views/field-group-locations.php:44
msgid "is not equal to"
msgstr "não é igual a"
-#: admin/views/field-group-field-conditional-logic.php:149
-#: admin/views/field-group-locations.php:122
+#: admin/views/field-group-field-conditional-logic.php:142
+#: admin/views/field-group-locations.php:131
msgid "and"
msgstr "e"
-#: admin/views/field-group-field-conditional-logic.php:164
-#: admin/views/field-group-locations.php:137
+#: admin/views/field-group-field-conditional-logic.php:157
+#: admin/views/field-group-locations.php:146
msgid "Add rule group"
msgstr "Adicionar grupo de regras"
-#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:346
-#: pro/fields/repeater.php:302
+#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:427
+#: pro/fields/repeater.php:358
msgid "Drag to reorder"
msgstr "Arraste para reorganizar"
@@ -557,7 +545,7 @@ msgstr "Arraste para reorganizar"
msgid "Edit field"
msgstr "Editar campo"
-#: admin/views/field-group-field.php:58 fields/image.php:142
+#: admin/views/field-group-field.php:58 fields/image.php:140
#: pro/fields/gallery.php:357
msgid "Edit"
msgstr "Editar"
@@ -578,19 +566,14 @@ msgstr "Mover"
msgid "Delete field"
msgstr "Excluir campo"
-#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:498
+#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:579
msgid "Delete"
msgstr "Excluir"
-#: admin/views/field-group-field.php:69 fields/oembed.php:225
-#: fields/taxonomy.php:901
+#: admin/views/field-group-field.php:69
msgid "Error"
msgstr "Erro"
-#: fields/oembed.php:220 fields/taxonomy.php:900
-msgid "Error."
-msgstr "Erro."
-
#: admin/views/field-group-field.php:69
msgid "Field type does not exist"
msgstr "Tipo de campo não existe"
@@ -603,71 +586,71 @@ msgstr "Rótulo do Campo"
msgid "This is the name which will appear on the EDIT page"
msgstr "Este é o nome que irá aparecer na página de EDIÇÃO"
-#: admin/views/field-group-field.php:95
+#: admin/views/field-group-field.php:93
msgid "Field Name"
msgstr "Nome do Campo"
-#: admin/views/field-group-field.php:96
+#: admin/views/field-group-field.php:94
msgid "Single word, no spaces. Underscores and dashes allowed"
msgstr ""
"Uma única palavra, sem espaços. Traço inferior (_) e traços (-) permitidos"
-#: admin/views/field-group-field.php:108
+#: admin/views/field-group-field.php:104
msgid "Field Type"
msgstr "Tipo de Campo"
-#: admin/views/field-group-field.php:122 fields/tab.php:103
+#: admin/views/field-group-field.php:116 fields/tab.php:102
msgid "Instructions"
msgstr "Instruções"
-#: admin/views/field-group-field.php:123
+#: admin/views/field-group-field.php:117
msgid "Instructions for authors. Shown when submitting data"
msgstr "Instrução para os autores. Exibido quando se está enviando dados"
-#: admin/views/field-group-field.php:134
+#: admin/views/field-group-field.php:126
msgid "Required?"
msgstr "Obrigatório?"
-#: admin/views/field-group-field.php:163
+#: admin/views/field-group-field.php:149
msgid "Wrapper Attributes"
msgstr "Atributos do Wrapper"
-#: admin/views/field-group-field.php:169
+#: admin/views/field-group-field.php:155
msgid "width"
msgstr "largura"
-#: admin/views/field-group-field.php:183
+#: admin/views/field-group-field.php:170
msgid "class"
msgstr "classe"
-#: admin/views/field-group-field.php:196
+#: admin/views/field-group-field.php:183
msgid "id"
msgstr "id"
-#: admin/views/field-group-field.php:208
+#: admin/views/field-group-field.php:195
msgid "Close Field"
msgstr "Fechar Campo"
-#: admin/views/field-group-fields.php:17
+#: admin/views/field-group-fields.php:15
msgid "Order"
msgstr "Ordem"
-#: admin/views/field-group-fields.php:18 fields/checkbox.php:259
-#: fields/radio.php:314 fields/select.php:527
-#: pro/fields/flexible-content.php:525
+#: admin/views/field-group-fields.php:16 fields/checkbox.php:312
+#: fields/radio.php:313 fields/select.php:534
+#: pro/fields/flexible-content.php:606
msgid "Label"
msgstr "Rótulo"
-#: admin/views/field-group-fields.php:19 fields/taxonomy.php:967
-#: pro/fields/flexible-content.php:538
+#: admin/views/field-group-fields.php:17 fields/taxonomy.php:966
+#: pro/fields/flexible-content.php:619
msgid "Name"
msgstr "Nome"
-#: admin/views/field-group-fields.php:20
+#: admin/views/field-group-fields.php:18
msgid "Type"
msgstr "Tipo"
-#: admin/views/field-group-fields.php:38
+#: admin/views/field-group-fields.php:24
msgid ""
"No fields. Click the + Add Field button to create your "
"first field."
@@ -675,97 +658,102 @@ msgstr ""
"Nenhum campo. Clique no botão + Adicionar Campo para criar "
"seu primeiro campo."
-#: admin/views/field-group-fields.php:44
+#: admin/views/field-group-fields.php:41
msgid "+ Add Field"
msgstr "+ Adicionar Campo"
#: admin/views/field-group-locations.php:5
-#: admin/views/field-group-locations.php:11
+#: admin/views/field-group-locations.php:12
+#: admin/views/field-group-locations.php:38
msgid "Post"
msgstr "Post"
-#: admin/views/field-group-locations.php:6 fields/relationship.php:743
+#: admin/views/field-group-locations.php:6 fields/relationship.php:738
msgid "Post Type"
msgstr "Tipo de Post"
#: admin/views/field-group-locations.php:7
+msgid "Post Template"
+msgstr "Modelo de Postagem"
+
+#: admin/views/field-group-locations.php:8
msgid "Post Status"
msgstr "Status do Post"
-#: admin/views/field-group-locations.php:8
+#: admin/views/field-group-locations.php:9
msgid "Post Format"
msgstr "Formato de Post"
-#: admin/views/field-group-locations.php:9
+#: admin/views/field-group-locations.php:10
msgid "Post Category"
msgstr "Categoria de Post"
-#: admin/views/field-group-locations.php:10
+#: admin/views/field-group-locations.php:11
msgid "Post Taxonomy"
msgstr "Taxonomia de Post"
-#: admin/views/field-group-locations.php:13
-#: admin/views/field-group-locations.php:17
+#: admin/views/field-group-locations.php:14
+#: admin/views/field-group-locations.php:18
msgid "Page"
msgstr "Página"
-#: admin/views/field-group-locations.php:14
+#: admin/views/field-group-locations.php:15
msgid "Page Template"
msgstr "Modelo de Página"
-#: admin/views/field-group-locations.php:15
+#: admin/views/field-group-locations.php:16
msgid "Page Type"
msgstr "Tipo de Página"
-#: admin/views/field-group-locations.php:16
+#: admin/views/field-group-locations.php:17
msgid "Page Parent"
msgstr "Página Mãe"
-#: admin/views/field-group-locations.php:19 fields/user.php:36
+#: admin/views/field-group-locations.php:20 fields/user.php:36
msgid "User"
msgstr "Usuário"
-#: admin/views/field-group-locations.php:20
+#: admin/views/field-group-locations.php:21
msgid "Current User"
msgstr "Usuário atual"
-#: admin/views/field-group-locations.php:21
+#: admin/views/field-group-locations.php:22
msgid "Current User Role"
msgstr "Função do Usuário atual"
-#: admin/views/field-group-locations.php:22
+#: admin/views/field-group-locations.php:23
msgid "User Form"
msgstr "Formulário do Usuário"
-#: admin/views/field-group-locations.php:23
+#: admin/views/field-group-locations.php:24
msgid "User Role"
msgstr "Função do Usuário"
-#: admin/views/field-group-locations.php:25 pro/admin/options-page.php:49
+#: admin/views/field-group-locations.php:26 pro/admin/options-page.php:53
msgid "Forms"
msgstr "Formulários"
-#: admin/views/field-group-locations.php:26
+#: admin/views/field-group-locations.php:27
msgid "Attachment"
msgstr "Anexo"
-#: admin/views/field-group-locations.php:27
+#: admin/views/field-group-locations.php:28
msgid "Taxonomy Term"
msgstr "Termo da Taxonomia"
-#: admin/views/field-group-locations.php:28
+#: admin/views/field-group-locations.php:29
msgid "Comment"
msgstr "Comentário"
-#: admin/views/field-group-locations.php:29
+#: admin/views/field-group-locations.php:30
msgid "Widget"
msgstr "Widget"
-#: admin/views/field-group-locations.php:41
+#: admin/views/field-group-locations.php:50
msgid "Rules"
msgstr "Regras"
-#: admin/views/field-group-locations.php:42
+#: admin/views/field-group-locations.php:51
msgid ""
"Create a set of rules to determine which edit screens will use these "
"advanced custom fields"
@@ -773,84 +761,84 @@ msgstr ""
"Crie um conjunto de regras para determinar quais telas de edição utilizarão "
"estes campos personalizados"
-#: admin/views/field-group-locations.php:59
+#: admin/views/field-group-locations.php:68
msgid "Show this field group if"
msgstr "Mostrar este grupo de campos se"
-#: admin/views/field-group-options.php:20
+#: admin/views/field-group-options.php:19
msgid "Style"
msgstr "Estilo"
-#: admin/views/field-group-options.php:27
+#: admin/views/field-group-options.php:26
msgid "Standard (WP metabox)"
msgstr "Padrão (metabox do WP)"
-#: admin/views/field-group-options.php:28
+#: admin/views/field-group-options.php:27
msgid "Seamless (no metabox)"
msgstr "Sem bordas (sem metabox)"
-#: admin/views/field-group-options.php:35
+#: admin/views/field-group-options.php:34
msgid "Position"
msgstr "Posição"
-#: admin/views/field-group-options.php:42
+#: admin/views/field-group-options.php:41
msgid "High (after title)"
msgstr "Superior (depois do título)"
-#: admin/views/field-group-options.php:43
+#: admin/views/field-group-options.php:42
msgid "Normal (after content)"
msgstr "Normal (depois do editor de conteúdo)"
-#: admin/views/field-group-options.php:44
+#: admin/views/field-group-options.php:43
msgid "Side"
msgstr "Lateral"
-#: admin/views/field-group-options.php:52
+#: admin/views/field-group-options.php:51
msgid "Label placement"
msgstr "Posicionamento do rótulo"
-#: admin/views/field-group-options.php:59 fields/tab.php:117
+#: admin/views/field-group-options.php:58 fields/tab.php:116
msgid "Top aligned"
msgstr "Alinhado ao Topo"
-#: admin/views/field-group-options.php:60 fields/tab.php:118
+#: admin/views/field-group-options.php:59 fields/tab.php:117
msgid "Left Aligned"
msgstr "Alinhado à Esquerda"
-#: admin/views/field-group-options.php:67
+#: admin/views/field-group-options.php:66
msgid "Instruction placement"
msgstr "Posicionamento das instruções"
-#: admin/views/field-group-options.php:74
+#: admin/views/field-group-options.php:73
msgid "Below labels"
msgstr "Abaixo dos rótulos"
-#: admin/views/field-group-options.php:75
+#: admin/views/field-group-options.php:74
msgid "Below fields"
msgstr "Abaixo dos campos"
-#: admin/views/field-group-options.php:82
+#: admin/views/field-group-options.php:81
msgid "Order No."
msgstr "Nº. de Ordem"
-#: admin/views/field-group-options.php:83
+#: admin/views/field-group-options.php:82
msgid "Field groups with a lower order will appear first"
msgstr "Grupos de campos com a menor numeração aparecerão primeiro"
-#: admin/views/field-group-options.php:94
+#: admin/views/field-group-options.php:93
msgid "Shown in field group list"
msgstr "Exibido na lista de grupos de campos"
-#: admin/views/field-group-options.php:104
+#: admin/views/field-group-options.php:103
msgid "Hide on screen"
msgstr "Ocultar na tela"
-#: admin/views/field-group-options.php:105
+#: admin/views/field-group-options.php:104
msgid "Select items to hide them from the edit screen."
msgstr ""
"Selecione os itens que deverão ser ocultados da tela de edição"
-#: admin/views/field-group-options.php:105
+#: admin/views/field-group-options.php:104
msgid ""
"If multiple field groups appear on an edit screen, the first field group's "
"options will be used (the one with the lowest order number)"
@@ -859,62 +847,170 @@ msgstr ""
"primeiro grupo de campos é a que será utilizada (aquele com o menor número "
"de ordem)"
-#: admin/views/field-group-options.php:112
+#: admin/views/field-group-options.php:111
msgid "Permalink"
msgstr "Link permanente"
-#: admin/views/field-group-options.php:113
+#: admin/views/field-group-options.php:112
msgid "Content Editor"
msgstr "Editor de Conteúdo"
-#: admin/views/field-group-options.php:114
+#: admin/views/field-group-options.php:113
msgid "Excerpt"
msgstr "Resumo"
-#: admin/views/field-group-options.php:116
+#: admin/views/field-group-options.php:115
msgid "Discussion"
msgstr "Discussão"
-#: admin/views/field-group-options.php:117
+#: admin/views/field-group-options.php:116
msgid "Comments"
msgstr "Comentários"
-#: admin/views/field-group-options.php:118
+#: admin/views/field-group-options.php:117
msgid "Revisions"
msgstr "Revisões"
-#: admin/views/field-group-options.php:119
+#: admin/views/field-group-options.php:118
msgid "Slug"
msgstr "Slug"
-#: admin/views/field-group-options.php:120
+#: admin/views/field-group-options.php:119
msgid "Author"
msgstr "Autor"
-#: admin/views/field-group-options.php:121
+#: admin/views/field-group-options.php:120
msgid "Format"
msgstr "Formato"
-#: admin/views/field-group-options.php:122
+#: admin/views/field-group-options.php:121
msgid "Page Attributes"
msgstr "Atributos da Página"
-#: admin/views/field-group-options.php:123 fields/relationship.php:756
+#: admin/views/field-group-options.php:122 fields/relationship.php:751
msgid "Featured Image"
msgstr "Imagem Destacada"
-#: admin/views/field-group-options.php:124
+#: admin/views/field-group-options.php:123
msgid "Categories"
msgstr "Categorias"
-#: admin/views/field-group-options.php:125
+#: admin/views/field-group-options.php:124
msgid "Tags"
msgstr "Tags"
-#: admin/views/field-group-options.php:126
+#: admin/views/field-group-options.php:125
msgid "Send Trackbacks"
msgstr "Enviar Trackbacks"
+#: admin/views/install-network.php:4
+msgid "Upgrade Sites"
+msgstr "Revisar sites e atualizar"
+
+#: admin/views/install-network.php:13 admin/views/install.php:8
+msgid "Advanced Custom Fields Database Upgrade"
+msgstr "Atualização do Banco de Dados do Advanced Custom Fields"
+
+#: admin/views/install-network.php:15
+#, php-format
+msgid ""
+"The following sites require a DB upgrade. Check the ones you want to update "
+"and then click %s."
+msgstr ""
+"O banco de dados dos sites abaixo precisam ser atualizados. Verifique os que "
+"você deseja atualizar e clique %s."
+
+#: admin/views/install-network.php:24 admin/views/install-network.php:32
+msgid "Site"
+msgstr "Site"
+
+#: admin/views/install-network.php:52
+#, php-format
+msgid "Site requires database upgrade from %s to %s"
+msgstr "Site requer atualização do banco de dados da versão %s para %s"
+
+#: admin/views/install-network.php:54
+msgid "Site is up to date"
+msgstr "Site está atualizado"
+
+#: admin/views/install-network.php:67
+#, php-format
+msgid ""
+"Database Upgrade complete. Return to network dashboard "
+msgstr ""
+"Atualização do Banco de Dados realizada. Retornar para o "
+"painel da rede "
+
+#: admin/views/install-network.php:106 admin/views/install-notice.php:52
+msgid ""
+"It is strongly recommended that you backup your database before proceeding. "
+"Are you sure you wish to run the updater now?"
+msgstr ""
+"É altamente recomendado fazer um backup do seu banco de dados antes de "
+"continuar. Você tem certeza que deseja atualizar agora?"
+
+#: admin/views/install-network.php:162
+msgid "Upgrade complete"
+msgstr "Atualização realizada"
+
+#: admin/views/install-network.php:166 admin/views/install.php:14
+#, php-format
+msgid "Upgrading data to version %s"
+msgstr "Atualizando os dados para a versão %s"
+
+#: admin/views/install-notice.php:18 pro/fields/repeater.php:36
+msgid "Repeater"
+msgstr "Repetidor"
+
+#: admin/views/install-notice.php:19 pro/fields/flexible-content.php:36
+msgid "Flexible Content"
+msgstr "Conteúdo Flexível"
+
+#: admin/views/install-notice.php:20 pro/fields/gallery.php:36
+msgid "Gallery"
+msgstr "Galeria"
+
+#: admin/views/install-notice.php:21 pro/admin/options-page.php:53
+msgid "Options Page"
+msgstr "Página de Opções"
+
+#: admin/views/install-notice.php:36
+msgid "Database Upgrade Required"
+msgstr "Atualização do Banco de Dados Necessária"
+
+#: admin/views/install-notice.php:38
+#, php-format
+msgid "Thank you for updating to %s v%s!"
+msgstr "Obrigado por atualizar para o %s v%s!"
+
+#: admin/views/install-notice.php:38
+msgid ""
+"Before you start using the new awesome features, please update your database "
+"to the newest version."
+msgstr ""
+"Antes de começar a utilizar as novas e incríveis funcionalidades, por favor "
+"atualize seus banco de dados para a versão mais recente."
+
+#: admin/views/install-notice.php:41
+#, php-format
+msgid ""
+"Please also ensure any premium add-ons (%s) have first been updated to the "
+"latest version."
+msgstr ""
+"Certifique-se que todos os complementos premium (%s) foram atualizados para "
+"a última versão."
+
+#: admin/views/install.php:12
+msgid "Reading upgrade tasks..."
+msgstr "Lendo as tarefas de atualização…"
+
+#: admin/views/install.php:16
+#, php-format
+msgid "Database Upgrade complete. See what's new "
+msgstr ""
+"Atualização do banco de dados concluída. Veja o que há de "
+"novo "
+
#: admin/views/settings-addons.php:23
msgid "Download & Install"
msgstr "Fazer Download e Instalar"
@@ -1273,185 +1369,108 @@ msgstr "Selecionar Arquivo"
msgid "Import"
msgstr "Importar"
-#: admin/views/update-network.php:4
-msgid "Upgrade Sites"
-msgstr "Revisar sites e atualizar"
-
-#: admin/views/update-network.php:13 admin/views/update.php:8
-msgid "Advanced Custom Fields Database Upgrade"
-msgstr "Atualização do Banco de Dados do Advanced Custom Fields"
-
-#: admin/views/update-network.php:15
-#, php-format
-msgid ""
-"The following sites require a DB upgrade. Check the ones you want to update "
-"and then click %s."
-msgstr ""
-"O banco de dados dos sites abaixo precisam ser atualizados. Verifique os que "
-"você deseja atualizar e clique %s."
-
-#: admin/views/update-network.php:24 admin/views/update-network.php:32
-msgid "Site"
-msgstr "Site"
-
-#: admin/views/update-network.php:52
-#, php-format
-msgid "Site requires database upgrade from %s to %s"
-msgstr "Site requer atualização do banco de dados da versão %s para %s"
-
-#: admin/views/update-network.php:54
-msgid "Site is up to date"
-msgstr "Site está atualizado"
-
-#: admin/views/update-network.php:67 admin/views/update.php:16
-msgid "Database Upgrade complete. Return to network dashboard "
-msgstr "Atualização do Banco de Dados realizada. Retornar para o painel da rede "
-
-#: admin/views/update-network.php:106 admin/views/update-notice.php:35
-msgid ""
-"It is strongly recommended that you backup your database before proceeding. "
-"Are you sure you wish to run the updater now?"
-msgstr ""
-"É altamente recomendado fazer um backup do seu banco de dados antes de "
-"continuar. Você tem certeza que deseja atualizar agora?"
-
-#: admin/views/update-network.php:162
-msgid "Upgrade complete"
-msgstr "Atualização realizada"
-
-#: admin/views/update-network.php:166 admin/views/update.php:14
-#, php-format
-msgid "Upgrading data to version %s"
-msgstr "Atualizando os dados para a versão %s"
-
-#: admin/views/update-notice.php:23
-msgid "Database Upgrade Required"
-msgstr "Atualização do Banco de Dados Necessária"
-
-#: admin/views/update-notice.php:25
-#, php-format
-msgid "Thank you for updating to %s v%s!"
-msgstr "Obrigado por atualizar para o %s v%s!"
-
-#: admin/views/update-notice.php:25
-msgid ""
-"Before you start using the new awesome features, please update your database "
-"to the newest version."
-msgstr ""
-"Antes de começar a utilizar as novas e incríveis funcionalidades, por favor "
-"atualize seus banco de dados para a versão mais recente."
-
-#: admin/views/update.php:12
-msgid "Reading upgrade tasks..."
-msgstr "Lendo as tarefas de atualização…"
-
-#: admin/views/update.php:16
-msgid "See what's new"
-msgstr "Veja o que há de novo"
-
-#: api/api-helpers.php:944
+#: api/api-helpers.php:961
msgid "Thumbnail"
msgstr "Miniatura"
-#: api/api-helpers.php:945
+#: api/api-helpers.php:962
msgid "Medium"
msgstr "Média"
-#: api/api-helpers.php:946
+#: api/api-helpers.php:963
msgid "Large"
msgstr "Grande"
-#: api/api-helpers.php:995
+#: api/api-helpers.php:1012
msgid "Full Size"
msgstr "Tamanho Original"
-#: api/api-helpers.php:1207 api/api-helpers.php:1770 pro/fields/clone.php:866
+#: api/api-helpers.php:1353 api/api-helpers.php:1942 pro/fields/clone.php:1042
msgid "(no title)"
msgstr "(sem título)"
-#: api/api-helpers.php:1807 fields/page_link.php:284
-#: fields/post_object.php:283 fields/taxonomy.php:989
+#: api/api-helpers.php:1979 fields/page_link.php:284 fields/post_object.php:283
+#: fields/taxonomy.php:988
msgid "Parent"
msgstr "Página de Nível mais Alto (sem mãe)"
-#: api/api-helpers.php:3873
+#: api/api-helpers.php:3993
#, php-format
msgid "Image width must be at least %dpx."
msgstr "A largura da imagem deve ter pelo menos %dpx."
-#: api/api-helpers.php:3878
+#: api/api-helpers.php:3998
#, php-format
msgid "Image width must not exceed %dpx."
msgstr "A largura da imagem não pode ser maior que %dpx."
-#: api/api-helpers.php:3894
+#: api/api-helpers.php:4014
#, php-format
msgid "Image height must be at least %dpx."
msgstr "A altura da imagem deve ter pelo menos %dpx."
-#: api/api-helpers.php:3899
+#: api/api-helpers.php:4019
#, php-format
msgid "Image height must not exceed %dpx."
msgstr "A altura da imagem não pode ser maior que %dpx."
-#: api/api-helpers.php:3917
+#: api/api-helpers.php:4037
#, php-format
msgid "File size must be at least %s."
msgstr "O tamanho do arquivo deve ter pelo menos %s."
-#: api/api-helpers.php:3922
+#: api/api-helpers.php:4042
#, php-format
msgid "File size must must not exceed %s."
msgstr "O tamanho do arquivo não pode ser maior que %s."
-#: api/api-helpers.php:3956
+#: api/api-helpers.php:4076
#, php-format
msgid "File type must be %s."
msgstr "O tipo de arquivo deve ser %s."
-#: api/api-template.php:1092
-msgid "Spam Detected"
-msgstr "Spam Detectado"
-
-#: api/api-template.php:1235 pro/api/api-options-page.php:50
-#: pro/fields/gallery.php:588
-msgid "Update"
-msgstr "Atualizar"
-
-#: api/api-template.php:1236
-msgid "Post updated"
-msgstr "Post atualizado"
-
-#: api/api-template.php:1304 core/field.php:133
-msgid "Content"
-msgstr "Conteúdo"
-
-#: api/api-template.php:1369
-msgid "Validate Email"
-msgstr "Validar Email"
-
-#: core/field.php:132
+#: core/field.php:334
msgid "Basic"
msgstr "Básico"
-#: core/field.php:134
+#: core/field.php:335 core/form.php:45
+msgid "Content"
+msgstr "Conteúdo"
+
+#: core/field.php:336
msgid "Choice"
msgstr "Escolha"
-#: core/field.php:135
+#: core/field.php:337
msgid "Relational"
msgstr "Relacional"
-#: core/field.php:136
+#: core/field.php:338
msgid "jQuery"
msgstr "jQuery"
-#: core/field.php:137 fields/checkbox.php:224 fields/radio.php:293
-#: pro/fields/clone.php:709 pro/fields/flexible-content.php:495
-#: pro/fields/flexible-content.php:544 pro/fields/repeater.php:459
+#: core/field.php:339 fields/checkbox.php:281 fields/radio.php:292
+#: pro/fields/clone.php:889 pro/fields/flexible-content.php:576
+#: pro/fields/flexible-content.php:625 pro/fields/repeater.php:514
msgid "Layout"
msgstr "Layout"
+#: core/form.php:53
+msgid "Validate Email"
+msgstr "Validar Email"
+
+#: core/form.php:101 pro/api/api-options-page.php:52 pro/fields/gallery.php:588
+msgid "Update"
+msgstr "Atualizar"
+
+#: core/form.php:102
+msgid "Post updated"
+msgstr "Post atualizado"
+
+#: core/form.php:227
+msgid "Spam Detected"
+msgstr "Spam Detectado"
+
#: core/input.php:258
msgid "Expand Details"
msgstr "Expandir Detalhes"
@@ -1464,7 +1483,7 @@ msgstr "Recolher Detalhes"
msgid "Validation successful"
msgstr "Validação realizada com sucesso"
-#: core/input.php:261 core/validation.php:306 forms/widget.php:234
+#: core/input.php:261 core/validation.php:322 forms/widget.php:236
msgid "Validation failed"
msgstr "Falha na validação"
@@ -1481,7 +1500,7 @@ msgstr "%d campos requerem sua atenção"
msgid "Restricted"
msgstr "Restrito"
-#: core/media.php:54 fields/select.php:249
+#: core/media.php:54 fields/select.php:274
msgctxt "verb"
msgid "Select"
msgstr "Selecionar"
@@ -1506,74 +1525,94 @@ msgstr "Anexado ao post"
msgid "%s value is required"
msgstr "É necessário preencher o campo %s"
-#: fields/checkbox.php:36 fields/taxonomy.php:767
+#: fields/checkbox.php:36 fields/taxonomy.php:782
msgid "Checkbox"
msgstr "Checkbox"
-#: fields/checkbox.php:142
+#: fields/checkbox.php:145
msgid "Toggle All"
msgstr "Selecionar Tudo"
-#: fields/checkbox.php:206 fields/radio.php:241 fields/select.php:446
+#: fields/checkbox.php:202
+msgid "Add new choice"
+msgstr "Adicionar nova opção"
+
+#: fields/checkbox.php:241 fields/radio.php:242 fields/select.php:470
msgid "Choices"
msgstr "Escolhas"
-#: fields/checkbox.php:207 fields/radio.php:242 fields/select.php:447
+#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:471
msgid "Enter each choice on a new line."
msgstr "Digite cada opção em uma nova linha."
-#: fields/checkbox.php:207 fields/radio.php:242 fields/select.php:447
+#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:471
msgid "For more control, you may specify both a value and label like this:"
msgstr ""
"Para mais controle, você pode especificar tanto os valores quanto os "
"rótulos, como nos exemplos:"
-#: fields/checkbox.php:207 fields/radio.php:242 fields/select.php:447
+#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:471
msgid "red : Red"
msgstr "vermelho : Vermelho"
-#: fields/checkbox.php:215 fields/color_picker.php:147 fields/email.php:124
-#: fields/number.php:150 fields/radio.php:284 fields/select.php:455
-#: fields/text.php:148 fields/textarea.php:145 fields/true_false.php:115
-#: fields/url.php:117 fields/wysiwyg.php:379
+#: fields/checkbox.php:250
+msgid "Allow Custom"
+msgstr "Permitir personalização"
+
+#: fields/checkbox.php:255
+msgid "Allow 'custom' values to be added"
+msgstr "Permite adicionar valores personalizados"
+
+#: fields/checkbox.php:261
+msgid "Save Custom"
+msgstr "Salvar personalização"
+
+#: fields/checkbox.php:266
+msgid "Save 'custom' values to the field's choices"
+msgstr "Salva valores personalizados nas opções do campo"
+
+#: fields/checkbox.php:272 fields/color_picker.php:147 fields/email.php:133
+#: fields/number.php:145 fields/radio.php:283 fields/select.php:479
+#: fields/text.php:142 fields/textarea.php:139 fields/true_false.php:150
+#: fields/url.php:114 fields/wysiwyg.php:436
msgid "Default Value"
msgstr "Valor Padrão"
-#: fields/checkbox.php:216 fields/select.php:456
+#: fields/checkbox.php:273 fields/select.php:480
msgid "Enter each default value on a new line"
msgstr "Digite cada valor padrão em uma nova linha"
-#: fields/checkbox.php:230 fields/radio.php:299
+#: fields/checkbox.php:287 fields/radio.php:298
msgid "Vertical"
msgstr "Vertical"
-#: fields/checkbox.php:231 fields/radio.php:300
+#: fields/checkbox.php:288 fields/radio.php:299
msgid "Horizontal"
msgstr "Horizontal"
-#: fields/checkbox.php:238
+#: fields/checkbox.php:295
msgid "Toggle"
msgstr "Selecionar Tudo"
-#: fields/checkbox.php:239
+#: fields/checkbox.php:296
msgid "Prepend an extra checkbox to toggle all choices"
msgstr "Incluir um checkbox adicional que marca (ou desmarca) todas as opções"
-#: fields/checkbox.php:252 fields/file.php:220 fields/image.php:206
-#: fields/radio.php:307 fields/taxonomy.php:836
+#: fields/checkbox.php:305 fields/file.php:219 fields/image.php:206
+#: fields/radio.php:306 fields/taxonomy.php:835
msgid "Return Value"
msgstr "Valor Retornado"
-#: fields/checkbox.php:253 fields/file.php:221 fields/image.php:207
-#: fields/radio.php:308
+#: fields/checkbox.php:306 fields/file.php:220 fields/image.php:207
+#: fields/radio.php:307
msgid "Specify the returned value on front end"
msgstr "Especifique a forma como os valores serão retornados no front-end"
-#: fields/checkbox.php:258 fields/radio.php:313 fields/select.php:526
+#: fields/checkbox.php:311 fields/radio.php:312 fields/select.php:533
msgid "Value"
msgstr "Valor"
-#: fields/checkbox.php:260 fields/radio.php:315 fields/select.php:528
+#: fields/checkbox.php:313 fields/radio.php:314 fields/select.php:535
msgid "Both (Array)"
msgstr "Ambos (Array)"
@@ -1626,28 +1665,36 @@ msgctxt "Date Picker JS weekHeader"
msgid "Wk"
msgstr "Sem"
-#: fields/date_picker.php:195 fields/date_time_picker.php:184
+#: fields/date_picker.php:216 fields/date_time_picker.php:190
#: fields/time_picker.php:126
msgid "Display Format"
msgstr "Formato de Exibição"
-#: fields/date_picker.php:196 fields/date_time_picker.php:185
+#: fields/date_picker.php:217 fields/date_time_picker.php:191
#: fields/time_picker.php:127
msgid "The format displayed when editing a post"
msgstr "O formato que será exibido ao editar um post"
-#: fields/date_picker.php:210 fields/date_time_picker.php:200
-#: fields/post_object.php:455 fields/relationship.php:783
-#: fields/select.php:520 fields/time_picker.php:140
+#: fields/date_picker.php:234
+msgid "Save Format"
+msgstr "Salvar formato"
+
+#: fields/date_picker.php:235
+msgid "The format used when saving a value"
+msgstr "O formato usado ao salvar um valor"
+
+#: fields/date_picker.php:245 fields/date_time_picker.php:206
+#: fields/post_object.php:447 fields/relationship.php:778 fields/select.php:528
+#: fields/time_picker.php:140
msgid "Return Format"
msgstr "Formato dos Dados"
-#: fields/date_picker.php:211 fields/date_time_picker.php:201
+#: fields/date_picker.php:246 fields/date_time_picker.php:207
#: fields/time_picker.php:141
msgid "The format returned via template functions"
msgstr "O formato que será retornado através das funções de template"
-#: fields/date_picker.php:226 fields/date_time_picker.php:216
+#: fields/date_picker.php:263 fields/date_time_picker.php:222
msgid "Week Starts On"
msgstr "Semana começa em"
@@ -1734,39 +1781,39 @@ msgstr "P"
msgid "Email"
msgstr "Email"
-#: fields/email.php:125 fields/number.php:151 fields/radio.php:285
-#: fields/text.php:149 fields/textarea.php:146 fields/url.php:118
-#: fields/wysiwyg.php:380
+#: fields/email.php:134 fields/number.php:146 fields/radio.php:284
+#: fields/text.php:143 fields/textarea.php:140 fields/url.php:115
+#: fields/wysiwyg.php:437
msgid "Appears when creating a new post"
msgstr "Aparece quando o novo post é criado"
-#: fields/email.php:133 fields/number.php:159 fields/password.php:137
-#: fields/text.php:157 fields/textarea.php:154 fields/url.php:126
+#: fields/email.php:142 fields/number.php:154 fields/password.php:134
+#: fields/text.php:151 fields/textarea.php:148 fields/url.php:123
msgid "Placeholder Text"
msgstr "Texto Placeholder"
-#: fields/email.php:134 fields/number.php:160 fields/password.php:138
-#: fields/text.php:158 fields/textarea.php:155 fields/url.php:127
+#: fields/email.php:143 fields/number.php:155 fields/password.php:135
+#: fields/text.php:152 fields/textarea.php:149 fields/url.php:124
msgid "Appears within the input"
msgstr "Texto que aparecerá dentro do campo (até que algo seja digitado)"
-#: fields/email.php:142 fields/number.php:168 fields/password.php:146
-#: fields/text.php:166
+#: fields/email.php:151 fields/number.php:163 fields/password.php:143
+#: fields/text.php:160
msgid "Prepend"
msgstr "Prefixo"
-#: fields/email.php:143 fields/number.php:169 fields/password.php:147
-#: fields/text.php:167
+#: fields/email.php:152 fields/number.php:164 fields/password.php:144
+#: fields/text.php:161
msgid "Appears before the input"
msgstr "Texto que aparecerá antes do campo"
-#: fields/email.php:151 fields/number.php:177 fields/password.php:155
-#: fields/text.php:175
+#: fields/email.php:160 fields/number.php:172 fields/password.php:152
+#: fields/text.php:169
msgid "Append"
msgstr "Sufixo"
-#: fields/email.php:152 fields/number.php:178 fields/password.php:156
-#: fields/text.php:176
+#: fields/email.php:161 fields/number.php:173 fields/password.php:153
+#: fields/text.php:170
msgid "Appears after the input"
msgstr "Texto que aparecerá após o campo"
@@ -1782,61 +1829,61 @@ msgstr "Editar Arquivo"
msgid "Update File"
msgstr "Atualizar Arquivo"
-#: fields/file.php:148
+#: fields/file.php:145
msgid "File name"
msgstr "Nome do arquivo"
-#: fields/file.php:152 fields/file.php:253 fields/file.php:264
-#: fields/image.php:268 fields/image.php:301 pro/fields/gallery.php:707
-#: pro/fields/gallery.php:740
+#: fields/file.php:149 fields/file.php:252 fields/file.php:263
+#: fields/image.php:266 fields/image.php:295 pro/fields/gallery.php:705
+#: pro/fields/gallery.php:734
msgid "File size"
msgstr "Tamanho"
-#: fields/file.php:175
+#: fields/file.php:174
msgid "Add File"
msgstr "Adicionar Arquivo"
-#: fields/file.php:226
+#: fields/file.php:225
msgid "File Array"
msgstr "Array do arquivo"
-#: fields/file.php:227
+#: fields/file.php:226
msgid "File URL"
msgstr "URL do Arquivo"
-#: fields/file.php:228
+#: fields/file.php:227
msgid "File ID"
msgstr "ID do Arquivo"
-#: fields/file.php:235 fields/image.php:231 pro/fields/gallery.php:670
+#: fields/file.php:234 fields/image.php:231 pro/fields/gallery.php:670
msgid "Library"
msgstr "Biblioteca"
-#: fields/file.php:236 fields/image.php:232 pro/fields/gallery.php:671
+#: fields/file.php:235 fields/image.php:232 pro/fields/gallery.php:671
msgid "Limit the media library choice"
msgstr "Limitar a escolha da biblioteca de mídia"
-#: fields/file.php:242 fields/image.php:238 pro/fields/gallery.php:677
+#: fields/file.php:241 fields/image.php:238 pro/fields/gallery.php:677
msgid "Uploaded to post"
msgstr "Anexado ao post"
-#: fields/file.php:249 fields/image.php:245 pro/fields/gallery.php:684
+#: fields/file.php:248 fields/image.php:245 pro/fields/gallery.php:684
msgid "Minimum"
msgstr "Mínimo"
-#: fields/file.php:250 fields/file.php:261
+#: fields/file.php:249 fields/file.php:260
msgid "Restrict which files can be uploaded"
msgstr "Limita o tamanho dos arquivos que poderão ser carregados"
-#: fields/file.php:260 fields/image.php:278 pro/fields/gallery.php:717
+#: fields/file.php:259 fields/image.php:274 pro/fields/gallery.php:713
msgid "Maximum"
msgstr "Máximo"
-#: fields/file.php:271 fields/image.php:311 pro/fields/gallery.php:750
+#: fields/file.php:270 fields/image.php:303 pro/fields/gallery.php:742
msgid "Allowed file types"
msgstr "Tipos de arquivos permitidos"
-#: fields/file.php:272 fields/image.php:312 pro/fields/gallery.php:751
+#: fields/file.php:271 fields/image.php:304 pro/fields/gallery.php:743
msgid "Comma separated list. Leave blank for all types"
msgstr ""
"Lista separada por vírgulas. Deixe em branco para permitir todos os tipos"
@@ -1853,44 +1900,40 @@ msgstr "Localizando"
msgid "Sorry, this browser does not support geolocation"
msgstr "O seu navegador não suporta o recurso de geolocalização"
-#: fields/google-map.php:133 fields/relationship.php:742
-msgid "Search"
-msgstr "Pesquisa"
-
-#: fields/google-map.php:134
+#: fields/google-map.php:133
msgid "Clear location"
msgstr "Limpar a localização"
-#: fields/google-map.php:135
+#: fields/google-map.php:134
msgid "Find current location"
msgstr "Encontre a localização atual"
-#: fields/google-map.php:138
+#: fields/google-map.php:137
msgid "Search for address..."
msgstr "Pesquisar endereço…"
-#: fields/google-map.php:168 fields/google-map.php:179
+#: fields/google-map.php:167 fields/google-map.php:178
msgid "Center"
msgstr "Centro"
-#: fields/google-map.php:169 fields/google-map.php:180
+#: fields/google-map.php:168 fields/google-map.php:179
msgid "Center the initial map"
msgstr "Centro inicial do mapa"
-#: fields/google-map.php:193
+#: fields/google-map.php:190
msgid "Zoom"
msgstr "Zoom"
-#: fields/google-map.php:194
+#: fields/google-map.php:191
msgid "Set the initial zoom level"
msgstr "Definir o nível do zoom inicial"
-#: fields/google-map.php:203 fields/image.php:257 fields/image.php:290
-#: fields/oembed.php:275 pro/fields/gallery.php:696 pro/fields/gallery.php:729
+#: fields/google-map.php:200 fields/image.php:257 fields/image.php:286
+#: fields/oembed.php:297 pro/fields/gallery.php:696 pro/fields/gallery.php:725
msgid "Height"
msgstr "Altura"
-#: fields/google-map.php:204
+#: fields/google-map.php:201
msgid "Customise the map height"
msgstr "Personalizar a altura do mapa"
@@ -1914,7 +1957,7 @@ msgstr "Atualizar Imagem"
msgid "All images"
msgstr "Todas as imagens"
-#: fields/image.php:144 pro/fields/gallery.php:358 pro/fields/gallery.php:546
+#: fields/image.php:142 pro/fields/gallery.php:358 pro/fields/gallery.php:546
msgid "Remove"
msgstr "Remover"
@@ -1946,45 +1989,45 @@ msgstr "Tamanho da Pré-visualização"
msgid "Shown when entering data"
msgstr "Exibido ao inserir os dados"
-#: fields/image.php:246 fields/image.php:279 pro/fields/gallery.php:685
-#: pro/fields/gallery.php:718
+#: fields/image.php:246 fields/image.php:275 pro/fields/gallery.php:685
+#: pro/fields/gallery.php:714
msgid "Restrict which images can be uploaded"
msgstr "Limita as imagens que poderão ser carregadas"
-#: fields/image.php:249 fields/image.php:282 fields/oembed.php:264
-#: pro/fields/gallery.php:688 pro/fields/gallery.php:721
+#: fields/image.php:249 fields/image.php:278 fields/oembed.php:286
+#: pro/fields/gallery.php:688 pro/fields/gallery.php:717
msgid "Width"
msgstr "Largura"
-#: fields/message.php:36 fields/message.php:116 fields/true_false.php:106
+#: fields/message.php:36 fields/message.php:115 fields/true_false.php:141
msgid "Message"
msgstr "Mensagem"
-#: fields/message.php:125 fields/textarea.php:182
+#: fields/message.php:124 fields/textarea.php:176
msgid "New Lines"
msgstr "Novas Linhas"
-#: fields/message.php:126 fields/textarea.php:183
+#: fields/message.php:125 fields/textarea.php:177
msgid "Controls how new lines are rendered"
msgstr "Controla como as novas linhas são renderizadas"
-#: fields/message.php:130 fields/textarea.php:187
+#: fields/message.php:129 fields/textarea.php:181
msgid "Automatically add paragraphs"
msgstr "Adicionar parágrafos automaticamente"
-#: fields/message.php:131 fields/textarea.php:188
+#: fields/message.php:130 fields/textarea.php:182
msgid "Automatically add <br>"
msgstr "Adicionar <br> automaticamente"
-#: fields/message.php:132 fields/textarea.php:189
+#: fields/message.php:131 fields/textarea.php:183
msgid "No Formatting"
msgstr "Sem Formatação"
-#: fields/message.php:139
+#: fields/message.php:138
msgid "Escape HTML"
msgstr "Ignorar HTML"
-#: fields/message.php:140
+#: fields/message.php:139
msgid "Allow HTML markup to display as visible text instead of rendering"
msgstr ""
"Permitir que a marcação HTML seja exibida como texto ao invés de ser "
@@ -1994,28 +2037,28 @@ msgstr ""
msgid "Number"
msgstr "Número"
-#: fields/number.php:186
+#: fields/number.php:181
msgid "Minimum Value"
msgstr "Valor Mínimo"
-#: fields/number.php:195
+#: fields/number.php:190
msgid "Maximum Value"
msgstr "Valor Máximo"
-#: fields/number.php:204
+#: fields/number.php:199
msgid "Step Size"
msgstr "Tamanho das frações"
-#: fields/number.php:242
+#: fields/number.php:237
msgid "Value must be a number"
msgstr "O valor deve ser um número"
-#: fields/number.php:260
+#: fields/number.php:255
#, php-format
msgid "Value must be equal to or higher than %d"
msgstr "O valor deve ser igual ou maior que %d"
-#: fields/number.php:268
+#: fields/number.php:263
#, php-format
msgid "Value must be equal to or lower than %d"
msgstr "O valor deve ser igual ou menor que %d"
@@ -2024,15 +2067,19 @@ msgstr "O valor deve ser igual ou menor que %d"
msgid "oEmbed"
msgstr "oEmbed"
-#: fields/oembed.php:212
+#: fields/oembed.php:237
msgid "Enter URL"
msgstr "Digite a URL"
-#: fields/oembed.php:225
+#: fields/oembed.php:250 fields/taxonomy.php:900
+msgid "Error."
+msgstr "Erro."
+
+#: fields/oembed.php:250
msgid "No embed found for the given URL."
msgstr "Nenhuma mídia incorporada encontrada na URL fornecida."
-#: fields/oembed.php:261 fields/oembed.php:272
+#: fields/oembed.php:283 fields/oembed.php:294
msgid "Embed Size"
msgstr "Tamanho da Mídia incorporada"
@@ -2041,36 +2088,36 @@ msgid "Archives"
msgstr "Arquivos"
#: fields/page_link.php:500 fields/post_object.php:399
-#: fields/relationship.php:709
+#: fields/relationship.php:704
msgid "Filter by Post Type"
msgstr "Filtrar por Tipo de Post"
#: fields/page_link.php:508 fields/post_object.php:407
-#: fields/relationship.php:717
+#: fields/relationship.php:712
msgid "All post types"
msgstr "Todos os tipos de posts"
#: fields/page_link.php:514 fields/post_object.php:413
-#: fields/relationship.php:723
+#: fields/relationship.php:718
msgid "Filter by Taxonomy"
msgstr "Filtrar por Taxonomia"
#: fields/page_link.php:522 fields/post_object.php:421
-#: fields/relationship.php:731
+#: fields/relationship.php:726
msgid "All taxonomies"
msgstr "Todas as taxonomias"
-#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:250
-#: fields/select.php:464 fields/taxonomy.php:780 fields/user.php:394
+#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:251
+#: fields/select.php:488 fields/taxonomy.php:795 fields/user.php:423
msgid "Allow Null?"
msgstr "Permitir Nulo?"
-#: fields/page_link.php:542
+#: fields/page_link.php:538
msgid "Allow Archives URLs"
msgstr "Permitir URLs do Arquivo"
-#: fields/page_link.php:556 fields/post_object.php:441 fields/select.php:478
-#: fields/user.php:408
+#: fields/page_link.php:548 fields/post_object.php:437 fields/select.php:498
+#: fields/user.php:433
msgid "Select multiple values?"
msgstr "Selecionar vários valores?"
@@ -2078,12 +2125,12 @@ msgstr "Selecionar vários valores?"
msgid "Password"
msgstr "Senha"
-#: fields/post_object.php:36 fields/post_object.php:460
-#: fields/relationship.php:788
+#: fields/post_object.php:36 fields/post_object.php:452
+#: fields/relationship.php:783
msgid "Post Object"
msgstr "Objeto do Post"
-#: fields/post_object.php:461 fields/relationship.php:789
+#: fields/post_object.php:453 fields/relationship.php:784
msgid "Post ID"
msgstr "ID do Post"
@@ -2091,21 +2138,21 @@ msgstr "ID do Post"
msgid "Radio Button"
msgstr "Botão de Rádio"
-#: fields/radio.php:264
+#: fields/radio.php:261
msgid "Other"
msgstr "Outro"
-#: fields/radio.php:268
+#: fields/radio.php:266
msgid "Add 'other' choice to allow for custom values"
msgstr ""
"Adicionar uma opção ‘Outro’ para permitir a inserção de valores "
"personalizados"
-#: fields/radio.php:274
+#: fields/radio.php:272
msgid "Save Other"
msgstr "Salvar Outro"
-#: fields/radio.php:278
+#: fields/radio.php:277
msgid "Save 'other' values to the field's choices"
msgstr ""
"Salvar os valores personalizados inseridos na opção ‘Outros’ na lista de "
@@ -2131,46 +2178,46 @@ msgstr "Carregando"
msgid "No matches found"
msgstr "Nenhuma correspondência encontrada"
-#: fields/relationship.php:590
+#: fields/relationship.php:585
msgid "Search..."
msgstr "Pesquisar…"
-#: fields/relationship.php:599
+#: fields/relationship.php:594
msgid "Select post type"
msgstr "Selecione o tipo de post"
-#: fields/relationship.php:612
+#: fields/relationship.php:607
msgid "Select taxonomy"
msgstr "Selecione a taxonomia"
-#: fields/relationship.php:744 fields/taxonomy.php:36 fields/taxonomy.php:750
+#: fields/relationship.php:739 fields/taxonomy.php:36 fields/taxonomy.php:765
msgid "Taxonomy"
msgstr "Taxonomia"
-#: fields/relationship.php:751
+#: fields/relationship.php:746
msgid "Elements"
msgstr "Elementos"
-#: fields/relationship.php:752
+#: fields/relationship.php:747
msgid "Selected elements will be displayed in each result"
msgstr "Os elementos selecionados serão exibidos em cada resultado do filtro"
-#: fields/relationship.php:763
+#: fields/relationship.php:758
msgid "Minimum posts"
msgstr "Qtde. mínima de posts"
-#: fields/relationship.php:772
+#: fields/relationship.php:767
msgid "Maximum posts"
msgstr "Qtde. máxima de posts"
-#: fields/relationship.php:876 pro/fields/gallery.php:823
+#: fields/relationship.php:871 pro/fields/gallery.php:815
#, php-format
msgid "%s requires at least %s selection"
msgid_plural "%s requires at least %s selections"
msgstr[0] "%s requer a seleção de ao menos %s item"
msgstr[1] "%s requer a seleção de ao menos %s itens"
-#: fields/select.php:36 fields/taxonomy.php:772
+#: fields/select.php:36 fields/taxonomy.php:787
msgctxt "noun"
msgid "Select"
msgstr "Seleção"
@@ -2240,15 +2287,15 @@ msgctxt "Select2 JS load_fail"
msgid "Loading failed"
msgstr "Falha ao carregar"
-#: fields/select.php:492
+#: fields/select.php:508 fields/true_false.php:159
msgid "Stylised UI"
msgstr "Interface do campo aprimorada"
-#: fields/select.php:506
+#: fields/select.php:518
msgid "Use AJAX to lazy load choices?"
msgstr "Utilizar AJAX para carregar opções?"
-#: fields/select.php:521
+#: fields/select.php:529
msgid "Specify the value returned"
msgstr "Especifique a forma como os valores serão retornados"
@@ -2256,7 +2303,7 @@ msgstr "Especifique a forma como os valores serão retornados"
msgid "Tab"
msgstr "Aba"
-#: fields/tab.php:97
+#: fields/tab.php:96
msgid ""
"The tab field will display incorrectly when added to a Table style repeater "
"field or flexible content field layout"
@@ -2264,7 +2311,7 @@ msgstr ""
"O campo Aba será exibido incorretamente quando adicionado em um layout do "
"tipo Tabela de campos repetidores ou de conteúdos flexíveis"
-#: fields/tab.php:98
+#: fields/tab.php:97
msgid ""
"Use \"Tab Fields\" to better organize your edit screen by grouping fields "
"together."
@@ -2272,7 +2319,7 @@ msgstr ""
"Utilize o campo “Aba” para agrupar seus campos e organizar melhor sua tela "
"de edição."
-#: fields/tab.php:99
+#: fields/tab.php:98
msgid ""
"All fields following this \"tab field\" (or until another \"tab field\" is "
"defined) will be grouped together using this field's label as the tab "
@@ -2282,99 +2329,104 @@ msgstr ""
"definida) ficarão juntos em um grupo que utilizará o rótulo deste campo como "
"título da guia."
-#: fields/tab.php:113
+#: fields/tab.php:112
msgid "Placement"
msgstr "Posicionamento"
-#: fields/tab.php:125
+#: fields/tab.php:124
msgid "End-point"
msgstr "Ponto final"
-#: fields/tab.php:126
+#: fields/tab.php:125
msgid "Use this field as an end-point and start a new group of tabs"
msgstr ""
"Utilizar este campo como um ponto final e iniciar um novo grupo de abas"
-#: fields/taxonomy.php:719
+#: fields/taxonomy.php:715 fields/true_false.php:95 fields/true_false.php:184
+#: pro/admin/views/settings-updates.php:103
+msgid "No"
+msgstr "Não"
+
+#: fields/taxonomy.php:734
msgid "None"
msgstr "Nenhuma"
-#: fields/taxonomy.php:751
+#: fields/taxonomy.php:766
msgid "Select the taxonomy to be displayed"
msgstr "Selecione a taxonomia que será exibida"
-#: fields/taxonomy.php:760
+#: fields/taxonomy.php:775
msgid "Appearance"
msgstr "Aparência"
-#: fields/taxonomy.php:761
+#: fields/taxonomy.php:776
msgid "Select the appearance of this field"
msgstr "Selecione a aparência deste campo"
-#: fields/taxonomy.php:766
+#: fields/taxonomy.php:781
msgid "Multiple Values"
msgstr "Vários valores"
-#: fields/taxonomy.php:768
+#: fields/taxonomy.php:783
msgid "Multi Select"
msgstr "Seleção Múltipla"
-#: fields/taxonomy.php:770
+#: fields/taxonomy.php:785
msgid "Single Value"
msgstr "Um único valor"
-#: fields/taxonomy.php:771
+#: fields/taxonomy.php:786
msgid "Radio Buttons"
msgstr "Botões de Rádio"
-#: fields/taxonomy.php:794
+#: fields/taxonomy.php:805
msgid "Create Terms"
msgstr "Criar Termos"
-#: fields/taxonomy.php:795
+#: fields/taxonomy.php:806
msgid "Allow new terms to be created whilst editing"
msgstr "Permite que novos termos sejam criados diretamente na tela de edição"
-#: fields/taxonomy.php:808
+#: fields/taxonomy.php:815
msgid "Save Terms"
msgstr "Salvar Termos"
-#: fields/taxonomy.php:809
+#: fields/taxonomy.php:816
msgid "Connect selected terms to the post"
msgstr "Atribui e conecta os termos selecionados ao post"
-#: fields/taxonomy.php:822
+#: fields/taxonomy.php:825
msgid "Load Terms"
msgstr "Carregar Termos"
-#: fields/taxonomy.php:823
+#: fields/taxonomy.php:826
msgid "Load value from posts terms"
msgstr "Carrega os termos que estão atribuídos ao post"
-#: fields/taxonomy.php:841
+#: fields/taxonomy.php:840
msgid "Term Object"
msgstr "Objeto do Termo"
-#: fields/taxonomy.php:842
+#: fields/taxonomy.php:841
msgid "Term ID"
msgstr "ID do Termo"
-#: fields/taxonomy.php:901
+#: fields/taxonomy.php:900
#, php-format
msgid "User unable to add new %s"
msgstr "Usuário incapaz de adicionar novo(a) %s"
-#: fields/taxonomy.php:914
+#: fields/taxonomy.php:913
#, php-format
msgid "%s already exists"
msgstr "%s já existe"
-#: fields/taxonomy.php:955
+#: fields/taxonomy.php:954
#, php-format
msgid "%s added"
msgstr "%s adicionado(a)"
-#: fields/taxonomy.php:1000
+#: fields/taxonomy.php:999
msgid "Add"
msgstr "Adicionar"
@@ -2382,11 +2434,11 @@ msgstr "Adicionar"
msgid "Text"
msgstr "Texto"
-#: fields/text.php:184 fields/textarea.php:163
+#: fields/text.php:178 fields/textarea.php:157
msgid "Character Limit"
msgstr "Limite de Caracteres"
-#: fields/text.php:185 fields/textarea.php:164
+#: fields/text.php:179 fields/textarea.php:158
msgid "Leave blank for no limit"
msgstr "Deixe em branco para nenhum limite"
@@ -2394,11 +2446,11 @@ msgstr "Deixe em branco para nenhum limite"
msgid "Text Area"
msgstr "Área de Texto"
-#: fields/textarea.php:172
+#: fields/textarea.php:166
msgid "Rows"
msgstr "Linhas"
-#: fields/textarea.php:173
+#: fields/textarea.php:167
msgid "Sets the textarea height"
msgstr "Define a altura da área de texto"
@@ -2410,101 +2462,138 @@ msgstr "Seletor de Hora"
msgid "True / False"
msgstr "Verdadeiro / Falso"
-#: fields/true_false.php:107
-msgid "eg. Show extra content"
-msgstr "ex.: Mostrar conteúdo adicional"
+#: fields/true_false.php:94 fields/true_false.php:174
+#: pro/admin/views/settings-updates.php:93
+msgid "Yes"
+msgstr "Sim"
+
+#: fields/true_false.php:142
+msgid "Displays text alongside the checkbox"
+msgstr "Exibe texto ao lado da caixa de seleção"
+
+#: fields/true_false.php:170
+#, fuzzy
+msgid "On Text"
+msgstr "On Texto"
+
+#: fields/true_false.php:171
+msgid "Text shown when active"
+msgstr "Texto exibido quando ativo"
+
+#: fields/true_false.php:180
+#, fuzzy
+msgid "Off Text"
+msgstr "Off Texto"
+
+#: fields/true_false.php:181
+msgid "Text shown when inactive"
+msgstr "Texto exibido quando inativo"
#: fields/url.php:36
msgid "Url"
msgstr "Url"
-#: fields/url.php:168
+#: fields/url.php:165
msgid "Value must be a valid URL"
msgstr "Você deve fornecer uma URL válida"
-#: fields/user.php:379
+#: fields/user.php:408
msgid "Filter by role"
msgstr "Filtrar por função"
-#: fields/user.php:387
+#: fields/user.php:416
msgid "All user roles"
msgstr "Todas as funções de usuários"
-#: fields/wysiwyg.php:37
+#: fields/wysiwyg.php:36
msgid "Wysiwyg Editor"
msgstr "Editor Wysiwyg"
-#: fields/wysiwyg.php:331
+#: fields/wysiwyg.php:385
msgid "Visual"
msgstr "Visual"
-#: fields/wysiwyg.php:332
+#: fields/wysiwyg.php:386
msgctxt "Name for the Text editor tab (formerly HTML)"
msgid "Text"
msgstr "Texto"
-#: fields/wysiwyg.php:388
+#: fields/wysiwyg.php:392
+msgid "Click to initialize TinyMCE"
+msgstr "Clique para inicializar o TinyMCE"
+
+#: fields/wysiwyg.php:445
msgid "Tabs"
msgstr "Abas"
-#: fields/wysiwyg.php:393
+#: fields/wysiwyg.php:450
msgid "Visual & Text"
msgstr "Visual & Texto"
-#: fields/wysiwyg.php:394
+#: fields/wysiwyg.php:451
msgid "Visual Only"
msgstr "Apenas Visual"
-#: fields/wysiwyg.php:395
+#: fields/wysiwyg.php:452
msgid "Text Only"
msgstr "Apenas Texto"
-#: fields/wysiwyg.php:402
+#: fields/wysiwyg.php:459
msgid "Toolbar"
msgstr "Barra de Ferramentas"
-#: fields/wysiwyg.php:412
+#: fields/wysiwyg.php:469
msgid "Show Media Upload Buttons?"
msgstr "Mostrar Botões de Upload de Mídia?"
-#: forms/comment.php:166 forms/post.php:295 pro/admin/options-page.php:416
+#: fields/wysiwyg.php:479
+msgid "Delay initialization?"
+msgstr "Atrasar a inicialização?"
+
+#: fields/wysiwyg.php:480
+msgid "TinyMCE will not be initalized until field is clicked"
+msgstr "TinyMCE não será iniciado até que o campo seja clicado"
+
+#: forms/comment.php:166 forms/post.php:295 pro/admin/options-page.php:421
msgid "Edit field group"
msgstr "Editar Grupo de Campos"
-#: forms/widget.php:235
+#: forms/widget.php:237
#, php-format
msgid "1 field requires attention."
msgid_plural "%d fields require attention."
msgstr[0] "1 campo requer a sua atenção."
msgstr[1] "%d campos requerem sua atenção."
+#. Plugin Name of the plugin/theme
#: pro/acf-pro.php:24
msgid "Advanced Custom Fields PRO"
msgstr "Advanced Custom Fields PRO"
-#: pro/acf-pro.php:192
-msgid "Flexible Content requires at least 1 layout"
-msgstr "O campo de Conteúdo Flexível requer pelo menos 1 layout"
-
-#: pro/admin/options-page.php:49
-msgid "Options Page"
-msgstr "Página de Opções"
-
-#: pro/admin/options-page.php:85
+#: pro/admin/options-page.php:89
msgid "No options pages exist"
msgstr "Não existem Páginas de Opções disponíveis"
-#: pro/admin/options-page.php:303
+#: pro/admin/options-page.php:307
msgid "Options Updated"
msgstr "Opções Atualizadas"
-#: pro/admin/options-page.php:309
+#: pro/admin/options-page.php:313
msgid "Publish"
msgstr "Publicar"
-#: pro/admin/options-page.php:315
-msgid "No Custom Field Groups found for this options page. Create a Custom Field Group "
-msgstr "Nenhum Grupo de Campos Personalizados encontrado para esta página de opções. Criar um Grupo de Campos Personalizado "
+#: pro/admin/options-page.php:319
+#, php-format
+msgid ""
+"No Custom Field Groups found for this options page. Create a "
+"Custom Field Group "
+msgstr ""
+"Nenhum Grupo de Campos Personalizados encontrado para esta página de opções. "
+"Criar um Grupo de Campos Personalizado "
+
+#: pro/admin/settings-updates.php:57 pro/admin/views/settings-updates.php:17
+msgid "Updates"
+msgstr "Atualizações"
#: pro/admin/settings-updates.php:87
msgid "Error . Could not connect to update server"
@@ -2569,7 +2658,7 @@ msgstr "Verificar Novamente"
msgid "Upgrade Notice"
msgstr "Aviso de Atualização"
-#: pro/api/api-options-page.php:22 pro/api/api-options-page.php:23
+#: pro/api/api-options-page.php:24 pro/api/api-options-page.php:25
msgid "Options"
msgstr "Opções"
@@ -2589,73 +2678,78 @@ msgctxt "noun"
msgid "Clone"
msgstr "Clone"
-#: pro/fields/clone.php:680
+#: pro/fields/clone.php:858
msgid "Select one or more fields you wish to clone"
msgstr "Selecione um ou mais campos que deseja clonar"
-#: pro/fields/clone.php:695
+#: pro/fields/clone.php:875
msgid "Display"
msgstr "Exibição"
-#: pro/fields/clone.php:696
+#: pro/fields/clone.php:876
msgid "Specify the style used to render the clone field"
msgstr "Especifique o estilo utilizado para exibir o campo de clone"
-#: pro/fields/clone.php:701
+#: pro/fields/clone.php:881
msgid "Group (displays selected fields in a group within this field)"
msgstr "Grupo (mostra os campos selecionados em um grupo dentro deste campo)"
-#: pro/fields/clone.php:702
+#: pro/fields/clone.php:882
msgid "Seamless (replaces this field with selected fields)"
msgstr "Sem bordas (substitui este campo pelos campos selecionados)"
-#: pro/fields/clone.php:710
+#: pro/fields/clone.php:890
msgid "Specify the style used to render the selected fields"
msgstr "Especifique o estilo utilizado para exibir os campos selecionados"
-#: pro/fields/clone.php:715 pro/fields/flexible-content.php:555
-#: pro/fields/repeater.php:467
+#: pro/fields/clone.php:895 pro/fields/flexible-content.php:636
+#: pro/fields/repeater.php:522
msgid "Block"
msgstr "Bloco"
-#: pro/fields/clone.php:716 pro/fields/flexible-content.php:554
-#: pro/fields/repeater.php:466
+#: pro/fields/clone.php:896 pro/fields/flexible-content.php:635
+#: pro/fields/repeater.php:521
msgid "Table"
msgstr "Tabela"
-#: pro/fields/clone.php:717 pro/fields/flexible-content.php:556
-#: pro/fields/repeater.php:468
+#: pro/fields/clone.php:897 pro/fields/flexible-content.php:637
+#: pro/fields/repeater.php:523
msgid "Row"
msgstr "Linha"
-#: pro/fields/clone.php:723
+#: pro/fields/clone.php:903
#, php-format
msgid "Labels will be displayed as %s"
msgstr "Os rótulos serão exibidos como %s"
-#: pro/fields/clone.php:726
+#: pro/fields/clone.php:906
msgid "Prefix Field Labels"
msgstr "Prefixo dos Rótulos dos Campos"
-#: pro/fields/clone.php:741
+#: pro/fields/clone.php:917
#, php-format
msgid "Values will be saved as %s"
msgstr "Valores serão salvos como %s"
-#: pro/fields/clone.php:744
+#: pro/fields/clone.php:920
msgid "Prefix Field Names"
msgstr "Prefixo dos Nomes dos Campos"
-#: pro/fields/clone.php:900
+#: pro/fields/clone.php:1038
+msgid "Unknown field"
+msgstr "Campo desconhecido"
+
+#: pro/fields/clone.php:1077
+msgid "Unknown field group"
+msgstr "Grupo de campo desconhecido"
+
+#: pro/fields/clone.php:1081
#, php-format
msgid "All fields from %s field group"
msgstr "Todos os campos do grupo de campos %s"
-#: pro/fields/flexible-content.php:36
-msgid "Flexible Content"
-msgstr "Conteúdo Flexível"
-
-#: pro/fields/flexible-content.php:42 pro/fields/repeater.php:43
+#: pro/fields/flexible-content.php:42 pro/fields/repeater.php:230
+#: pro/fields/repeater.php:534
msgid "Add Row"
msgstr "Adicionar Linha"
@@ -2695,67 +2789,67 @@ msgstr "{available} {label} {identifier} disponível (máx {max})"
msgid "{required} {label} {identifier} required (min {min})"
msgstr "{required} {label} {identifier} obrigatório (mín {min})"
-#: pro/fields/flexible-content.php:220
+#: pro/fields/flexible-content.php:54
+msgid "Flexible Content requires at least 1 layout"
+msgstr "O campo de Conteúdo Flexível requer pelo menos 1 layout"
+
+#: pro/fields/flexible-content.php:287
#, php-format
msgid "Click the \"%s\" button below to start creating your layout"
msgstr "Clique no botão “%s” abaixo para iniciar a criação do seu layout"
-#: pro/fields/flexible-content.php:350
+#: pro/fields/flexible-content.php:430
msgid "Add layout"
msgstr "Adicionar layout"
-#: pro/fields/flexible-content.php:353
+#: pro/fields/flexible-content.php:431
msgid "Remove layout"
msgstr "Remover layout"
-#: pro/fields/flexible-content.php:356 pro/fields/repeater.php:304
+#: pro/fields/flexible-content.php:432 pro/fields/repeater.php:360
msgid "Click to toggle"
msgstr "Clique para alternar"
-#: pro/fields/flexible-content.php:497
+#: pro/fields/flexible-content.php:578
msgid "Reorder Layout"
msgstr "Reordenar Layout"
-#: pro/fields/flexible-content.php:497
+#: pro/fields/flexible-content.php:578
msgid "Reorder"
msgstr "Reordenar"
-#: pro/fields/flexible-content.php:498
+#: pro/fields/flexible-content.php:579
msgid "Delete Layout"
msgstr "Excluir Layout"
-#: pro/fields/flexible-content.php:499
+#: pro/fields/flexible-content.php:580
msgid "Duplicate Layout"
msgstr "Duplicar Layout"
-#: pro/fields/flexible-content.php:500
+#: pro/fields/flexible-content.php:581
msgid "Add New Layout"
msgstr "Adicionar Novo Layout"
-#: pro/fields/flexible-content.php:571
+#: pro/fields/flexible-content.php:652
msgid "Min"
-msgstr "Mín."
+msgstr "Mín"
-#: pro/fields/flexible-content.php:584
+#: pro/fields/flexible-content.php:665
msgid "Max"
-msgstr "Máx."
+msgstr "Máx"
-#: pro/fields/flexible-content.php:612 pro/fields/repeater.php:475
+#: pro/fields/flexible-content.php:692 pro/fields/repeater.php:530
msgid "Button Label"
msgstr "Rótulo do Botão"
-#: pro/fields/flexible-content.php:621
+#: pro/fields/flexible-content.php:701
msgid "Minimum Layouts"
msgstr "Qtde. Mínima de Layouts"
-#: pro/fields/flexible-content.php:630
+#: pro/fields/flexible-content.php:710
msgid "Maximum Layouts"
msgstr "Qtde. Máxima de Layouts"
-#: pro/fields/gallery.php:36
-msgid "Gallery"
-msgstr "Galeria"
-
#: pro/fields/gallery.php:52
msgid "Add Image to Gallery"
msgstr "Adicionar Imagem à Galeria"
@@ -2828,10 +2922,6 @@ msgstr "Adicionar no final da galeria"
msgid "Prepend to the beginning"
msgstr "Adicionar no início da galeria"
-#: pro/fields/repeater.php:36
-msgid "Repeater"
-msgstr "Repetidor"
-
#: pro/fields/repeater.php:47
msgid "Minimum rows reached ({min} rows)"
msgstr "Quantidade mínima atingida ( {min} linha(s) )"
@@ -2840,34 +2930,75 @@ msgstr "Quantidade mínima atingida ( {min} linha(s) )"
msgid "Maximum rows reached ({max} rows)"
msgstr "Quantidade máxima atingida ( {max} linha(s) )"
-#: pro/fields/repeater.php:349
+#: pro/fields/repeater.php:405
msgid "Add row"
msgstr "Adicionar linha"
-#: pro/fields/repeater.php:350
+#: pro/fields/repeater.php:406
msgid "Remove row"
msgstr "Remover linha"
-#: pro/fields/repeater.php:398
+#: pro/fields/repeater.php:453
msgid "Sub Fields"
msgstr "Sub Campos"
-#: pro/fields/repeater.php:428
+#: pro/fields/repeater.php:483
msgid "Collapsed"
msgstr "Recolher"
-#: pro/fields/repeater.php:429
+#: pro/fields/repeater.php:484
msgid "Select a sub field to show when row is collapsed"
msgstr "Selecione um sub campo para exibir quando a linha estiver recolhida"
-#: pro/fields/repeater.php:439
+#: pro/fields/repeater.php:494
msgid "Minimum Rows"
msgstr "Qtde. Mínima de Linhas"
-#: pro/fields/repeater.php:449
+#: pro/fields/repeater.php:504
msgid "Maximum Rows"
msgstr "Qtde. Máxima de Linhas"
+#. Plugin URI of the plugin/theme
+msgid "https://www.advancedcustomfields.com/"
+msgstr "https://www.advancedcustomfields.com/"
+
+#. Description of the plugin/theme
+msgid "Customise WordPress with powerful, professional and intuitive fields"
+msgstr ""
+"Personalize o WordPress com campos personalizados profissionais, poderosos e "
+"intuitivos"
+
+#. Author of the plugin/theme
+msgid "Elliot Condon"
+msgstr "Elliot Condon"
+
+#. Author URI of the plugin/theme
+msgid "http://www.elliotcondon.com/"
+msgstr "http://www.elliotcondon.com/"
+
+#~ msgid "Disabled"
+#~ msgstr "Desabilitado"
+
+#~ msgid "Disabled (%s) "
+#~ msgid_plural "Disabled (%s) "
+#~ msgstr[0] "Desabilitado (%s) "
+#~ msgstr[1] "Desabilitados (%s) "
+
+#~ msgid "'How to' guides"
+#~ msgstr "Guias práticos"
+
+#~ msgid "Created by"
+#~ msgstr "Criado por"
+
+#~ msgid "Error loading update"
+#~ msgstr "Erro ao carregar atualização"
+
+#~ msgid "See what's new"
+#~ msgstr "Veja o que há de novo"
+
+#~ msgid "eg. Show extra content"
+#~ msgstr "ex.: Mostrar conteúdo adicional"
+
#~ msgid "Select"
#~ msgstr "Seleção"
@@ -2881,17 +3012,3 @@ msgstr "Qtde. Máxima de Linhas"
#~ msgid "Connection Error . Sorry, please try again"
#~ msgstr "Erro de Conexão . Tente novamente"
-
-#~ msgid "https://www.advancedcustomfields.com/"
-#~ msgstr "https://www.advancedcustomfields.com/"
-
-#~ msgid "Customise WordPress with powerful, professional and intuitive fields"
-#~ msgstr ""
-#~ "Personalize o WordPress com campos personalizados profissionais, "
-#~ "poderosos e intuitivos"
-
-#~ msgid "Elliot Condon"
-#~ msgstr "Elliot Condon"
-
-#~ msgid "http://www.elliotcondon.com/"
-#~ msgstr "http://www.elliotcondon.com/"
diff --git a/lang/acf-pt_PT.mo b/lang/acf-pt_PT.mo
index ce47eaa..3a237be 100644
Binary files a/lang/acf-pt_PT.mo and b/lang/acf-pt_PT.mo differ
diff --git a/lang/acf-pt_PT.po b/lang/acf-pt_PT.po
index 678b2cc..aa302de 100644
--- a/lang/acf-pt_PT.po
+++ b/lang/acf-pt_PT.po
@@ -4,8 +4,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Advanced Custom Fields PRO\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
-"POT-Creation-Date: 2016-11-21 14:00+0000\n"
-"PO-Revision-Date: 2016-11-25 19:36+0000\n"
+"POT-Creation-Date: 2017-05-04 12:54+0100\n"
+"PO-Revision-Date: 2017-05-04 12:54+0100\n"
"Last-Translator: Pedro Mendonça \n"
"Language-Team: Pedro Mendonça \n"
"Language: pt_PT\n"
@@ -13,7 +13,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 1.8.11\n"
+"X-Generator: Poedit 2.0.1\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
@@ -24,94 +24,94 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
-#: acf.php:60
+#: acf.php:63
msgid "Advanced Custom Fields"
msgstr "Advanced Custom Fields"
-#: acf.php:281 admin/admin.php:117
+#: acf.php:323 admin/admin.php:117
msgid "Field Groups"
msgstr "Grupos de campos"
-#: acf.php:282
+#: acf.php:324
msgid "Field Group"
msgstr "Grupo de campos"
-#: acf.php:283 acf.php:315 admin/admin.php:118
-#: pro/fields/flexible-content.php:576
+#: acf.php:325 acf.php:357 admin/admin.php:118
+#: pro/fields/flexible-content.php:580
msgid "Add New"
msgstr "Adicionar novo"
-#: acf.php:284
+#: acf.php:326
msgid "Add New Field Group"
msgstr "Adicionar novo grupo de campos"
-#: acf.php:285
+#: acf.php:327
msgid "Edit Field Group"
msgstr "Editar grupo de campos"
-#: acf.php:286
+#: acf.php:328
msgid "New Field Group"
msgstr "Novo grupo de campos"
-#: acf.php:287
+#: acf.php:329
msgid "View Field Group"
msgstr "Ver grupo de campos"
-#: acf.php:288
+#: acf.php:330
msgid "Search Field Groups"
msgstr "Pesquisar grupos de campos"
-#: acf.php:289
+#: acf.php:331
msgid "No Field Groups found"
msgstr "Nenhum grupo de campos encontrado"
-#: acf.php:290
+#: acf.php:332
msgid "No Field Groups found in Trash"
msgstr "Nenhum grupo de campos encontrado no lixo"
-#: acf.php:313 admin/field-group.php:182 admin/field-group.php:280
-#: admin/field-groups.php:510 pro/fields/clone.php:854
+#: acf.php:355 admin/field-group.php:182 admin/field-group.php:280
+#: admin/field-groups.php:510 pro/fields/clone.php:857
msgid "Fields"
msgstr "Campos"
-#: acf.php:314
+#: acf.php:356
msgid "Field"
msgstr "Campo"
-#: acf.php:316
+#: acf.php:358
msgid "Add New Field"
msgstr "Adicionar novo campo"
-#: acf.php:317
+#: acf.php:359
msgid "Edit Field"
msgstr "Editar campo"
-#: acf.php:318 admin/views/field-group-fields.php:53
+#: acf.php:360 admin/views/field-group-fields.php:51
#: admin/views/settings-info.php:111
msgid "New Field"
msgstr "Novo campo"
-#: acf.php:319
+#: acf.php:361
msgid "View Field"
msgstr "Ver campo"
-#: acf.php:320
+#: acf.php:362
msgid "Search Fields"
msgstr "Pesquisar campos"
-#: acf.php:321
+#: acf.php:363
msgid "No Fields found"
msgstr "Nenhum campo encontrado"
-#: acf.php:322
+#: acf.php:364
msgid "No Fields found in Trash"
msgstr "Nenhum campo encontrado no lixo"
-#: acf.php:361 admin/field-group.php:395 admin/field-groups.php:567
+#: acf.php:403 admin/field-group.php:395 admin/field-groups.php:567
msgid "Inactive"
msgstr "Inactivo"
-#: acf.php:366
+#: acf.php:408
#, php-format
msgid "Inactive (%s) "
msgid_plural "Inactive (%s) "
@@ -174,7 +174,7 @@ msgstr "Nenhum campo de opções disponível"
msgid "Field group title is required"
msgstr "O título do grupo de campos é obrigatório"
-#: admin/field-group.php:278 api/api-field-group.php:651
+#: admin/field-group.php:278 api/api-field-group.php:667
msgid "copy"
msgstr "cópia"
@@ -182,7 +182,7 @@ msgstr "cópia"
#: admin/views/field-group-field-conditional-logic.php:55
#: admin/views/field-group-field-conditional-logic.php:155
#: admin/views/field-group-locations.php:68
-#: admin/views/field-group-locations.php:144 api/api-helpers.php:3905
+#: admin/views/field-group-locations.php:144 api/api-helpers.php:4078
msgid "or"
msgstr "ou"
@@ -225,27 +225,27 @@ msgstr "Chaves dos campos"
msgid "Active"
msgstr "Activo"
-#: admin/field-group.php:755 admin/field-group.php:891
+#: admin/field-group.php:759 admin/field-group.php:897
msgid "Default Template"
msgstr "Modelo por omissão"
-#: admin/field-group.php:871
+#: admin/field-group.php:876
msgid "Front Page"
msgstr "Página inicial"
-#: admin/field-group.php:872
+#: admin/field-group.php:877
msgid "Posts Page"
msgstr "Página de artigos"
-#: admin/field-group.php:873
+#: admin/field-group.php:878
msgid "Top Level Page (no parent)"
msgstr "Página de topo (sem superior)"
-#: admin/field-group.php:874
+#: admin/field-group.php:879
msgid "Parent Page (has children)"
msgstr "Página superior (tem dependentes)"
-#: admin/field-group.php:875
+#: admin/field-group.php:880
msgid "Child Page (has parent)"
msgstr "Página dependente (tem superior)"
@@ -267,8 +267,8 @@ msgstr "Super Administrador"
#: admin/field-group.php:946 admin/field-group.php:954
#: admin/field-group.php:968 admin/field-group.php:975
-#: admin/field-group.php:992 admin/field-group.php:1009 fields/file.php:243
-#: fields/image.php:239 pro/fields/gallery.php:676
+#: admin/field-group.php:992 admin/field-group.php:1009 fields/file.php:240
+#: fields/image.php:237 pro/fields/gallery.php:676
msgid "All"
msgstr "Todos"
@@ -336,8 +336,7 @@ msgstr[1] "%s grupos de campos sincronizados."
msgid "Sync available"
msgstr "Sincronização disponível"
-#: admin/field-groups.php:507 api/api-template.php:1018
-#: pro/fields/gallery.php:370
+#: admin/field-groups.php:507 core/form.php:36 pro/fields/gallery.php:370
msgid "Title"
msgstr "Título"
@@ -385,7 +384,7 @@ msgstr "Funções"
msgid "Actions"
msgstr "Acções"
-#: admin/field-groups.php:620 fields/relationship.php:737
+#: admin/field-groups.php:620 fields/relationship.php:732
msgid "Filters"
msgstr "Filtros"
@@ -419,12 +418,12 @@ msgid "Duplicate this item"
msgstr "Duplicar este item"
#: admin/field-groups.php:671 admin/field-groups.php:687
-#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:575
+#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:579
msgid "Duplicate"
msgstr "Duplicar"
#: admin/field-groups.php:704 fields/google-map.php:132
-#: fields/relationship.php:742
+#: fields/relationship.php:737
msgid "Search"
msgstr "Pesquisa"
@@ -437,10 +436,18 @@ msgstr "Seleccionar %s"
msgid "Synchronise field group"
msgstr "Sincronizar grupo de campos"
-#: admin/field-groups.php:762 admin/field-groups.php:779
+#: admin/field-groups.php:762 admin/field-groups.php:792
msgid "Sync"
msgstr "Sincronizar"
+#: admin/field-groups.php:774
+msgid "Apply"
+msgstr "Aplicar"
+
+#: admin/field-groups.php:792
+msgid "Bulk Actions"
+msgstr "Acções por lotes"
+
#: admin/install-network.php:88 admin/install.php:70 admin/install.php:121
msgid "Upgrade Database"
msgstr "Actualizar base de dados"
@@ -449,11 +456,6 @@ msgstr "Actualizar base de dados"
msgid "Review sites & upgrade"
msgstr "Rever sites e actualizar"
-#: admin/install-updates.php:354
-msgid "Term meta upgrade not possible (termmeta table does not exist)"
-msgstr ""
-"Não é possível actualizar metadados de termos (a tabela termmeta não existe)"
-
#: admin/install.php:186
msgid "Error validating request"
msgstr "Erro ao validar pedido."
@@ -487,7 +489,7 @@ msgstr "Ferramentas"
msgid "No field groups selected"
msgstr "Nenhum grupo de campos seleccionado"
-#: admin/settings-tools.php:184 fields/file.php:177
+#: admin/settings-tools.php:184 fields/file.php:174
msgid "No file selected"
msgstr "Nenhum ficheiro seleccionado"
@@ -538,8 +540,8 @@ msgstr "e"
msgid "Add rule group"
msgstr "Adicionar grupo de regras"
-#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:422
-#: pro/fields/repeater.php:349
+#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:426
+#: pro/fields/repeater.php:358
msgid "Drag to reorder"
msgstr "Arraste para reordenar"
@@ -547,7 +549,7 @@ msgstr "Arraste para reordenar"
msgid "Edit field"
msgstr "Editar campo"
-#: admin/views/field-group-field.php:58 fields/image.php:142
+#: admin/views/field-group-field.php:58 fields/image.php:140
#: pro/fields/gallery.php:357
msgid "Edit"
msgstr "Editar"
@@ -568,7 +570,7 @@ msgstr "Mover"
msgid "Delete field"
msgstr "Eliminar campo"
-#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:574
+#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:578
msgid "Delete"
msgstr "Eliminar"
@@ -601,7 +603,7 @@ msgstr ""
msgid "Field Type"
msgstr "Tipo de campo"
-#: admin/views/field-group-field.php:116 fields/tab.php:103
+#: admin/views/field-group-field.php:116 fields/tab.php:102
msgid "Instructions"
msgstr "Instruções"
@@ -633,26 +635,26 @@ msgstr "id"
msgid "Close Field"
msgstr "Fechar campo"
-#: admin/views/field-group-fields.php:17
+#: admin/views/field-group-fields.php:15
msgid "Order"
msgstr "Ordem"
-#: admin/views/field-group-fields.php:18 fields/checkbox.php:312
-#: fields/radio.php:313 fields/select.php:527
-#: pro/fields/flexible-content.php:601
+#: admin/views/field-group-fields.php:16 fields/checkbox.php:312
+#: fields/radio.php:321 fields/select.php:534
+#: pro/fields/flexible-content.php:605
msgid "Label"
msgstr "Legenda"
-#: admin/views/field-group-fields.php:19 fields/taxonomy.php:966
-#: pro/fields/flexible-content.php:614
+#: admin/views/field-group-fields.php:17 fields/taxonomy.php:966
+#: pro/fields/flexible-content.php:618
msgid "Name"
msgstr "Nome"
-#: admin/views/field-group-fields.php:20
+#: admin/views/field-group-fields.php:18
msgid "Type"
msgstr "Tipo"
-#: admin/views/field-group-fields.php:26
+#: admin/views/field-group-fields.php:24
msgid ""
"No fields. Click the + Add Field button to create your "
"first field."
@@ -660,7 +662,7 @@ msgstr ""
"Nenhum campo. Clique no botão + Adicionar campo para criar "
"seu primeiro campo."
-#: admin/views/field-group-fields.php:43
+#: admin/views/field-group-fields.php:41
msgid "+ Add Field"
msgstr "+ Adicionar campo"
@@ -670,7 +672,7 @@ msgstr "+ Adicionar campo"
msgid "Post"
msgstr "Artigo"
-#: admin/views/field-group-locations.php:6 fields/relationship.php:743
+#: admin/views/field-group-locations.php:6 fields/relationship.php:738
msgid "Post Type"
msgstr "Tipo de conteúdo"
@@ -731,7 +733,7 @@ msgstr "Formulário de utilizador"
msgid "User Role"
msgstr "Papel de utilizador"
-#: admin/views/field-group-locations.php:26 pro/admin/options-page.php:49
+#: admin/views/field-group-locations.php:26 pro/admin/options-page.php:53
msgid "Forms"
msgstr "Formulários"
@@ -799,11 +801,11 @@ msgstr "Lateral"
msgid "Label placement"
msgstr "Posição da legenda"
-#: admin/views/field-group-options.php:58 fields/tab.php:117
+#: admin/views/field-group-options.php:58 fields/tab.php:116
msgid "Top aligned"
msgstr "Alinhado acima"
-#: admin/views/field-group-options.php:59 fields/tab.php:118
+#: admin/views/field-group-options.php:59 fields/tab.php:117
msgid "Left Aligned"
msgstr "Alinhado à esquerda"
@@ -888,7 +890,7 @@ msgstr "Formato"
msgid "Page Attributes"
msgstr "Atributos da página"
-#: admin/views/field-group-options.php:122 fields/relationship.php:756
+#: admin/views/field-group-options.php:122 fields/relationship.php:751
msgid "Featured Image"
msgstr "Imagem de destaque"
@@ -942,7 +944,7 @@ msgstr ""
"Actualização da base de dados concluída. Voltar ao painel da "
"rede "
-#: admin/views/install-network.php:106 admin/views/install-notice.php:35
+#: admin/views/install-network.php:106 admin/views/install-notice.php:52
msgid ""
"It is strongly recommended that you backup your database before proceeding. "
"Are you sure you wish to run the updater now?"
@@ -959,16 +961,32 @@ msgstr "Actualização concluída"
msgid "Upgrading data to version %s"
msgstr "A actualizar dados para a versão %s"
-#: admin/views/install-notice.php:23
+#: admin/views/install-notice.php:18 pro/fields/repeater.php:36
+msgid "Repeater"
+msgstr "Repetidor"
+
+#: admin/views/install-notice.php:19 pro/fields/flexible-content.php:36
+msgid "Flexible Content"
+msgstr "Conteúdo flexível"
+
+#: admin/views/install-notice.php:20 pro/fields/gallery.php:36
+msgid "Gallery"
+msgstr "Galeria"
+
+#: admin/views/install-notice.php:21 pro/admin/options-page.php:53
+msgid "Options Page"
+msgstr "Página de opções"
+
+#: admin/views/install-notice.php:36
msgid "Database Upgrade Required"
msgstr "Actualização da base de dados necessária"
-#: admin/views/install-notice.php:25
+#: admin/views/install-notice.php:38
#, php-format
msgid "Thank you for updating to %s v%s!"
msgstr "Obrigado por actualizar para o %s v%s!"
-#: admin/views/install-notice.php:25
+#: admin/views/install-notice.php:38
msgid ""
"Before you start using the new awesome features, please update your database "
"to the newest version."
@@ -976,6 +994,15 @@ msgstr ""
"Antes de começar a utilizar as incríveis novas funcionalidades, por favor "
"actualize a sua base de dados para a versão mais recente."
+#: admin/views/install-notice.php:41
+#, php-format
+msgid ""
+"Please also ensure any premium add-ons (%s) have first been updated to the "
+"latest version."
+msgstr ""
+"Por favor, em primeiro lugar certifique-se de actualizar todos os add-ons "
+"premium (%s) para a última versão."
+
#: admin/views/install.php:12
msgid "Reading upgrade tasks..."
msgstr "A ler tarefas de actualização..."
@@ -1340,109 +1367,108 @@ msgstr "Seleccionar ficheiro"
msgid "Import"
msgstr "Importar"
-#: api/api-helpers.php:880
+#: api/api-helpers.php:967
msgid "Thumbnail"
msgstr "Miniatura"
-#: api/api-helpers.php:881
+#: api/api-helpers.php:968
msgid "Medium"
msgstr "Média"
-#: api/api-helpers.php:882
+#: api/api-helpers.php:969
msgid "Large"
msgstr "Grande"
-#: api/api-helpers.php:931
+#: api/api-helpers.php:1018
msgid "Full Size"
msgstr "Tamanho original"
-#: api/api-helpers.php:1231 api/api-helpers.php:1781 pro/fields/clone.php:1037
+#: api/api-helpers.php:1359 api/api-helpers.php:1948 pro/fields/clone.php:1042
msgid "(no title)"
msgstr "(sem título)"
-#: api/api-helpers.php:1818 fields/page_link.php:284 fields/post_object.php:283
+#: api/api-helpers.php:1985 fields/page_link.php:284 fields/post_object.php:283
#: fields/taxonomy.php:988
msgid "Parent"
msgstr "Superior"
-#: api/api-helpers.php:3826
+#: api/api-helpers.php:3999
#, php-format
msgid "Image width must be at least %dpx."
msgstr "A largura da imagem deve ser pelo menos de %dpx."
-#: api/api-helpers.php:3831
+#: api/api-helpers.php:4004
#, php-format
msgid "Image width must not exceed %dpx."
msgstr "A largura da imagem não deve exceder os %dpx."
-#: api/api-helpers.php:3847
+#: api/api-helpers.php:4020
#, php-format
msgid "Image height must be at least %dpx."
msgstr "A altura da imagem deve ser pelo menos de %dpx."
-#: api/api-helpers.php:3852
+#: api/api-helpers.php:4025
#, php-format
msgid "Image height must not exceed %dpx."
msgstr "A altura da imagem não deve exceder os %dpx."
-#: api/api-helpers.php:3870
+#: api/api-helpers.php:4043
#, php-format
msgid "File size must be at least %s."
msgstr "O tamanho do ficheiro deve ser pelo menos de %s."
-#: api/api-helpers.php:3875
+#: api/api-helpers.php:4048
#, php-format
msgid "File size must must not exceed %s."
msgstr "O tamanho do ficheiro não deve exceder %s."
-#: api/api-helpers.php:3909
+#: api/api-helpers.php:4082
#, php-format
msgid "File type must be %s."
msgstr "O tipo de ficheiro deve ser %s."
-#: api/api-template.php:1027 core/field.php:327
-msgid "Content"
-msgstr "Conteúdo"
-
-#: api/api-template.php:1035
-msgid "Validate Email"
-msgstr "Validar email"
-
-#: api/api-template.php:1085
-msgid "Spam Detected"
-msgstr "Spam detectado"
-
-#: api/api-template.php:1288 pro/api/api-options-page.php:50
-#: pro/fields/gallery.php:588
-msgid "Update"
-msgstr "Actualizar"
-
-#: api/api-template.php:1289
-msgid "Post updated"
-msgstr "Artigo actualizado"
-
-#: core/field.php:326
+#: core/field.php:334
msgid "Basic"
msgstr "Básico"
-#: core/field.php:328
+#: core/field.php:335 core/form.php:45
+msgid "Content"
+msgstr "Conteúdo"
+
+#: core/field.php:336
msgid "Choice"
msgstr "Opção"
-#: core/field.php:329
+#: core/field.php:337
msgid "Relational"
msgstr "Relacional"
-#: core/field.php:330
+#: core/field.php:338
msgid "jQuery"
msgstr "jQuery"
-#: core/field.php:331 fields/checkbox.php:281 fields/radio.php:292
-#: pro/fields/clone.php:884 pro/fields/flexible-content.php:571
-#: pro/fields/flexible-content.php:620 pro/fields/repeater.php:506
+#: core/field.php:339 fields/checkbox.php:281 fields/radio.php:300
+#: pro/fields/clone.php:889 pro/fields/flexible-content.php:575
+#: pro/fields/flexible-content.php:624 pro/fields/repeater.php:514
msgid "Layout"
msgstr "Layout"
+#: core/form.php:53
+msgid "Validate Email"
+msgstr "Validar email"
+
+#: core/form.php:101 pro/api/api-options-page.php:52 pro/fields/gallery.php:588
+msgid "Update"
+msgstr "Actualizar"
+
+#: core/form.php:102
+msgid "Post updated"
+msgstr "Artigo actualizado"
+
+#: core/form.php:227
+msgid "Spam Detected"
+msgstr "Spam detectado"
+
#: core/input.php:258
msgid "Expand Details"
msgstr "Expandir detalhes"
@@ -1455,7 +1481,7 @@ msgstr "Minimizar detalhes"
msgid "Validation successful"
msgstr "Validação bem sucedida"
-#: core/input.php:261 core/validation.php:322 forms/widget.php:234
+#: core/input.php:261 core/validation.php:322 forms/widget.php:236
msgid "Validation failed"
msgstr "A validação falhou"
@@ -1472,7 +1498,7 @@ msgstr "%d campos requerem a sua atenção."
msgid "Restricted"
msgstr "Restrito"
-#: core/media.php:54 fields/select.php:265
+#: core/media.php:54 fields/select.php:274
msgctxt "verb"
msgid "Select"
msgstr "Seleccionar"
@@ -1509,20 +1535,20 @@ msgstr "Seleccionar tudo"
msgid "Add new choice"
msgstr "Adicionar nova opção"
-#: fields/checkbox.php:241 fields/radio.php:242 fields/select.php:463
+#: fields/checkbox.php:241 fields/radio.php:250 fields/select.php:470
msgid "Choices"
msgstr "Opções"
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "Enter each choice on a new line."
msgstr "Introduza cada opção numa linha separada."
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "For more control, you may specify both a value and label like this:"
msgstr ""
"Para maior controlo, pode especificar tanto os valores como as legendas:"
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "red : Red"
msgstr "vermelho : Vermelho"
@@ -1543,21 +1569,21 @@ msgid "Save 'custom' values to the field's choices"
msgstr "Guarda valores personalizados nas opções do campo"
#: fields/checkbox.php:272 fields/color_picker.php:147 fields/email.php:133
-#: fields/number.php:145 fields/radio.php:283 fields/select.php:472
+#: fields/number.php:145 fields/radio.php:291 fields/select.php:479
#: fields/text.php:142 fields/textarea.php:139 fields/true_false.php:150
-#: fields/url.php:114 fields/wysiwyg.php:440
+#: fields/url.php:114 fields/wysiwyg.php:436
msgid "Default Value"
msgstr "Valor por omissão"
-#: fields/checkbox.php:273 fields/select.php:473
+#: fields/checkbox.php:273 fields/select.php:480
msgid "Enter each default value on a new line"
msgstr "Introduza cada valor por omissão numa linha separada"
-#: fields/checkbox.php:287 fields/radio.php:298
+#: fields/checkbox.php:287 fields/radio.php:306
msgid "Vertical"
msgstr "Vertical"
-#: fields/checkbox.php:288 fields/radio.php:299
+#: fields/checkbox.php:288 fields/radio.php:307
msgid "Horizontal"
msgstr "Horizontal"
@@ -1570,21 +1596,21 @@ msgid "Prepend an extra checkbox to toggle all choices"
msgstr ""
"Preceder com caixa de selecção adicional para seleccionar todas as opções"
-#: fields/checkbox.php:305 fields/file.php:222 fields/image.php:208
-#: fields/radio.php:306 fields/taxonomy.php:835
+#: fields/checkbox.php:305 fields/file.php:219 fields/image.php:206
+#: fields/radio.php:314 fields/taxonomy.php:835
msgid "Return Value"
msgstr "Valor devolvido"
-#: fields/checkbox.php:306 fields/file.php:223 fields/image.php:209
-#: fields/radio.php:307
+#: fields/checkbox.php:306 fields/file.php:220 fields/image.php:207
+#: fields/radio.php:315
msgid "Specify the returned value on front end"
msgstr "Especifica o valor devolvido na frente do site."
-#: fields/checkbox.php:311 fields/radio.php:312 fields/select.php:526
+#: fields/checkbox.php:311 fields/radio.php:320 fields/select.php:533
msgid "Value"
msgstr "Valor"
-#: fields/checkbox.php:313 fields/radio.php:314 fields/select.php:528
+#: fields/checkbox.php:313 fields/radio.php:322 fields/select.php:535
msgid "Both (Array)"
msgstr "Ambos (Array)"
@@ -1637,36 +1663,42 @@ msgctxt "Date Picker JS weekHeader"
msgid "Wk"
msgstr "Sem"
-#: fields/date_picker.php:192 fields/date_time_picker.php:186
-#: fields/time_picker.php:126
+#: fields/date_picker.php:223 fields/date_time_picker.php:197
+#: fields/time_picker.php:127
msgid "Display Format"
msgstr "Formato de visualização"
-#: fields/date_picker.php:193 fields/date_time_picker.php:187
-#: fields/time_picker.php:127
+#: fields/date_picker.php:224 fields/date_time_picker.php:198
+#: fields/time_picker.php:128
msgid "The format displayed when editing a post"
msgstr "O formato de visualização ao editar um conteúdo"
-#: fields/date_picker.php:210
+#: fields/date_picker.php:232 fields/date_picker.php:263
+#: fields/date_time_picker.php:207 fields/date_time_picker.php:224
+#: fields/time_picker.php:135 fields/time_picker.php:150
+msgid "Custom:"
+msgstr "Personalizado:"
+
+#: fields/date_picker.php:242
msgid "Save Format"
msgstr "Formato guardado"
-#: fields/date_picker.php:211
+#: fields/date_picker.php:243
msgid "The format used when saving a value"
msgstr "O formato usado ao guardar um valor"
-#: fields/date_picker.php:221 fields/date_time_picker.php:202
-#: fields/post_object.php:447 fields/relationship.php:783 fields/select.php:521
-#: fields/time_picker.php:140
+#: fields/date_picker.php:253 fields/date_time_picker.php:214
+#: fields/post_object.php:447 fields/relationship.php:778 fields/select.php:528
+#: fields/time_picker.php:142
msgid "Return Format"
msgstr "Formato devolvido"
-#: fields/date_picker.php:222 fields/date_time_picker.php:203
-#: fields/time_picker.php:141
+#: fields/date_picker.php:254 fields/date_time_picker.php:215
+#: fields/time_picker.php:143
msgid "The format returned via template functions"
msgstr "O formato devolvido através das template functions "
-#: fields/date_picker.php:239 fields/date_time_picker.php:218
+#: fields/date_picker.php:272 fields/date_time_picker.php:231
msgid "Week Starts On"
msgstr "Semana começa em"
@@ -1753,9 +1785,9 @@ msgstr "P"
msgid "Email"
msgstr "Email"
-#: fields/email.php:134 fields/number.php:146 fields/radio.php:284
+#: fields/email.php:134 fields/number.php:146 fields/radio.php:292
#: fields/text.php:143 fields/textarea.php:140 fields/url.php:115
-#: fields/wysiwyg.php:441
+#: fields/wysiwyg.php:437
msgid "Appears when creating a new post"
msgstr "Aparece quando é criado um novo conteúdo."
@@ -1801,61 +1833,61 @@ msgstr "Editar ficheiro"
msgid "Update File"
msgstr "Actualizar ficheiro"
-#: fields/file.php:148
+#: fields/file.php:145
msgid "File name"
msgstr "Nome do ficheiro"
-#: fields/file.php:152 fields/file.php:255 fields/file.php:266
-#: fields/image.php:268 fields/image.php:297 pro/fields/gallery.php:705
+#: fields/file.php:149 fields/file.php:252 fields/file.php:263
+#: fields/image.php:266 fields/image.php:295 pro/fields/gallery.php:705
#: pro/fields/gallery.php:734
msgid "File size"
msgstr "Tamanho do ficheiro"
-#: fields/file.php:177
+#: fields/file.php:174
msgid "Add File"
msgstr "Adicionar ficheiro"
-#: fields/file.php:228
+#: fields/file.php:225
msgid "File Array"
msgstr "Ficheiro"
-#: fields/file.php:229
+#: fields/file.php:226
msgid "File URL"
msgstr "URL do ficheiro"
-#: fields/file.php:230
+#: fields/file.php:227
msgid "File ID"
msgstr "ID do ficheiro"
-#: fields/file.php:237 fields/image.php:233 pro/fields/gallery.php:670
+#: fields/file.php:234 fields/image.php:231 pro/fields/gallery.php:670
msgid "Library"
msgstr "Biblioteca"
-#: fields/file.php:238 fields/image.php:234 pro/fields/gallery.php:671
+#: fields/file.php:235 fields/image.php:232 pro/fields/gallery.php:671
msgid "Limit the media library choice"
msgstr "Limita a escolha da biblioteca de media."
-#: fields/file.php:244 fields/image.php:240 pro/fields/gallery.php:677
+#: fields/file.php:241 fields/image.php:238 pro/fields/gallery.php:677
msgid "Uploaded to post"
msgstr "Carregados no artigo"
-#: fields/file.php:251 fields/image.php:247 pro/fields/gallery.php:684
+#: fields/file.php:248 fields/image.php:245 pro/fields/gallery.php:684
msgid "Minimum"
msgstr "Mínimo"
-#: fields/file.php:252 fields/file.php:263
+#: fields/file.php:249 fields/file.php:260
msgid "Restrict which files can be uploaded"
msgstr "Restringe que ficheiros podem ser carregados."
-#: fields/file.php:262 fields/image.php:276 pro/fields/gallery.php:713
+#: fields/file.php:259 fields/image.php:274 pro/fields/gallery.php:713
msgid "Maximum"
msgstr "Máximo"
-#: fields/file.php:273 fields/image.php:305 pro/fields/gallery.php:742
+#: fields/file.php:270 fields/image.php:303 pro/fields/gallery.php:742
msgid "Allowed file types"
msgstr "Tipos de ficheiros permitidos"
-#: fields/file.php:274 fields/image.php:306 pro/fields/gallery.php:743
+#: fields/file.php:271 fields/image.php:304 pro/fields/gallery.php:743
msgid "Comma separated list. Leave blank for all types"
msgstr ""
"Lista separada por vírgulas. Deixe em branco para permitir todos os tipos."
@@ -1900,8 +1932,8 @@ msgstr "Zoom"
msgid "Set the initial zoom level"
msgstr "Definir o nível de zoom inicial"
-#: fields/google-map.php:200 fields/image.php:259 fields/image.php:288
-#: fields/oembed.php:270 pro/fields/gallery.php:696 pro/fields/gallery.php:725
+#: fields/google-map.php:200 fields/image.php:257 fields/image.php:286
+#: fields/oembed.php:297 pro/fields/gallery.php:696 pro/fields/gallery.php:725
msgid "Height"
msgstr "Altura"
@@ -1929,77 +1961,77 @@ msgstr "Actualizar imagem"
msgid "All images"
msgstr "Todas as imagens"
-#: fields/image.php:144 pro/fields/gallery.php:358 pro/fields/gallery.php:546
+#: fields/image.php:142 pro/fields/gallery.php:358 pro/fields/gallery.php:546
msgid "Remove"
msgstr "Remover"
-#: fields/image.php:160
+#: fields/image.php:158
msgid "No image selected"
msgstr "Nenhuma imagem seleccionada"
-#: fields/image.php:160
+#: fields/image.php:158
msgid "Add Image"
msgstr "Adicionar imagem"
-#: fields/image.php:214
+#: fields/image.php:212
msgid "Image Array"
msgstr "Imagem"
-#: fields/image.php:215
+#: fields/image.php:213
msgid "Image URL"
msgstr "URL da imagem"
-#: fields/image.php:216
+#: fields/image.php:214
msgid "Image ID"
msgstr "ID da imagem"
-#: fields/image.php:223
+#: fields/image.php:221
msgid "Preview Size"
msgstr "Tamanho da pré-visualização"
-#: fields/image.php:224
+#: fields/image.php:222
msgid "Shown when entering data"
msgstr "Mostrado ao introduzir dados"
-#: fields/image.php:248 fields/image.php:277 pro/fields/gallery.php:685
+#: fields/image.php:246 fields/image.php:275 pro/fields/gallery.php:685
#: pro/fields/gallery.php:714
msgid "Restrict which images can be uploaded"
msgstr "Restringir que imagens que ser carregadas"
-#: fields/image.php:251 fields/image.php:280 fields/oembed.php:259
+#: fields/image.php:249 fields/image.php:278 fields/oembed.php:286
#: pro/fields/gallery.php:688 pro/fields/gallery.php:717
msgid "Width"
msgstr "Largura"
-#: fields/message.php:36 fields/message.php:116 fields/true_false.php:141
+#: fields/message.php:36 fields/message.php:115 fields/true_false.php:141
msgid "Message"
msgstr "Mensagem"
-#: fields/message.php:125 fields/textarea.php:176
+#: fields/message.php:124 fields/textarea.php:176
msgid "New Lines"
msgstr "Novas linhas"
-#: fields/message.php:126 fields/textarea.php:177
+#: fields/message.php:125 fields/textarea.php:177
msgid "Controls how new lines are rendered"
msgstr "Controla como serão visualizadas novas linhas."
-#: fields/message.php:130 fields/textarea.php:181
+#: fields/message.php:129 fields/textarea.php:181
msgid "Automatically add paragraphs"
msgstr "Adicionar parágrafos automaticamente"
-#: fields/message.php:131 fields/textarea.php:182
+#: fields/message.php:130 fields/textarea.php:182
msgid "Automatically add <br>"
msgstr "Adicionar <br> automaticamente"
-#: fields/message.php:132 fields/textarea.php:183
+#: fields/message.php:131 fields/textarea.php:183
msgid "No Formatting"
msgstr "Sem formatação"
-#: fields/message.php:139
+#: fields/message.php:138
msgid "Escape HTML"
msgstr "Mostrar HTML"
-#: fields/message.php:140
+#: fields/message.php:139
msgid "Allow HTML markup to display as visible text instead of rendering"
msgstr ""
"Permite visualizar o código HTML como texto visível, em vez de o processar."
@@ -2038,19 +2070,19 @@ msgstr "O valor deve ser igual ou inferior a %d"
msgid "oEmbed"
msgstr "oEmbed"
-#: fields/oembed.php:207
+#: fields/oembed.php:237
msgid "Enter URL"
msgstr "Introduza o URL"
-#: fields/oembed.php:220 fields/taxonomy.php:900
+#: fields/oembed.php:250 fields/taxonomy.php:900
msgid "Error."
msgstr "Erro."
-#: fields/oembed.php:220
+#: fields/oembed.php:250
msgid "No embed found for the given URL."
msgstr "Nenhuma incorporação encontrada para o URL introduzido."
-#: fields/oembed.php:256 fields/oembed.php:267
+#: fields/oembed.php:283 fields/oembed.php:294
msgid "Embed Size"
msgstr "Tamanho da incorporação"
@@ -2059,27 +2091,27 @@ msgid "Archives"
msgstr "Arquivo"
#: fields/page_link.php:500 fields/post_object.php:399
-#: fields/relationship.php:709
+#: fields/relationship.php:704
msgid "Filter by Post Type"
msgstr "Filtrar por tipo de conteúdo"
#: fields/page_link.php:508 fields/post_object.php:407
-#: fields/relationship.php:717
+#: fields/relationship.php:712
msgid "All post types"
msgstr "Todos os tipos de conteúdo"
#: fields/page_link.php:514 fields/post_object.php:413
-#: fields/relationship.php:723
+#: fields/relationship.php:718
msgid "Filter by Taxonomy"
msgstr "Filtrar por taxonomia"
#: fields/page_link.php:522 fields/post_object.php:421
-#: fields/relationship.php:731
+#: fields/relationship.php:726
msgid "All taxonomies"
msgstr "Todas as taxonomias"
-#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:251
-#: fields/select.php:481 fields/taxonomy.php:795 fields/user.php:394
+#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:259
+#: fields/select.php:488 fields/taxonomy.php:795 fields/user.php:423
msgid "Allow Null?"
msgstr "Permitir nulo?"
@@ -2087,8 +2119,8 @@ msgstr "Permitir nulo?"
msgid "Allow Archives URLs"
msgstr "Permitir URL do arquivo"
-#: fields/page_link.php:548 fields/post_object.php:437 fields/select.php:491
-#: fields/user.php:404
+#: fields/page_link.php:548 fields/post_object.php:437 fields/select.php:498
+#: fields/user.php:433
msgid "Select multiple values?"
msgstr "Seleccionar valores múltiplos?"
@@ -2097,11 +2129,11 @@ msgid "Password"
msgstr "Senha"
#: fields/post_object.php:36 fields/post_object.php:452
-#: fields/relationship.php:788
+#: fields/relationship.php:783
msgid "Post Object"
msgstr "Conteúdo"
-#: fields/post_object.php:453 fields/relationship.php:789
+#: fields/post_object.php:453 fields/relationship.php:784
msgid "Post ID"
msgstr "ID do conteúdo"
@@ -2109,20 +2141,20 @@ msgstr "ID do conteúdo"
msgid "Radio Button"
msgstr "Botão de opção"
-#: fields/radio.php:261
+#: fields/radio.php:269
msgid "Other"
msgstr "Outro"
-#: fields/radio.php:266
+#: fields/radio.php:274
msgid "Add 'other' choice to allow for custom values"
msgstr ""
"Adicionar opção 'outros' para permitir a introdução de valores personalizados"
-#: fields/radio.php:272
+#: fields/radio.php:280
msgid "Save Other"
msgstr "Guardar outros"
-#: fields/radio.php:277
+#: fields/radio.php:285
msgid "Save 'other' values to the field's choices"
msgstr "Guardar 'outros' valores nas opções do campo"
@@ -2146,39 +2178,39 @@ msgstr "A carregar"
msgid "No matches found"
msgstr "Nenhuma correspondência encontrada"
-#: fields/relationship.php:590
+#: fields/relationship.php:585
msgid "Search..."
msgstr "Pesquisar..."
-#: fields/relationship.php:599
+#: fields/relationship.php:594
msgid "Select post type"
msgstr "Seleccione tipo de conteúdo"
-#: fields/relationship.php:612
+#: fields/relationship.php:607
msgid "Select taxonomy"
msgstr "Seleccione taxonomia"
-#: fields/relationship.php:744 fields/taxonomy.php:36 fields/taxonomy.php:765
+#: fields/relationship.php:739 fields/taxonomy.php:36 fields/taxonomy.php:765
msgid "Taxonomy"
msgstr "Taxonomia"
-#: fields/relationship.php:751
+#: fields/relationship.php:746
msgid "Elements"
msgstr "Elementos"
-#: fields/relationship.php:752
+#: fields/relationship.php:747
msgid "Selected elements will be displayed in each result"
msgstr "Os elementos seleccionados serão mostrados em cada resultado."
-#: fields/relationship.php:763
+#: fields/relationship.php:758
msgid "Minimum posts"
msgstr "Mínimo de conteúdos"
-#: fields/relationship.php:772
+#: fields/relationship.php:767
msgid "Maximum posts"
msgstr "Máximo de conteúdos"
-#: fields/relationship.php:876 pro/fields/gallery.php:815
+#: fields/relationship.php:871 pro/fields/gallery.php:815
#, php-format
msgid "%s requires at least %s selection"
msgid_plural "%s requires at least %s selections"
@@ -2255,15 +2287,15 @@ msgctxt "Select2 JS load_fail"
msgid "Loading failed"
msgstr "Falhou ao carregar"
-#: fields/select.php:501 fields/true_false.php:159
+#: fields/select.php:508 fields/true_false.php:159
msgid "Stylised UI"
msgstr "Interface estilizada"
-#: fields/select.php:511
+#: fields/select.php:518
msgid "Use AJAX to lazy load choices?"
msgstr "Utilizar AJAX para carregar opções?"
-#: fields/select.php:522
+#: fields/select.php:529
msgid "Specify the value returned"
msgstr "Especifica o valor devolvido."
@@ -2271,7 +2303,7 @@ msgstr "Especifica o valor devolvido."
msgid "Tab"
msgstr "Separador"
-#: fields/tab.php:97
+#: fields/tab.php:96
msgid ""
"The tab field will display incorrectly when added to a Table style repeater "
"field or flexible content field layout"
@@ -2279,7 +2311,7 @@ msgstr ""
"O campo separador será mostrado incorrectamente quando adicionado a um campo "
"repetidor ou layout de conteúdo flexível, com estilo de tabela."
-#: fields/tab.php:98
+#: fields/tab.php:97
msgid ""
"Use \"Tab Fields\" to better organize your edit screen by grouping fields "
"together."
@@ -2287,7 +2319,7 @@ msgstr ""
"Utilize \"campos separadores\" para melhor organizar o ecrã de edição, "
"através de agrupar campos em conjuntos."
-#: fields/tab.php:99
+#: fields/tab.php:98
msgid ""
"All fields following this \"tab field\" (or until another \"tab field\" is "
"defined) will be grouped together using this field's label as the tab "
@@ -2295,17 +2327,17 @@ msgid ""
msgstr ""
"Todos os campos a seguir a este \"campo separador\" (ou até que esteja "
"definido outro \"campo separador\") serão agrupados em conjunto utilizando a "
-"legenda deste campo como cabeçalho do separador."
+"legenda deste campo como título do separador."
-#: fields/tab.php:113
+#: fields/tab.php:112
msgid "Placement"
msgstr "Posição"
-#: fields/tab.php:125
+#: fields/tab.php:124
msgid "End-point"
msgstr "Interrupção"
-#: fields/tab.php:126
+#: fields/tab.php:125
msgid "Use this field as an end-point and start a new group of tabs"
msgstr ""
"Utilize este campo para interromper e começar um novo grupo de separadores."
@@ -2463,11 +2495,11 @@ msgstr "URL"
msgid "Value must be a valid URL"
msgstr "O valor deve ser um URL válido"
-#: fields/user.php:379
+#: fields/user.php:408
msgid "Filter by role"
msgstr "Filtrar por papel"
-#: fields/user.php:387
+#: fields/user.php:416
msgid "All user roles"
msgstr "Todos os papéis de utilizador"
@@ -2475,56 +2507,56 @@ msgstr "Todos os papéis de utilizador"
msgid "Wysiwyg Editor"
msgstr "Editor wysiwyg"
-#: fields/wysiwyg.php:389
+#: fields/wysiwyg.php:385
msgid "Visual"
msgstr "Visual"
-#: fields/wysiwyg.php:390
+#: fields/wysiwyg.php:386
msgctxt "Name for the Text editor tab (formerly HTML)"
msgid "Text"
msgstr "HTML"
-#: fields/wysiwyg.php:396
+#: fields/wysiwyg.php:392
msgid "Click to initialize TinyMCE"
msgstr "Clique para inicializar o TinyMCE"
-#: fields/wysiwyg.php:449
+#: fields/wysiwyg.php:445
msgid "Tabs"
msgstr "Separadores"
-#: fields/wysiwyg.php:454
+#: fields/wysiwyg.php:450
msgid "Visual & Text"
msgstr "Visual e HTML"
-#: fields/wysiwyg.php:455
+#: fields/wysiwyg.php:451
msgid "Visual Only"
msgstr "Apenas visual"
-#: fields/wysiwyg.php:456
+#: fields/wysiwyg.php:452
msgid "Text Only"
msgstr "Apenas HTML"
-#: fields/wysiwyg.php:463
+#: fields/wysiwyg.php:459
msgid "Toolbar"
msgstr "Barra de ferramentas"
-#: fields/wysiwyg.php:473
+#: fields/wysiwyg.php:469
msgid "Show Media Upload Buttons?"
msgstr "Mostrar botões de carregar multimédia?"
-#: fields/wysiwyg.php:483
+#: fields/wysiwyg.php:479
msgid "Delay initialization?"
msgstr "Atrasar a inicialização?"
-#: fields/wysiwyg.php:484
+#: fields/wysiwyg.php:480
msgid "TinyMCE will not be initalized until field is clicked"
msgstr "O TinyMCE não será inicializado até que clique no campo"
-#: forms/comment.php:166 forms/post.php:295 pro/admin/options-page.php:416
+#: forms/comment.php:166 forms/post.php:303 pro/admin/options-page.php:421
msgid "Edit field group"
msgstr "Editar grupo de campos"
-#: forms/widget.php:235
+#: forms/widget.php:237
#, php-format
msgid "1 field requires attention."
msgid_plural "%d fields require attention."
@@ -2532,31 +2564,23 @@ msgstr[0] "1 campo requer a sua atenção."
msgstr[1] "%d campos requerem a sua atenção."
#. Plugin Name of the plugin/theme
-#: pro/acf-pro.php:24
+#: pro/acf-pro.php:28
msgid "Advanced Custom Fields PRO"
msgstr "Advanced Custom Fields PRO"
-#: pro/acf-pro.php:192
-msgid "Flexible Content requires at least 1 layout"
-msgstr "O conteúdo flexível requer pelo menos 1 layout"
-
-#: pro/admin/options-page.php:49
-msgid "Options Page"
-msgstr "Página de opções"
-
-#: pro/admin/options-page.php:85
+#: pro/admin/options-page.php:89
msgid "No options pages exist"
msgstr "Não existem páginas de opções"
-#: pro/admin/options-page.php:303
+#: pro/admin/options-page.php:307
msgid "Options Updated"
msgstr "Opções actualizadas"
-#: pro/admin/options-page.php:309
+#: pro/admin/options-page.php:313
msgid "Publish"
msgstr "Publicado"
-#: pro/admin/options-page.php:315
+#: pro/admin/options-page.php:319
#, php-format
msgid ""
"No Custom Field Groups found for this options page. Create a "
@@ -2565,14 +2589,14 @@ msgstr ""
"Nenhum grupo de campos personalizado encontrado na página de opções. Criar um grupo de campos personalizado "
-#: pro/admin/settings-updates.php:57 pro/admin/views/settings-updates.php:17
-msgid "Updates"
-msgstr "Actualizações"
-
-#: pro/admin/settings-updates.php:87
+#: pro/admin/settings-updates.php:78
msgid "Error . Could not connect to update server"
msgstr "Erro . Não foi possível ligar ao servidor de actualização."
+#: pro/admin/settings-updates.php:162 pro/admin/views/settings-updates.php:17
+msgid "Updates"
+msgstr "Actualizações"
+
#: pro/admin/views/settings-updates.php:11
msgid "Deactivate License"
msgstr "Desactivar licença"
@@ -2634,19 +2658,11 @@ msgstr "Verificar de novo"
msgid "Upgrade Notice"
msgstr "Aviso de actualização"
-#: pro/api/api-options-page.php:22 pro/api/api-options-page.php:23
+#: pro/api/api-options-page.php:24 pro/api/api-options-page.php:25
msgid "Options"
msgstr "Opções"
-#: pro/api/api-pro.php:330
-msgid ""
-"Error validating ACF PRO license URL (website does not match). Please re-"
-"activate your license"
-msgstr ""
-"Erro ao validar o URL da licença do ACF PRO (o site não corresponde). Por "
-"favor reactive a sua licença."
-
-#: pro/core/updates.php:206
+#: pro/core/updates.php:97
#, php-format
msgid ""
"To enable updates, please enter your license key on the \n"
"Language-Team: Elliot Condon \n"
@@ -22,94 +22,94 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
-#: acf.php:60
+#: acf.php:63
msgid "Advanced Custom Fields"
msgstr ""
-#: acf.php:281 admin/admin.php:117
+#: acf.php:323 admin/admin.php:117
msgid "Field Groups"
msgstr ""
-#: acf.php:282
+#: acf.php:324
msgid "Field Group"
msgstr ""
-#: acf.php:283 acf.php:315 admin/admin.php:118
-#: pro/fields/flexible-content.php:576
+#: acf.php:325 acf.php:357 admin/admin.php:118
+#: pro/fields/flexible-content.php:580
msgid "Add New"
msgstr ""
-#: acf.php:284
+#: acf.php:326
msgid "Add New Field Group"
msgstr ""
-#: acf.php:285
+#: acf.php:327
msgid "Edit Field Group"
msgstr ""
-#: acf.php:286
+#: acf.php:328
msgid "New Field Group"
msgstr ""
-#: acf.php:287
+#: acf.php:329
msgid "View Field Group"
msgstr ""
-#: acf.php:288
+#: acf.php:330
msgid "Search Field Groups"
msgstr ""
-#: acf.php:289
+#: acf.php:331
msgid "No Field Groups found"
msgstr ""
-#: acf.php:290
+#: acf.php:332
msgid "No Field Groups found in Trash"
msgstr ""
-#: acf.php:313 admin/field-group.php:182 admin/field-group.php:280
-#: admin/field-groups.php:510 pro/fields/clone.php:819
+#: acf.php:355 admin/field-group.php:182 admin/field-group.php:280
+#: admin/field-groups.php:510 pro/fields/clone.php:857
msgid "Fields"
msgstr ""
-#: acf.php:314
+#: acf.php:356
msgid "Field"
msgstr ""
-#: acf.php:316
+#: acf.php:358
msgid "Add New Field"
msgstr ""
-#: acf.php:317
+#: acf.php:359
msgid "Edit Field"
msgstr ""
-#: acf.php:318 admin/views/field-group-fields.php:53
+#: acf.php:360 admin/views/field-group-fields.php:51
#: admin/views/settings-info.php:111
msgid "New Field"
msgstr ""
-#: acf.php:319
+#: acf.php:361
msgid "View Field"
msgstr ""
-#: acf.php:320
+#: acf.php:362
msgid "Search Fields"
msgstr ""
-#: acf.php:321
+#: acf.php:363
msgid "No Fields found"
msgstr ""
-#: acf.php:322
+#: acf.php:364
msgid "No Fields found in Trash"
msgstr ""
-#: acf.php:361 admin/field-group.php:395 admin/field-groups.php:567
+#: acf.php:403 admin/field-group.php:395 admin/field-groups.php:567
msgid "Inactive"
msgstr ""
-#: acf.php:366
+#: acf.php:408
#, php-format
msgid "Inactive (%s) "
msgid_plural "Inactive (%s) "
@@ -172,15 +172,15 @@ msgstr ""
msgid "Field group title is required"
msgstr ""
-#: admin/field-group.php:278 api/api-field-group.php:651
+#: admin/field-group.php:278 api/api-field-group.php:667
msgid "copy"
msgstr ""
#: admin/field-group.php:279
#: admin/views/field-group-field-conditional-logic.php:55
#: admin/views/field-group-field-conditional-logic.php:155
-#: admin/views/field-group-locations.php:59
-#: admin/views/field-group-locations.php:135 api/api-helpers.php:3863
+#: admin/views/field-group-locations.php:68
+#: admin/views/field-group-locations.php:144 api/api-helpers.php:4078
msgid "or"
msgstr ""
@@ -220,79 +220,79 @@ msgstr ""
msgid "Active"
msgstr ""
-#: admin/field-group.php:846
-msgid "Front Page"
-msgstr ""
-
-#: admin/field-group.php:847
-msgid "Posts Page"
-msgstr ""
-
-#: admin/field-group.php:848
-msgid "Top Level Page (no parent)"
-msgstr ""
-
-#: admin/field-group.php:849
-msgid "Parent Page (has children)"
-msgstr ""
-
-#: admin/field-group.php:850
-msgid "Child Page (has parent)"
-msgstr ""
-
-#: admin/field-group.php:866
+#: admin/field-group.php:759 admin/field-group.php:897
msgid "Default Template"
msgstr ""
-#: admin/field-group.php:889
+#: admin/field-group.php:876
+msgid "Front Page"
+msgstr ""
+
+#: admin/field-group.php:877
+msgid "Posts Page"
+msgstr ""
+
+#: admin/field-group.php:878
+msgid "Top Level Page (no parent)"
+msgstr ""
+
+#: admin/field-group.php:879
+msgid "Parent Page (has children)"
+msgstr ""
+
+#: admin/field-group.php:880
+msgid "Child Page (has parent)"
+msgstr ""
+
+#: admin/field-group.php:914
msgid "Logged in"
msgstr ""
-#: admin/field-group.php:890
+#: admin/field-group.php:915
msgid "Viewing front end"
msgstr ""
-#: admin/field-group.php:891
+#: admin/field-group.php:916
msgid "Viewing back end"
msgstr ""
-#: admin/field-group.php:910
+#: admin/field-group.php:935
msgid "Super Admin"
msgstr ""
-#: admin/field-group.php:921 admin/field-group.php:929
-#: admin/field-group.php:943 admin/field-group.php:950
-#: admin/field-group.php:967 admin/field-group.php:984 fields/file.php:243
-#: fields/image.php:239 pro/fields/gallery.php:676
+#: admin/field-group.php:946 admin/field-group.php:954
+#: admin/field-group.php:968 admin/field-group.php:975
+#: admin/field-group.php:992 admin/field-group.php:1009 fields/file.php:240
+#: fields/image.php:237 pro/fields/gallery.php:676
msgid "All"
msgstr ""
-#: admin/field-group.php:930
+#: admin/field-group.php:955
msgid "Add / Edit"
msgstr ""
-#: admin/field-group.php:931
+#: admin/field-group.php:956
msgid "Register"
msgstr ""
-#: admin/field-group.php:1168
+#: admin/field-group.php:1193
msgid "Move Complete."
msgstr ""
-#: admin/field-group.php:1169
+#: admin/field-group.php:1194
#, php-format
msgid "The %s field can now be found in the %s field group"
msgstr ""
-#: admin/field-group.php:1171
+#: admin/field-group.php:1196
msgid "Close Window"
msgstr ""
-#: admin/field-group.php:1213
+#: admin/field-group.php:1238
msgid "Please select the destination for this field"
msgstr ""
-#: admin/field-group.php:1220
+#: admin/field-group.php:1245
msgid "Move Field"
msgstr ""
@@ -331,8 +331,7 @@ msgstr[1] ""
msgid "Sync available"
msgstr ""
-#: admin/field-groups.php:507 api/api-template.php:1018
-#: pro/fields/gallery.php:370
+#: admin/field-groups.php:507 core/form.php:36 pro/fields/gallery.php:370
msgid "Title"
msgstr ""
@@ -380,7 +379,7 @@ msgstr ""
msgid "Actions"
msgstr ""
-#: admin/field-groups.php:620 fields/relationship.php:737
+#: admin/field-groups.php:620 fields/relationship.php:732
msgid "Filters"
msgstr ""
@@ -414,12 +413,12 @@ msgid "Duplicate this item"
msgstr ""
#: admin/field-groups.php:671 admin/field-groups.php:687
-#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:575
+#: admin/views/field-group-field.php:59 pro/fields/flexible-content.php:579
msgid "Duplicate"
msgstr ""
#: admin/field-groups.php:704 fields/google-map.php:132
-#: fields/relationship.php:742
+#: fields/relationship.php:737
msgid "Search"
msgstr ""
@@ -432,10 +431,18 @@ msgstr ""
msgid "Synchronise field group"
msgstr ""
-#: admin/field-groups.php:762 admin/field-groups.php:779
+#: admin/field-groups.php:762 admin/field-groups.php:792
msgid "Sync"
msgstr ""
+#: admin/field-groups.php:774
+msgid "Apply"
+msgstr ""
+
+#: admin/field-groups.php:792
+msgid "Bulk Actions"
+msgstr ""
+
#: admin/install-network.php:88 admin/install.php:70 admin/install.php:121
msgid "Upgrade Database"
msgstr ""
@@ -444,10 +451,6 @@ msgstr ""
msgid "Review sites & upgrade"
msgstr ""
-#: admin/install-updates.php:354
-msgid "Term meta upgrade not possible (termmeta table does not exist)"
-msgstr ""
-
#: admin/install.php:186
msgid "Error validating request"
msgstr ""
@@ -481,7 +484,7 @@ msgstr ""
msgid "No field groups selected"
msgstr ""
-#: admin/settings-tools.php:184 fields/file.php:177
+#: admin/settings-tools.php:184 fields/file.php:174
msgid "No file selected"
msgstr ""
@@ -513,27 +516,27 @@ msgid "Show this field if"
msgstr ""
#: admin/views/field-group-field-conditional-logic.php:104
-#: admin/views/field-group-locations.php:34
+#: admin/views/field-group-locations.php:43
msgid "is equal to"
msgstr ""
#: admin/views/field-group-field-conditional-logic.php:105
-#: admin/views/field-group-locations.php:35
+#: admin/views/field-group-locations.php:44
msgid "is not equal to"
msgstr ""
#: admin/views/field-group-field-conditional-logic.php:142
-#: admin/views/field-group-locations.php:122
+#: admin/views/field-group-locations.php:131
msgid "and"
msgstr ""
#: admin/views/field-group-field-conditional-logic.php:157
-#: admin/views/field-group-locations.php:137
+#: admin/views/field-group-locations.php:146
msgid "Add rule group"
msgstr ""
-#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:422
-#: pro/fields/repeater.php:349
+#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:426
+#: pro/fields/repeater.php:358
msgid "Drag to reorder"
msgstr ""
@@ -541,7 +544,7 @@ msgstr ""
msgid "Edit field"
msgstr ""
-#: admin/views/field-group-field.php:58 fields/image.php:142
+#: admin/views/field-group-field.php:58 fields/image.php:140
#: pro/fields/gallery.php:357
msgid "Edit"
msgstr ""
@@ -562,7 +565,7 @@ msgstr ""
msgid "Delete field"
msgstr ""
-#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:574
+#: admin/views/field-group-field.php:61 pro/fields/flexible-content.php:578
msgid "Delete"
msgstr ""
@@ -582,172 +585,177 @@ msgstr ""
msgid "This is the name which will appear on the EDIT page"
msgstr ""
-#: admin/views/field-group-field.php:95
+#: admin/views/field-group-field.php:93
msgid "Field Name"
msgstr ""
-#: admin/views/field-group-field.php:96
+#: admin/views/field-group-field.php:94
msgid "Single word, no spaces. Underscores and dashes allowed"
msgstr ""
-#: admin/views/field-group-field.php:108
+#: admin/views/field-group-field.php:104
msgid "Field Type"
msgstr ""
-#: admin/views/field-group-field.php:122 fields/tab.php:103
+#: admin/views/field-group-field.php:116 fields/tab.php:102
msgid "Instructions"
msgstr ""
-#: admin/views/field-group-field.php:123
+#: admin/views/field-group-field.php:117
msgid "Instructions for authors. Shown when submitting data"
msgstr ""
-#: admin/views/field-group-field.php:134
+#: admin/views/field-group-field.php:126
msgid "Required?"
msgstr ""
-#: admin/views/field-group-field.php:159
+#: admin/views/field-group-field.php:149
msgid "Wrapper Attributes"
msgstr ""
-#: admin/views/field-group-field.php:165
+#: admin/views/field-group-field.php:155
msgid "width"
msgstr ""
-#: admin/views/field-group-field.php:179
+#: admin/views/field-group-field.php:170
msgid "class"
msgstr ""
-#: admin/views/field-group-field.php:192
+#: admin/views/field-group-field.php:183
msgid "id"
msgstr ""
-#: admin/views/field-group-field.php:204
+#: admin/views/field-group-field.php:195
msgid "Close Field"
msgstr ""
-#: admin/views/field-group-fields.php:17
+#: admin/views/field-group-fields.php:15
msgid "Order"
msgstr ""
-#: admin/views/field-group-fields.php:18 fields/checkbox.php:312
-#: fields/radio.php:313 fields/select.php:528
-#: pro/fields/flexible-content.php:601
+#: admin/views/field-group-fields.php:16 fields/checkbox.php:312
+#: fields/radio.php:321 fields/select.php:534
+#: pro/fields/flexible-content.php:605
msgid "Label"
msgstr ""
-#: admin/views/field-group-fields.php:19 fields/taxonomy.php:966
-#: pro/fields/flexible-content.php:614
+#: admin/views/field-group-fields.php:17 fields/taxonomy.php:966
+#: pro/fields/flexible-content.php:618
msgid "Name"
msgstr ""
-#: admin/views/field-group-fields.php:20
+#: admin/views/field-group-fields.php:18
msgid "Type"
msgstr ""
-#: admin/views/field-group-fields.php:26
+#: admin/views/field-group-fields.php:24
msgid ""
"No fields. Click the + Add Field button to create your "
"first field."
msgstr ""
-#: admin/views/field-group-fields.php:43
+#: admin/views/field-group-fields.php:41
msgid "+ Add Field"
msgstr ""
#: admin/views/field-group-locations.php:5
-#: admin/views/field-group-locations.php:11
+#: admin/views/field-group-locations.php:12
+#: admin/views/field-group-locations.php:38
msgid "Post"
msgstr ""
-#: admin/views/field-group-locations.php:6 fields/relationship.php:743
+#: admin/views/field-group-locations.php:6 fields/relationship.php:738
msgid "Post Type"
msgstr ""
#: admin/views/field-group-locations.php:7
-msgid "Post Status"
+msgid "Post Template"
msgstr ""
#: admin/views/field-group-locations.php:8
-msgid "Post Format"
+msgid "Post Status"
msgstr ""
#: admin/views/field-group-locations.php:9
-msgid "Post Category"
+msgid "Post Format"
msgstr ""
#: admin/views/field-group-locations.php:10
+msgid "Post Category"
+msgstr ""
+
+#: admin/views/field-group-locations.php:11
msgid "Post Taxonomy"
msgstr ""
-#: admin/views/field-group-locations.php:13
-#: admin/views/field-group-locations.php:17
+#: admin/views/field-group-locations.php:14
+#: admin/views/field-group-locations.php:18
msgid "Page"
msgstr ""
-#: admin/views/field-group-locations.php:14
+#: admin/views/field-group-locations.php:15
msgid "Page Template"
msgstr ""
-#: admin/views/field-group-locations.php:15
+#: admin/views/field-group-locations.php:16
msgid "Page Type"
msgstr ""
-#: admin/views/field-group-locations.php:16
+#: admin/views/field-group-locations.php:17
msgid "Page Parent"
msgstr ""
-#: admin/views/field-group-locations.php:19 fields/user.php:36
+#: admin/views/field-group-locations.php:20 fields/user.php:36
msgid "User"
msgstr ""
-#: admin/views/field-group-locations.php:20
+#: admin/views/field-group-locations.php:21
msgid "Current User"
msgstr ""
-#: admin/views/field-group-locations.php:21
+#: admin/views/field-group-locations.php:22
msgid "Current User Role"
msgstr ""
-#: admin/views/field-group-locations.php:22
+#: admin/views/field-group-locations.php:23
msgid "User Form"
msgstr ""
-#: admin/views/field-group-locations.php:23
+#: admin/views/field-group-locations.php:24
msgid "User Role"
msgstr ""
-#: admin/views/field-group-locations.php:25 pro/admin/options-page.php:49
+#: admin/views/field-group-locations.php:26 pro/admin/options-page.php:53
msgid "Forms"
msgstr ""
-#: admin/views/field-group-locations.php:26
+#: admin/views/field-group-locations.php:27
msgid "Attachment"
msgstr ""
-#: admin/views/field-group-locations.php:27
+#: admin/views/field-group-locations.php:28
msgid "Taxonomy Term"
msgstr ""
-#: admin/views/field-group-locations.php:28
+#: admin/views/field-group-locations.php:29
msgid "Comment"
msgstr ""
-#: admin/views/field-group-locations.php:29
+#: admin/views/field-group-locations.php:30
msgid "Widget"
msgstr ""
-#: admin/views/field-group-locations.php:41
+#: admin/views/field-group-locations.php:50
msgid "Rules"
msgstr ""
-#: admin/views/field-group-locations.php:42
+#: admin/views/field-group-locations.php:51
msgid ""
"Create a set of rules to determine which edit screens will use these "
"advanced custom fields"
msgstr ""
-#: admin/views/field-group-locations.php:59
+#: admin/views/field-group-locations.php:68
msgid "Show this field group if"
msgstr ""
@@ -783,11 +791,11 @@ msgstr ""
msgid "Label placement"
msgstr ""
-#: admin/views/field-group-options.php:58 fields/tab.php:117
+#: admin/views/field-group-options.php:58 fields/tab.php:116
msgid "Top aligned"
msgstr ""
-#: admin/views/field-group-options.php:59 fields/tab.php:118
+#: admin/views/field-group-options.php:59 fields/tab.php:117
msgid "Left Aligned"
msgstr ""
@@ -869,7 +877,7 @@ msgstr ""
msgid "Page Attributes"
msgstr ""
-#: admin/views/field-group-options.php:122 fields/relationship.php:756
+#: admin/views/field-group-options.php:122 fields/relationship.php:751
msgid "Featured Image"
msgstr ""
@@ -919,7 +927,7 @@ msgid ""
"Database Upgrade complete. Return to network dashboard "
msgstr ""
-#: admin/views/install-network.php:106 admin/views/install-notice.php:35
+#: admin/views/install-network.php:106 admin/views/install-notice.php:52
msgid ""
"It is strongly recommended that you backup your database before proceeding. "
"Are you sure you wish to run the updater now?"
@@ -934,21 +942,44 @@ msgstr ""
msgid "Upgrading data to version %s"
msgstr ""
-#: admin/views/install-notice.php:23
+#: admin/views/install-notice.php:18 pro/fields/repeater.php:36
+msgid "Repeater"
+msgstr ""
+
+#: admin/views/install-notice.php:19 pro/fields/flexible-content.php:36
+msgid "Flexible Content"
+msgstr ""
+
+#: admin/views/install-notice.php:20 pro/fields/gallery.php:36
+msgid "Gallery"
+msgstr ""
+
+#: admin/views/install-notice.php:21 pro/admin/options-page.php:53
+msgid "Options Page"
+msgstr ""
+
+#: admin/views/install-notice.php:36
msgid "Database Upgrade Required"
msgstr ""
-#: admin/views/install-notice.php:25
+#: admin/views/install-notice.php:38
#, php-format
msgid "Thank you for updating to %s v%s!"
msgstr ""
-#: admin/views/install-notice.php:25
+#: admin/views/install-notice.php:38
msgid ""
"Before you start using the new awesome features, please update your database "
"to the newest version."
msgstr ""
+#: admin/views/install-notice.php:41
+#, php-format
+msgid ""
+"Please also ensure any premium add-ons (%s) have first been updated to the "
+"latest version."
+msgstr ""
+
#: admin/views/install.php:12
msgid "Reading upgrade tasks..."
msgstr ""
@@ -1259,107 +1290,107 @@ msgstr ""
msgid "Import"
msgstr ""
-#: api/api-helpers.php:881
+#: api/api-helpers.php:967
msgid "Thumbnail"
msgstr ""
-#: api/api-helpers.php:882
+#: api/api-helpers.php:968
msgid "Medium"
msgstr ""
-#: api/api-helpers.php:883
+#: api/api-helpers.php:969
msgid "Large"
msgstr ""
-#: api/api-helpers.php:932
+#: api/api-helpers.php:1018
msgid "Full Size"
msgstr ""
-#: api/api-helpers.php:1189 api/api-helpers.php:1739 pro/fields/clone.php:1002
+#: api/api-helpers.php:1359 api/api-helpers.php:1948 pro/fields/clone.php:1042
msgid "(no title)"
msgstr ""
-#: api/api-helpers.php:1776 fields/page_link.php:284
+#: api/api-helpers.php:1985 fields/page_link.php:284
#: fields/post_object.php:283 fields/taxonomy.php:988
msgid "Parent"
msgstr ""
-#: api/api-helpers.php:3784
+#: api/api-helpers.php:3999
#, php-format
msgid "Image width must be at least %dpx."
msgstr ""
-#: api/api-helpers.php:3789
+#: api/api-helpers.php:4004
#, php-format
msgid "Image width must not exceed %dpx."
msgstr ""
-#: api/api-helpers.php:3805
+#: api/api-helpers.php:4020
#, php-format
msgid "Image height must be at least %dpx."
msgstr ""
-#: api/api-helpers.php:3810
+#: api/api-helpers.php:4025
#, php-format
msgid "Image height must not exceed %dpx."
msgstr ""
-#: api/api-helpers.php:3828
+#: api/api-helpers.php:4043
#, php-format
msgid "File size must be at least %s."
msgstr ""
-#: api/api-helpers.php:3833
+#: api/api-helpers.php:4048
#, php-format
msgid "File size must must not exceed %s."
msgstr ""
-#: api/api-helpers.php:3867
+#: api/api-helpers.php:4082
#, php-format
msgid "File type must be %s."
msgstr ""
-#: api/api-template.php:1027 core/field.php:327
+#: core/field.php:334
+msgid "Basic"
+msgstr ""
+
+#: core/field.php:335 core/form.php:45
msgid "Content"
msgstr ""
-#: api/api-template.php:1035
+#: core/field.php:336
+msgid "Choice"
+msgstr ""
+
+#: core/field.php:337
+msgid "Relational"
+msgstr ""
+
+#: core/field.php:338
+msgid "jQuery"
+msgstr ""
+
+#: core/field.php:339 fields/checkbox.php:281 fields/radio.php:300
+#: pro/fields/clone.php:889 pro/fields/flexible-content.php:575
+#: pro/fields/flexible-content.php:624 pro/fields/repeater.php:514
+msgid "Layout"
+msgstr ""
+
+#: core/form.php:53
msgid "Validate Email"
msgstr ""
-#: api/api-template.php:1085
-msgid "Spam Detected"
-msgstr ""
-
-#: api/api-template.php:1288 pro/api/api-options-page.php:50
+#: core/form.php:101 pro/api/api-options-page.php:52
#: pro/fields/gallery.php:588
msgid "Update"
msgstr ""
-#: api/api-template.php:1289
+#: core/form.php:102
msgid "Post updated"
msgstr ""
-#: core/field.php:326
-msgid "Basic"
-msgstr ""
-
-#: core/field.php:328
-msgid "Choice"
-msgstr ""
-
-#: core/field.php:329
-msgid "Relational"
-msgstr ""
-
-#: core/field.php:330
-msgid "jQuery"
-msgstr ""
-
-#: core/field.php:331 fields/checkbox.php:281 fields/radio.php:292
-#: pro/fields/clone.php:849 pro/fields/flexible-content.php:571
-#: pro/fields/flexible-content.php:620 pro/fields/repeater.php:506
-msgid "Layout"
+#: core/form.php:227
+msgid "Spam Detected"
msgstr ""
#: core/input.php:258
@@ -1374,7 +1405,7 @@ msgstr ""
msgid "Validation successful"
msgstr ""
-#: core/input.php:261 core/validation.php:322 forms/widget.php:234
+#: core/input.php:261 core/validation.php:322 forms/widget.php:236
msgid "Validation failed"
msgstr ""
@@ -1391,7 +1422,7 @@ msgstr ""
msgid "Restricted"
msgstr ""
-#: core/media.php:54 fields/select.php:265
+#: core/media.php:54 fields/select.php:274
msgctxt "verb"
msgid "Select"
msgstr ""
@@ -1428,19 +1459,19 @@ msgstr ""
msgid "Add new choice"
msgstr ""
-#: fields/checkbox.php:241 fields/radio.php:242 fields/select.php:463
+#: fields/checkbox.php:241 fields/radio.php:250 fields/select.php:470
msgid "Choices"
msgstr ""
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "Enter each choice on a new line."
msgstr ""
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "For more control, you may specify both a value and label like this:"
msgstr ""
-#: fields/checkbox.php:242 fields/radio.php:243 fields/select.php:464
+#: fields/checkbox.php:242 fields/radio.php:251 fields/select.php:471
msgid "red : Red"
msgstr ""
@@ -1461,21 +1492,21 @@ msgid "Save 'custom' values to the field's choices"
msgstr ""
#: fields/checkbox.php:272 fields/color_picker.php:147 fields/email.php:133
-#: fields/number.php:145 fields/radio.php:283 fields/select.php:472
+#: fields/number.php:145 fields/radio.php:291 fields/select.php:479
#: fields/text.php:142 fields/textarea.php:139 fields/true_false.php:150
-#: fields/url.php:114 fields/wysiwyg.php:445
+#: fields/url.php:114 fields/wysiwyg.php:436
msgid "Default Value"
msgstr ""
-#: fields/checkbox.php:273 fields/select.php:473
+#: fields/checkbox.php:273 fields/select.php:480
msgid "Enter each default value on a new line"
msgstr ""
-#: fields/checkbox.php:287 fields/radio.php:298
+#: fields/checkbox.php:287 fields/radio.php:306
msgid "Vertical"
msgstr ""
-#: fields/checkbox.php:288 fields/radio.php:299
+#: fields/checkbox.php:288 fields/radio.php:307
msgid "Horizontal"
msgstr ""
@@ -1487,21 +1518,21 @@ msgstr ""
msgid "Prepend an extra checkbox to toggle all choices"
msgstr ""
-#: fields/checkbox.php:305 fields/file.php:222 fields/image.php:208
-#: fields/radio.php:306 fields/taxonomy.php:835
+#: fields/checkbox.php:305 fields/file.php:219 fields/image.php:206
+#: fields/radio.php:314 fields/taxonomy.php:835
msgid "Return Value"
msgstr ""
-#: fields/checkbox.php:306 fields/file.php:223 fields/image.php:209
-#: fields/radio.php:307
+#: fields/checkbox.php:306 fields/file.php:220 fields/image.php:207
+#: fields/radio.php:315
msgid "Specify the returned value on front end"
msgstr ""
-#: fields/checkbox.php:311 fields/radio.php:312 fields/select.php:527
+#: fields/checkbox.php:311 fields/radio.php:320 fields/select.php:533
msgid "Value"
msgstr ""
-#: fields/checkbox.php:313 fields/radio.php:314 fields/select.php:529
+#: fields/checkbox.php:313 fields/radio.php:322 fields/select.php:535
msgid "Both (Array)"
msgstr ""
@@ -1554,36 +1585,42 @@ msgctxt "Date Picker JS weekHeader"
msgid "Wk"
msgstr ""
-#: fields/date_picker.php:197 fields/date_time_picker.php:186
-#: fields/time_picker.php:126
+#: fields/date_picker.php:223 fields/date_time_picker.php:197
+#: fields/time_picker.php:127
msgid "Display Format"
msgstr ""
-#: fields/date_picker.php:198 fields/date_time_picker.php:187
-#: fields/time_picker.php:127
+#: fields/date_picker.php:224 fields/date_time_picker.php:198
+#: fields/time_picker.php:128
msgid "The format displayed when editing a post"
msgstr ""
-#: fields/date_picker.php:212 fields/date_time_picker.php:202
-#: fields/post_object.php:447 fields/relationship.php:783
-#: fields/select.php:522 fields/time_picker.php:140
-msgid "Return Format"
+#: fields/date_picker.php:232 fields/date_picker.php:263
+#: fields/date_time_picker.php:207 fields/date_time_picker.php:224
+#: fields/time_picker.php:135 fields/time_picker.php:150
+msgid "Custom:"
msgstr ""
-#: fields/date_picker.php:213 fields/date_time_picker.php:203
-#: fields/time_picker.php:141
-msgid "The format returned via template functions"
-msgstr ""
-
-#: fields/date_picker.php:231
+#: fields/date_picker.php:242
msgid "Save Format"
msgstr ""
-#: fields/date_picker.php:232
+#: fields/date_picker.php:243
msgid "The format used when saving a value"
msgstr ""
-#: fields/date_picker.php:243 fields/date_time_picker.php:218
+#: fields/date_picker.php:253 fields/date_time_picker.php:214
+#: fields/post_object.php:447 fields/relationship.php:778
+#: fields/select.php:528 fields/time_picker.php:142
+msgid "Return Format"
+msgstr ""
+
+#: fields/date_picker.php:254 fields/date_time_picker.php:215
+#: fields/time_picker.php:143
+msgid "The format returned via template functions"
+msgstr ""
+
+#: fields/date_picker.php:272 fields/date_time_picker.php:231
msgid "Week Starts On"
msgstr ""
@@ -1670,9 +1707,9 @@ msgstr ""
msgid "Email"
msgstr ""
-#: fields/email.php:134 fields/number.php:146 fields/radio.php:284
+#: fields/email.php:134 fields/number.php:146 fields/radio.php:292
#: fields/text.php:143 fields/textarea.php:140 fields/url.php:115
-#: fields/wysiwyg.php:446
+#: fields/wysiwyg.php:437
msgid "Appears when creating a new post"
msgstr ""
@@ -1718,61 +1755,61 @@ msgstr ""
msgid "Update File"
msgstr ""
-#: fields/file.php:148
+#: fields/file.php:145
msgid "File name"
msgstr ""
-#: fields/file.php:152 fields/file.php:255 fields/file.php:266
-#: fields/image.php:270 fields/image.php:303 pro/fields/gallery.php:707
-#: pro/fields/gallery.php:740
+#: fields/file.php:149 fields/file.php:252 fields/file.php:263
+#: fields/image.php:266 fields/image.php:295 pro/fields/gallery.php:705
+#: pro/fields/gallery.php:734
msgid "File size"
msgstr ""
-#: fields/file.php:177
+#: fields/file.php:174
msgid "Add File"
msgstr ""
-#: fields/file.php:228
+#: fields/file.php:225
msgid "File Array"
msgstr ""
-#: fields/file.php:229
+#: fields/file.php:226
msgid "File URL"
msgstr ""
-#: fields/file.php:230
+#: fields/file.php:227
msgid "File ID"
msgstr ""
-#: fields/file.php:237 fields/image.php:233 pro/fields/gallery.php:670
+#: fields/file.php:234 fields/image.php:231 pro/fields/gallery.php:670
msgid "Library"
msgstr ""
-#: fields/file.php:238 fields/image.php:234 pro/fields/gallery.php:671
+#: fields/file.php:235 fields/image.php:232 pro/fields/gallery.php:671
msgid "Limit the media library choice"
msgstr ""
-#: fields/file.php:244 fields/image.php:240 pro/fields/gallery.php:677
+#: fields/file.php:241 fields/image.php:238 pro/fields/gallery.php:677
msgid "Uploaded to post"
msgstr ""
-#: fields/file.php:251 fields/image.php:247 pro/fields/gallery.php:684
+#: fields/file.php:248 fields/image.php:245 pro/fields/gallery.php:684
msgid "Minimum"
msgstr ""
-#: fields/file.php:252 fields/file.php:263
+#: fields/file.php:249 fields/file.php:260
msgid "Restrict which files can be uploaded"
msgstr ""
-#: fields/file.php:262 fields/image.php:280 pro/fields/gallery.php:717
+#: fields/file.php:259 fields/image.php:274 pro/fields/gallery.php:713
msgid "Maximum"
msgstr ""
-#: fields/file.php:273 fields/image.php:313 pro/fields/gallery.php:750
+#: fields/file.php:270 fields/image.php:303 pro/fields/gallery.php:742
msgid "Allowed file types"
msgstr ""
-#: fields/file.php:274 fields/image.php:314 pro/fields/gallery.php:751
+#: fields/file.php:271 fields/image.php:304 pro/fields/gallery.php:743
msgid "Comma separated list. Leave blank for all types"
msgstr ""
@@ -1808,20 +1845,20 @@ msgstr ""
msgid "Center the initial map"
msgstr ""
-#: fields/google-map.php:192
+#: fields/google-map.php:190
msgid "Zoom"
msgstr ""
-#: fields/google-map.php:193
+#: fields/google-map.php:191
msgid "Set the initial zoom level"
msgstr ""
-#: fields/google-map.php:202 fields/image.php:259 fields/image.php:292
-#: fields/oembed.php:270 pro/fields/gallery.php:696 pro/fields/gallery.php:729
+#: fields/google-map.php:200 fields/image.php:257 fields/image.php:286
+#: fields/oembed.php:297 pro/fields/gallery.php:696 pro/fields/gallery.php:725
msgid "Height"
msgstr ""
-#: fields/google-map.php:203
+#: fields/google-map.php:201
msgid "Customise the map height"
msgstr ""
@@ -1845,77 +1882,77 @@ msgstr ""
msgid "All images"
msgstr ""
-#: fields/image.php:144 pro/fields/gallery.php:358 pro/fields/gallery.php:546
+#: fields/image.php:142 pro/fields/gallery.php:358 pro/fields/gallery.php:546
msgid "Remove"
msgstr ""
-#: fields/image.php:160
+#: fields/image.php:158
msgid "No image selected"
msgstr ""
-#: fields/image.php:160
+#: fields/image.php:158
msgid "Add Image"
msgstr ""
-#: fields/image.php:214
+#: fields/image.php:212
msgid "Image Array"
msgstr ""
-#: fields/image.php:215
+#: fields/image.php:213
msgid "Image URL"
msgstr ""
-#: fields/image.php:216
+#: fields/image.php:214
msgid "Image ID"
msgstr ""
-#: fields/image.php:223
+#: fields/image.php:221
msgid "Preview Size"
msgstr ""
-#: fields/image.php:224
+#: fields/image.php:222
msgid "Shown when entering data"
msgstr ""
-#: fields/image.php:248 fields/image.php:281 pro/fields/gallery.php:685
-#: pro/fields/gallery.php:718
+#: fields/image.php:246 fields/image.php:275 pro/fields/gallery.php:685
+#: pro/fields/gallery.php:714
msgid "Restrict which images can be uploaded"
msgstr ""
-#: fields/image.php:251 fields/image.php:284 fields/oembed.php:259
-#: pro/fields/gallery.php:688 pro/fields/gallery.php:721
+#: fields/image.php:249 fields/image.php:278 fields/oembed.php:286
+#: pro/fields/gallery.php:688 pro/fields/gallery.php:717
msgid "Width"
msgstr ""
-#: fields/message.php:36 fields/message.php:116 fields/true_false.php:141
+#: fields/message.php:36 fields/message.php:115 fields/true_false.php:141
msgid "Message"
msgstr ""
-#: fields/message.php:125 fields/textarea.php:176
+#: fields/message.php:124 fields/textarea.php:176
msgid "New Lines"
msgstr ""
-#: fields/message.php:126 fields/textarea.php:177
+#: fields/message.php:125 fields/textarea.php:177
msgid "Controls how new lines are rendered"
msgstr ""
-#: fields/message.php:130 fields/textarea.php:181
+#: fields/message.php:129 fields/textarea.php:181
msgid "Automatically add paragraphs"
msgstr ""
-#: fields/message.php:131 fields/textarea.php:182
+#: fields/message.php:130 fields/textarea.php:182
msgid "Automatically add <br>"
msgstr ""
-#: fields/message.php:132 fields/textarea.php:183
+#: fields/message.php:131 fields/textarea.php:183
msgid "No Formatting"
msgstr ""
-#: fields/message.php:139
+#: fields/message.php:138
msgid "Escape HTML"
msgstr ""
-#: fields/message.php:140
+#: fields/message.php:139
msgid "Allow HTML markup to display as visible text instead of rendering"
msgstr ""
@@ -1953,19 +1990,19 @@ msgstr ""
msgid "oEmbed"
msgstr ""
-#: fields/oembed.php:207
+#: fields/oembed.php:237
msgid "Enter URL"
msgstr ""
-#: fields/oembed.php:220 fields/taxonomy.php:900
+#: fields/oembed.php:250 fields/taxonomy.php:900
msgid "Error."
msgstr ""
-#: fields/oembed.php:220
+#: fields/oembed.php:250
msgid "No embed found for the given URL."
msgstr ""
-#: fields/oembed.php:256 fields/oembed.php:267
+#: fields/oembed.php:283 fields/oembed.php:294
msgid "Embed Size"
msgstr ""
@@ -1974,27 +2011,27 @@ msgid "Archives"
msgstr ""
#: fields/page_link.php:500 fields/post_object.php:399
-#: fields/relationship.php:709
+#: fields/relationship.php:704
msgid "Filter by Post Type"
msgstr ""
#: fields/page_link.php:508 fields/post_object.php:407
-#: fields/relationship.php:717
+#: fields/relationship.php:712
msgid "All post types"
msgstr ""
#: fields/page_link.php:514 fields/post_object.php:413
-#: fields/relationship.php:723
+#: fields/relationship.php:718
msgid "Filter by Taxonomy"
msgstr ""
#: fields/page_link.php:522 fields/post_object.php:421
-#: fields/relationship.php:731
+#: fields/relationship.php:726
msgid "All taxonomies"
msgstr ""
-#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:251
-#: fields/select.php:481 fields/taxonomy.php:795 fields/user.php:394
+#: fields/page_link.php:528 fields/post_object.php:427 fields/radio.php:259
+#: fields/select.php:488 fields/taxonomy.php:795 fields/user.php:423
msgid "Allow Null?"
msgstr ""
@@ -2002,8 +2039,8 @@ msgstr ""
msgid "Allow Archives URLs"
msgstr ""
-#: fields/page_link.php:548 fields/post_object.php:437 fields/select.php:491
-#: fields/user.php:404
+#: fields/page_link.php:548 fields/post_object.php:437 fields/select.php:498
+#: fields/user.php:433
msgid "Select multiple values?"
msgstr ""
@@ -2012,11 +2049,11 @@ msgid "Password"
msgstr ""
#: fields/post_object.php:36 fields/post_object.php:452
-#: fields/relationship.php:788
+#: fields/relationship.php:783
msgid "Post Object"
msgstr ""
-#: fields/post_object.php:453 fields/relationship.php:789
+#: fields/post_object.php:453 fields/relationship.php:784
msgid "Post ID"
msgstr ""
@@ -2024,19 +2061,19 @@ msgstr ""
msgid "Radio Button"
msgstr ""
-#: fields/radio.php:261
+#: fields/radio.php:269
msgid "Other"
msgstr ""
-#: fields/radio.php:266
+#: fields/radio.php:274
msgid "Add 'other' choice to allow for custom values"
msgstr ""
-#: fields/radio.php:272
+#: fields/radio.php:280
msgid "Save Other"
msgstr ""
-#: fields/radio.php:277
+#: fields/radio.php:285
msgid "Save 'other' values to the field's choices"
msgstr ""
@@ -2060,39 +2097,39 @@ msgstr ""
msgid "No matches found"
msgstr ""
-#: fields/relationship.php:590
+#: fields/relationship.php:585
msgid "Search..."
msgstr ""
-#: fields/relationship.php:599
+#: fields/relationship.php:594
msgid "Select post type"
msgstr ""
-#: fields/relationship.php:612
+#: fields/relationship.php:607
msgid "Select taxonomy"
msgstr ""
-#: fields/relationship.php:744 fields/taxonomy.php:36 fields/taxonomy.php:765
+#: fields/relationship.php:739 fields/taxonomy.php:36 fields/taxonomy.php:765
msgid "Taxonomy"
msgstr ""
-#: fields/relationship.php:751
+#: fields/relationship.php:746
msgid "Elements"
msgstr ""
-#: fields/relationship.php:752
+#: fields/relationship.php:747
msgid "Selected elements will be displayed in each result"
msgstr ""
-#: fields/relationship.php:763
+#: fields/relationship.php:758
msgid "Minimum posts"
msgstr ""
-#: fields/relationship.php:772
+#: fields/relationship.php:767
msgid "Maximum posts"
msgstr ""
-#: fields/relationship.php:876 pro/fields/gallery.php:823
+#: fields/relationship.php:871 pro/fields/gallery.php:815
#, php-format
msgid "%s requires at least %s selection"
msgid_plural "%s requires at least %s selections"
@@ -2168,15 +2205,15 @@ msgctxt "Select2 JS load_fail"
msgid "Loading failed"
msgstr ""
-#: fields/select.php:501 fields/true_false.php:159
+#: fields/select.php:508 fields/true_false.php:159
msgid "Stylised UI"
msgstr ""
-#: fields/select.php:512
+#: fields/select.php:518
msgid "Use AJAX to lazy load choices?"
msgstr ""
-#: fields/select.php:523
+#: fields/select.php:529
msgid "Specify the value returned"
msgstr ""
@@ -2184,34 +2221,34 @@ msgstr ""
msgid "Tab"
msgstr ""
-#: fields/tab.php:97
+#: fields/tab.php:96
msgid ""
"The tab field will display incorrectly when added to a Table style repeater "
"field or flexible content field layout"
msgstr ""
-#: fields/tab.php:98
+#: fields/tab.php:97
msgid ""
"Use \"Tab Fields\" to better organize your edit screen by grouping fields "
"together."
msgstr ""
-#: fields/tab.php:99
+#: fields/tab.php:98
msgid ""
"All fields following this \"tab field\" (or until another \"tab field\" is "
"defined) will be grouped together using this field's label as the tab "
"heading."
msgstr ""
-#: fields/tab.php:113
+#: fields/tab.php:112
msgid "Placement"
msgstr ""
-#: fields/tab.php:125
+#: fields/tab.php:124
msgid "End-point"
msgstr ""
-#: fields/tab.php:126
+#: fields/tab.php:125
msgid "Use this field as an end-point and start a new group of tabs"
msgstr ""
@@ -2368,11 +2405,11 @@ msgstr ""
msgid "Value must be a valid URL"
msgstr ""
-#: fields/user.php:379
+#: fields/user.php:408
msgid "Filter by role"
msgstr ""
-#: fields/user.php:387
+#: fields/user.php:416
msgid "All user roles"
msgstr ""
@@ -2380,56 +2417,56 @@ msgstr ""
msgid "Wysiwyg Editor"
msgstr ""
-#: fields/wysiwyg.php:394
+#: fields/wysiwyg.php:385
msgid "Visual"
msgstr ""
-#: fields/wysiwyg.php:395
+#: fields/wysiwyg.php:386
msgctxt "Name for the Text editor tab (formerly HTML)"
msgid "Text"
msgstr ""
-#: fields/wysiwyg.php:401
+#: fields/wysiwyg.php:392
msgid "Click to initialize TinyMCE"
msgstr ""
-#: fields/wysiwyg.php:454
+#: fields/wysiwyg.php:445
msgid "Tabs"
msgstr ""
-#: fields/wysiwyg.php:459
+#: fields/wysiwyg.php:450
msgid "Visual & Text"
msgstr ""
-#: fields/wysiwyg.php:460
+#: fields/wysiwyg.php:451
msgid "Visual Only"
msgstr ""
-#: fields/wysiwyg.php:461
+#: fields/wysiwyg.php:452
msgid "Text Only"
msgstr ""
-#: fields/wysiwyg.php:468
+#: fields/wysiwyg.php:459
msgid "Toolbar"
msgstr ""
-#: fields/wysiwyg.php:478
+#: fields/wysiwyg.php:469
msgid "Show Media Upload Buttons?"
msgstr ""
-#: fields/wysiwyg.php:488
+#: fields/wysiwyg.php:479
msgid "Delay initialization?"
msgstr ""
-#: fields/wysiwyg.php:489
+#: fields/wysiwyg.php:480
msgid "TinyMCE will not be initalized until field is clicked"
msgstr ""
-#: forms/comment.php:166 forms/post.php:295 pro/admin/options-page.php:416
+#: forms/comment.php:166 forms/post.php:303 pro/admin/options-page.php:421
msgid "Edit field group"
msgstr ""
-#: forms/widget.php:235
+#: forms/widget.php:237
#, php-format
msgid "1 field requires attention."
msgid_plural "%d fields require attention."
@@ -2437,43 +2474,35 @@ msgstr[0] ""
msgstr[1] ""
#. Plugin Name of the plugin/theme
-#: pro/acf-pro.php:24
+#: pro/acf-pro.php:28
msgid "Advanced Custom Fields PRO"
msgstr ""
-#: pro/acf-pro.php:192
-msgid "Flexible Content requires at least 1 layout"
-msgstr ""
-
-#: pro/admin/options-page.php:49
-msgid "Options Page"
-msgstr ""
-
-#: pro/admin/options-page.php:85
+#: pro/admin/options-page.php:89
msgid "No options pages exist"
msgstr ""
-#: pro/admin/options-page.php:303
+#: pro/admin/options-page.php:307
msgid "Options Updated"
msgstr ""
-#: pro/admin/options-page.php:309
+#: pro/admin/options-page.php:313
msgid "Publish"
msgstr ""
-#: pro/admin/options-page.php:315
+#: pro/admin/options-page.php:319
#, php-format
msgid ""
"No Custom Field Groups found for this options page. Create a "
"Custom Field Group "
msgstr ""
-#: pro/admin/settings-updates.php:57 pro/admin/views/settings-updates.php:17
-msgid "Updates"
+#: pro/admin/settings-updates.php:78
+msgid "Error . Could not connect to update server"
msgstr ""
-#: pro/admin/settings-updates.php:87
-msgid "Error . Could not connect to update server"
+#: pro/admin/settings-updates.php:162 pro/admin/views/settings-updates.php:17
+msgid "Updates"
msgstr ""
#: pro/admin/views/settings-updates.php:11
@@ -2532,17 +2561,11 @@ msgstr ""
msgid "Upgrade Notice"
msgstr ""
-#: pro/api/api-options-page.php:22 pro/api/api-options-page.php:23
+#: pro/api/api-options-page.php:24 pro/api/api-options-page.php:25
msgid "Options"
msgstr ""
-#: pro/api/api-pro.php:330
-msgid ""
-"Error validating ACF PRO license URL (website does not match). Please re-"
-"activate your license"
-msgstr ""
-
-#: pro/core/updates.php:206
+#: pro/core/updates.php:97
#, php-format
msgid ""
"To enable updates, please enter your license key on the define( 'ACF_PRO', true );
+
+
// update setting
acf_update_setting( 'pro', true );
acf_update_setting( 'name', __('Advanced Custom Fields PRO', 'acf') );
- // api
- acf_include('pro/api/api-pro.php');
+ // includes
acf_include('pro/api/api-options-page.php');
-
-
- // updates
acf_include('pro/core/updates.php');
-
-
- // admin
+
if( is_admin() ) {
- // options page
acf_include('pro/admin/options-page.php');
-
- // settings
acf_include('pro/admin/settings-updates.php');
}
@@ -92,18 +87,19 @@ class acf_pro {
function register_assets() {
- // min
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+ // vars
+ $version = acf_get_setting('version');
+ $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
// register scripts
- wp_register_script( 'acf-pro-input', acf_get_dir( "pro/assets/js/acf-pro-input{$min}.js" ), array('acf-input'), acf_get_setting('version') );
- wp_register_script( 'acf-pro-field-group', acf_get_dir( "pro/assets/js/acf-pro-field-group{$min}.js" ), array('acf-field-group'), acf_get_setting('version') );
+ wp_register_script( 'acf-pro-input', acf_get_dir( "pro/assets/js/acf-pro-input{$min}.js" ), array('acf-input'), $version );
+ wp_register_script( 'acf-pro-field-group', acf_get_dir( "pro/assets/js/acf-pro-field-group{$min}.js" ), array('acf-field-group'), $version );
// register styles
- wp_register_style( 'acf-pro-input', acf_get_dir( 'pro/assets/css/acf-pro-input.css' ), false, acf_get_setting('version') );
- wp_register_style( 'acf-pro-field-group', acf_get_dir( 'pro/assets/css/acf-pro-field-group.css' ), false, acf_get_setting('version') );
+ wp_register_style( 'acf-pro-input', acf_get_dir( 'pro/assets/css/acf-pro-input.css' ), array('acf-input'), $version );
+ wp_register_style( 'acf-pro-field-group', acf_get_dir( 'pro/assets/css/acf-pro-field-group.css' ), array('acf-input'), $version );
}
@@ -123,11 +119,7 @@ class acf_pro {
function input_admin_enqueue_scripts() {
- // scripts
wp_enqueue_script('acf-pro-input');
-
-
- // styles
wp_enqueue_style('acf-pro-input');
}
@@ -148,11 +140,7 @@ class acf_pro {
function field_group_admin_enqueue_scripts() {
- // scripts
wp_enqueue_script('acf-pro-field-group');
-
-
- // styles
wp_enqueue_style('acf-pro-field-group');
}
diff --git a/pro/admin/options-page.php b/pro/admin/options-page.php
index fc540d1..4ca0205 100644
--- a/pro/admin/options-page.php
+++ b/pro/admin/options-page.php
@@ -463,14 +463,8 @@ if( typeof acf !== 'undefined' ) {
function html() {
- // vars
- $view = array(
- 'page' => $this->page
- );
-
-
// load view
- acf_pro_get_view('options-page', $view);
+ acf_get_view(dirname(__FILE__) . '/views/options-page.php', $this->page);
}
diff --git a/pro/admin/settings-updates.php b/pro/admin/settings-updates.php
index 251f792..26b38a1 100644
--- a/pro/admin/settings-updates.php
+++ b/pro/admin/settings-updates.php
@@ -1,8 +1,13 @@
Error. Could not connect to update server', 'acf') . ' (' . $error->get_error_message() . ') ';
+
+ }
+
+
+ // add notice
+ $this->show_notice( $error, 'error' );
+
+ }
+
+
+ /*
+ * get_changelog_section
+ *
+ * This function will find and return a section of content from a plugin changelog
+ *
+ * @type function
+ * @date 11/4/17
+ * @since 5.5.10
+ *
+ * @param $changelog (string)
+ * @param $h4 (string)
+ * @return (string)
+ */
+
+ function get_changelog_section( $changelog, $h4 = '' ) {
+
+ // explode
+ $bits = array_filter( explode('', $changelog) );
+
+
+ // loop
+ foreach( $bits as $bit ) {
+
+ // vars
+ $bit = explode(' ', $bit);
+ $version = trim($bit[0]);
+ $text = trim($bit[1]);
+
+
+ // is relevant?
+ if( version_compare($h4, $version, '==') ) {
+
+ return '' . $version . ' ' . $text;
+
+ }
+
+ }
+
+
+ // update
+ return '';
+
+ }
+
+
/*
* admin_menu
*
@@ -54,7 +159,7 @@ class acf_settings_updates {
// add page
- $page = add_submenu_page('edit.php?post_type=acf-field-group', __('Updates','acf'), __('Updates','acf'), acf_get_setting('capability'),'acf-settings-updates', array($this,'html') );
+ $page = add_submenu_page('edit.php?post_type=acf-field-group', __('Updates','acf'), __('Updates','acf'), acf_get_setting('capability'), 'acf-settings-updates', array($this,'html') );
// actions
@@ -63,48 +168,6 @@ class acf_settings_updates {
}
- /*
- * show_remote_response_error
- *
- * This function will show an admin notice if server connection fails
- *
- * @type function
- * @date 25/07/2016
- * @since 5.4.0
- *
- * @param n/a
- * @return n/a
- */
-
- function show_remote_response_error() {
-
- // only run once
- if( acf_has_done('show_remote_response_error') ) return false;
-
-
- // vars
- $error = acf_get_setting('remote_response_error');
- $notice = __('Error . Could not connect to update server', 'acf');
-
-
- // append error
- if( $error ) {
-
- $notice .= ' (' . $error . ') ';
-
- }
-
-
- // add notice
- acf_add_admin_notice( $notice, 'error' );
-
-
- // return
- return false;
-
- }
-
-
/*
* load
*
@@ -120,11 +183,12 @@ class acf_settings_updates {
function load() {
- // $_POST
+ // activate
if( acf_verify_nonce('activate_pro_licence') ) {
$this->activate_pro_licence();
-
+
+ // deactivate
} elseif( acf_verify_nonce('deactivate_pro_licence') ) {
$this->deactivate_pro_licence();
@@ -132,10 +196,11 @@ class acf_settings_updates {
}
- // view
+ // vars
+ $license = acf_pro_get_license_key();
$this->view = array(
- 'license' => '',
- 'active' => 0,
+ 'license' => $license,
+ 'active' => $license ? 1 : 0,
'current_version' => acf_get_setting('version'),
'remote_version' => '',
'update_available' => false,
@@ -144,25 +209,16 @@ class acf_settings_updates {
);
- // license
- if( acf_pro_is_license_active() ) {
+ // vars
+ $info = acf_updates()->get_plugin_info('pro');
- $this->view['license'] = acf_pro_get_license_key();
- $this->view['active'] = 1;
+
+ // error
+ if( is_wp_error($info) ) {
+
+ return $this->show_error( $info );
}
-
-
- // vars
- $info = acf_get_remote_plugin_info();
-
-
- // validate
- if( empty($info) ) {
-
- return $this->show_remote_response_error();
-
- }
// add info to view
@@ -170,39 +226,29 @@ class acf_settings_updates {
// add changelog if the remote version is '>' than the current version
- if( acf_pro_is_update_available() ) {
+ $version = acf_get_setting('version');
+
+
+ // check if remote version is higher than current version
+ if( version_compare($info['version'], $version, '>') ) {
+ // update view
$this->view['update_available'] = true;
- $this->view['changelog'] = acf_maybe_get($info, 'changelog');
- $this->view['upgrade_notice'] = acf_maybe_get($info, 'upgrade_notice');
+ $this->view['changelog'] = $this->get_changelog_section($info['changelog'], $info['version']);
+ $this->view['upgrade_notice'] = $this->get_changelog_section($info['upgrade_notice'], $info['version']);
+
+ // refresh transient
+ // - avoids new version not available in plugin update list
+ // - only request if license is active
+ if( $license ) {
+
+ acf_updates()->refresh_plugins_transient();
+
+ }
+
}
-
- // update transient
- acf_refresh_plugin_updates_transient();
-
- }
-
-
- /*
- * html
- *
- * description
- *
- * @type function
- * @date 7/01/2014
- * @since 5.0.0
- *
- * @param $post_id (int)
- * @return $post_id (int)
- */
-
- function html() {
-
- // load view
- acf_pro_get_view('settings-updates', $this->view);
-
}
@@ -222,9 +268,8 @@ class acf_settings_updates {
function activate_pro_licence() {
// connect
- $args = array(
- '_nonce' => wp_create_nonce('activate_pro_licence'),
- 'acf_license' => acf_extract_var($_POST, 'acf_pro_licence'),
+ $post = array(
+ 'acf_license' => $_POST['acf_pro_licence'],
'acf_version' => acf_get_setting('version'),
'wp_name' => get_bloginfo('name'),
'wp_url' => home_url(),
@@ -235,38 +280,31 @@ class acf_settings_updates {
// connect
- $response = acf_pro_get_remote_response( 'activate-license', $args );
+ $response = acf_updates()->request('v2/plugins/activate?p=pro', $post);
- // validate
- if( empty($response) ) {
+ // error
+ if( is_wp_error($response) ) {
- return $this->show_remote_response_error();
+ return $this->show_error( $response );
}
- // vars
- $response = json_decode($response, true);
- $class = '';
-
-
- // action
+ // success
if( $response['status'] == 1 ) {
- acf_pro_update_license($response['license']);
+ // update license
+ acf_pro_update_license( $response['license'] );
+
+
+ // show message
+ $this->show_notice( $response['message'] );
} else {
- $class = 'error';
-
- }
-
-
- // show message
- if( $response['message'] ) {
-
- acf_add_admin_notice($response['message'], $class);
+ // show error
+ $this->show_error( $response['message'] );
}
@@ -288,61 +326,70 @@ class acf_settings_updates {
function deactivate_pro_licence() {
- // validate
- if( !acf_pro_is_license_active() ) {
-
- return;
-
- }
+ // vars
+ $license = acf_pro_get_license_key();
+
+
+ // bail early if no key
+ if( !$license ) return;
// connect
- $args = array(
- '_nonce' => wp_create_nonce('deactivate_pro_licence'),
- 'acf_license' => acf_pro_get_license_key(),
+ $post = array(
+ 'acf_license' => $license,
'wp_url' => home_url(),
);
// connect
- $response = acf_pro_get_remote_response( 'deactivate-license', $args );
+ $response = acf_updates()->request('v2/plugins/deactivate?p=pro', $post);
- // validate
- if( empty($response) ) {
-
- return $this->show_remote_response_error();
+ // error
+ if( is_wp_error($response) ) {
+
+ return $this->show_error( $response );
}
- // vars
- $response = json_decode($response, true);
- $class = '';
-
-
- // allways clear DB
+ // clear DB
acf_pro_update_license('');
- // action
+ // success
if( $response['status'] == 1 ) {
-
+ // show message
+ $this->show_notice( $response['message'] );
} else {
- $class = 'error';
+ // show error
+ $this->show_error( $response['message'] );
}
+ }
+
+
+ /*
+ * html
+ *
+ * description
+ *
+ * @type function
+ * @date 7/01/2014
+ * @since 5.0.0
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ function html() {
- // show message
- if( $response['message'] ) {
-
- acf_add_admin_notice($response['message'], $class);
-
- }
+ // load view
+ acf_get_view( dirname(__FILE__) . '/views/settings-updates.php', $this->view);
}
@@ -352,4 +399,6 @@ class acf_settings_updates {
// initialize
new acf_settings_updates();
+endif; // class_exists check
+
?>
\ No newline at end of file
diff --git a/pro/admin/views/options-page.php b/pro/admin/views/options-page.php
index 5cf982b..a661bff 100644
--- a/pro/admin/views/options-page.php
+++ b/pro/admin/views/options-page.php
@@ -6,7 +6,7 @@ extract($args);
?>