diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js
index 96310d81f..057945977 100755
--- a/app/Resources/static/themes/material/index.js
+++ b/app/Resources/static/themes/material/index.js
@@ -8,7 +8,7 @@ import 'materialize-css/dist/js/materialize';
import '../_global/index';
/* Tools */
-import { initExport, initFilters } from './js/tools';
+import { initExport, initFilters, initRandom } from './js/tools';
/* Import shortcuts */
import './js/shortcuts/main';
@@ -32,8 +32,10 @@ $(document).ready(() => {
format: 'dd/mm/yyyy',
container: 'body',
});
+
initFilters();
initExport();
+ initRandom();
const toggleNav = (toShow, toFocus) => {
$('.nav-panel-actions').hide(100);
diff --git a/app/Resources/static/themes/material/js/tools.js b/app/Resources/static/themes/material/js/tools.js
index 39398fd8a..0b3d30385 100644
--- a/app/Resources/static/themes/material/js/tools.js
+++ b/app/Resources/static/themes/material/js/tools.js
@@ -8,6 +8,7 @@ function initFilters() {
$('#clear_form_filters').on('click', () => {
$('#filters input').val('');
$('#filters :checked').removeAttr('checked');
+
return false;
});
}
@@ -21,4 +22,15 @@ function initExport() {
}
}
-export { initExport, initFilters };
+function initRandom() {
+ // no display if export (ie: entries) not available
+ if ($('div').is('#export')) {
+ $('#button_random').show();
+ }
+}
+
+export {
+ initExport,
+ initFilters,
+ initRandom,
+};
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index dfb5eb549..5c8ecb402 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -253,7 +253,7 @@ class EntryController extends Controller
*
* @param string $type
*
- * @Route("/{type}/random", name="random_entry", requirements={"_locale": "unread|starred|archive|untagged|all"})
+ * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|all"})
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 879e66719..fabb19638 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -325,8 +325,8 @@ class EntryRepository extends EntityRepository
* Find an entry by its url and its owner.
* If it exists, return the entry otherwise return false.
*
- * @param $url
- * @param $userId
+ * @param string $url
+ * @param int $userId
*
* @return Entry|bool
*/
@@ -417,8 +417,8 @@ class EntryRepository extends EntityRepository
/**
* Find all entries by url and owner.
*
- * @param $url
- * @param $userId
+ * @param string $url
+ * @param int $userId
*
* @return array
*/
@@ -434,20 +434,17 @@ class EntryRepository extends EntityRepository
/**
* Returns a random entry, filtering by status.
*
- * @param $userId
- * @param string $type can be unread, archive, starred, etc
+ * @param int $userId
+ * @param string $type Can be unread, archive, starred, etc
*
* @throws \Doctrine\ORM\NoResultException
- * @throws \Doctrine\ORM\NonUniqueResultException
- *
- * @see https://github.com/doctrine/doctrine2/issues/5479#issuecomment-403862934
*
* @return Entry
*/
public function getRandomEntry($userId, $type = '')
{
$qb = $this->getQueryBuilderByUser($userId)
- ->select('MIN(e.id)', 'MAX(e.id)');
+ ->select('e.id');
switch ($type) {
case 'unread':
@@ -465,18 +462,12 @@ class EntryRepository extends EntityRepository
break;
}
- $idLimits = $qb
- ->getQuery()
- ->getOneOrNullResult();
- $randomPossibleIds = rand($idLimits[1], $idLimits[2]);
+ $ids = $qb->getQuery()->getArrayResult();
- return $qb
- ->select('e')
- ->andWhere('e.id >= :random_id')
- ->setParameter('random_id', $randomPossibleIds)
- ->setMaxResults(1)
- ->getQuery()
- ->getSingleResult();
+ // random select one in the list
+ $randomId = $ids[mt_rand(0, \count($ids) - 1)]['id'];
+
+ return $this->find($randomId);
}
/**
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 0099148af..5a770dffb 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Tilføj ny artikel'
search: 'Søg'
filter_entries: 'Filtrer artikler'
+ # random_entry: Jump to a random entry from that list
# export: 'Export'
search_form:
input_label: 'Indtast søgning'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index 5e531b781..2ae8f08ec 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Neuen Artikel hinzufügen'
search: 'Suche'
filter_entries: 'Artikel filtern'
+ # random_entry: Jump to a random entry from that list
export: 'Exportieren'
search_form:
input_label: 'Suchbegriff hier eingeben'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index 2b952bd50..d1d741591 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Add a new entry'
search: 'Search'
filter_entries: 'Filter entries'
+ random_entry: Jump to a random entry from that list
export: 'Export'
search_form:
input_label: 'Enter your search here'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index 2e2fbb936..741d3e9f3 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Añadir un nuevo artículo'
search: 'Buscar'
filter_entries: 'Filtrar los artículos'
+ # random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Introduzca su búsqueda aquí'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index c58bbccb4..2ef5dd528 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'افزودن مقالهٔ تازه'
search: 'جستجو'
filter_entries: 'فیلترکردن مقالهها'
+ # random_entry: Jump to a random entry from that list
export: 'برونبری'
search_form:
input_label: 'جستجوی خود را اینجا بنویسید:'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index c3887f241..7a2029b45 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: "Sauvegarder un nouvel article"
search: "Rechercher"
filter_entries: "Filtrer les articles"
+ random_entry: Aller à un article aléatoire de cette liste
export: "Exporter"
search_form:
input_label: "Saisissez votre terme de recherche"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index c2135ac01..3a4594455 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Aggiungi un nuovo contenuto'
search: 'Cerca'
filter_entries: 'Filtra contenuti'
+ # random_entry: Jump to a random entry from that list
export: 'Esporta'
search_form:
input_label: 'Inserisci qui la tua ricerca'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 6e2c1cf93..9df9e6456 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Enregistrar un novèl article'
search: 'Cercar'
filter_entries: 'Filtrar los articles'
+ # random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Picatz vòstre mot-clau a cercar aquí'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 18156cbea..684c40e28 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Dodaj nowy wpis'
search: 'Szukaj'
filter_entries: 'Filtruj wpisy'
+ # random_entry: Jump to a random entry from that list
export: 'Eksportuj'
search_form:
input_label: 'Wpisz swoje zapytanie tutaj'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index 8493af476..7932d7ab0 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Adicionar uma nova entrada'
search: 'Pesquisa'
filter_entries: 'Filtrar entradas'
+ # random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Digite aqui sua pesquisa'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 8fba13dce..4d091f031 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Introdu un nou articol'
search: 'Căutare'
filter_entries: 'Filtrează articolele'
+ # random_entry: Jump to a random entry from that list
# export: 'Export'
search_form:
input_label: 'Introdu căutarea ta'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
index 56a63b142..cc327ae48 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
@@ -36,6 +36,7 @@ menu:
add_new_entry: 'Добавить новую запись'
search: 'Поиск'
filter_entries: 'Фильтр записей'
+ # random_entry: Jump to a random entry from that list
export: 'Экспорт'
search_form:
input_label: 'Введите текст для поиска'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
index 9f0a65325..148aa5411 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'เพิ่มรายการใหม่'
search: 'ค้นหา'
filter_entries: 'ตัวกรองรายการ'
+ # random_entry: Jump to a random entry from that list
export: 'นำข้อมูลออก'
search_form:
input_label: 'ค้นหาที่นี้'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index a2093223c..6fb9852a3 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -37,6 +37,7 @@ menu:
add_new_entry: 'Yeni bir makale ekle'
search: 'Ara'
filter_entries: 'Filtrele'
+ # random_entry: Jump to a random entry from that list
export: 'Dışa Aktar'
search_form:
input_label: 'Aramak istediğiniz herhangi bir şey yazın'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index f3baae2c7..549d60e7f 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -28,10 +28,12 @@
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
diff --git a/web/wallassets/material.js b/web/wallassets/material.js
index f476dbe7d..7bce51de8 100644
--- a/web/wallassets/material.js
+++ b/web/wallassets/material.js
@@ -1 +1 @@
-!function(e){function __webpack_require__(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}var t={};__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=234)}([function(e,t,n){var i,r;!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,a){function isArrayLike(e){var t=!!e&&"length"in e&&e.length,n=h.type(e);return"function"!==n&&!h.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function winnow(e,t,n){if(h.isFunction(t))return h.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return h.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(w.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,function(e){return u.call(t,e)>-1!==n})}function sibling(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function createOptions(e){var t={};return h.each(e.match(A)||[],function(e,n){t[n]=!0}),t}function completed(){s.removeEventListener("DOMContentLoaded",completed),n.removeEventListener("load",completed),h.ready()}function Data(){this.expando=h.expando+Data.uid++}function dataAttr(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(B,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:F.test(n)?h.parseJSON(n):n)}catch(e){}L.set(e,t,n)}else n=void 0;return n}function adjustCSS(e,t,n,i){var r,a=1,o=20,s=i?function(){return i.cur()}:function(){return h.css(e,t,"")},l=s(),c=n&&n[3]||(h.cssNumber[t]?"":"px"),d=(h.cssNumber[t]||"px"!==c&&+l)&&U.exec(h.css(e,t));if(d&&d[3]!==c){c=c||d[3],n=n||[],d=+l||1;do{a=a||".5",d/=a,h.style(e,t,d+c)}while(a!==(a=s()/l)&&1!==a&&--o)}return n&&(d=+d||+l||0,r=n[1]?d+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=d,i.end=r)),r}function getAll(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&h.nodeName(e,t)?h.merge([e],n):n}function setGlobalEval(e,t){for(var n=0,i=e.length;n-1)r&&r.push(a);else if(c=h.contains(a.ownerDocument,a),o=getAll(u.appendChild(a),"script"),c&&setGlobalEval(o),n)for(d=0;a=o[d++];)W.test(a.type||"")&&n.push(a);return u}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return s.activeElement}catch(e){}}function on(e,t,n,i,r,a){var o,s;if("object"==typeof t){"string"!=typeof n&&(i=i||n,n=void 0);for(s in t)on(e,s,n,i,t[s],a);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=returnFalse;else if(!r)return e;return 1===a&&(o=r,r=function(e){return h().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=h.guid++)),e.each(function(){h.event.add(this,t,r,i,n)})}function manipulationTarget(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function disableScript(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function restoreScript(e){var t=ee.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function cloneCopyEvent(e,t){var n,i,r,a,o,s,l,c;if(1===t.nodeType){if(P.hasData(e)&&(a=P.access(e),o=P.set(t,a),c=a.events)){delete o.handle,o.events={};for(r in c)for(n=0,i=c[r].length;n1&&"string"==typeof g&&!f.checkClone&&J.test(g))return e.each(function(r){var a=e.eq(r);b&&(t[0]=g.call(this,r,a.html())),domManip(a,t,n,i)});if(p&&(r=buildFragment(t,e[0].ownerDocument,!1,e,i),a=r.firstChild,1===r.childNodes.length&&(r=a),a||i)){for(o=h.map(getAll(r,"script"),disableScript),s=o.length;u")).appendTo(t.documentElement),t=ne[0].contentDocument,t.write(),t.close(),n=actualDisplay(e,t),ne.detach()),ie[e]=n),n}function curCSS(e,t,n){var i,r,a,o,s=e.style;return n=n||oe(e),o=n?n.getPropertyValue(t)||n[t]:void 0,""!==o&&void 0!==o||h.contains(e.ownerDocument,e)||(o=h.style(e,t)),n&&!f.pixelMarginRight()&&ae.test(o)&&re.test(t)&&(i=s.width,r=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=i,s.minWidth=r,s.maxWidth=a),void 0!==o?o+"":o}function addGetHookIf(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function vendorPropName(e){if(e in me)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=pe.length;n--;)if((e=pe[n]+t)in me)return e}function setPositiveNumber(e,t,n){var i=U.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function augmentWidthOrHeight(e,t,n,i,r){for(var a=n===(i?"border":"content")?4:"width"===t?1:0,o=0;a<4;a+=2)"margin"===n&&(o+=h.css(e,n+G[a],!0,r)),i?("content"===n&&(o-=h.css(e,"padding"+G[a],!0,r)),"margin"!==n&&(o-=h.css(e,"border"+G[a]+"Width",!0,r))):(o+=h.css(e,"padding"+G[a],!0,r),"padding"!==n&&(o+=h.css(e,"border"+G[a]+"Width",!0,r)));return o}function getWidthOrHeight(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,a=oe(e),o="border-box"===h.css(e,"boxSizing",!1,a);if(r<=0||null==r){if(r=curCSS(e,t,a),(r<0||null==r)&&(r=e.style[t]),ae.test(r))return r;i=o&&(f.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+augmentWidthOrHeight(e,t,n||(o?"border":"content"),i,a)+"px"}function showHide(e,t){for(var n,i,r,a=[],o=0,s=e.length;o=0&&n=0},isPlainObject:function(e){var t;if("object"!==h.type(e)||e.nodeType||h.isWindow(e))return!1;if(e.constructor&&!g.call(e,"constructor")&&!g.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||g.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[m.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=h.trim(e))&&(1===e.indexOf("use strict")?(t=s.createElement("script"),t.text=e,s.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(v,"ms-").replace(_,y)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,i=0;if(isArrayLike(e))for(n=e.length;ii.cacheLength&&delete cache[e.shift()],cache[t+" "]=n}var e=[];return cache}function markFunction(e){return e[y]=!0,e}function assert(e){var t=m.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function addHandle(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function siblingCheck(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function createPositionalPseudo(e){return markFunction(function(t){return t=+t,markFunction(function(n,i){for(var r,a=e([],n.length,t),o=a.length;o--;)n[r=a[o]]&&(n[r]=!(i[r]=n[r]))})})}function testContext(e){return e&&void 0!==e.getElementsByTagName&&e}function setFilters(){}function toSelector(e){for(var t=0,n=e.length,i="";t1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function multipleContexts(e,t,n){for(var i=0,r=t.length;i-1&&(a[c]=!(o[c]=u))}}else b=condense(b===o?b.splice(g,b.length):b),r?r(null,o,b,l):k.apply(o,b)})}function matcherFromTokens(e){for(var t,n,r,a=e.length,o=i.relative[e[0].type],s=o||i.relative[" "],l=o?1:0,d=addCombinator(function(e){return e===t},s,!0),u=addCombinator(function(e){return P(t,e)>-1},s,!0),p=[function(e,n,i){var r=!o&&(i||n!==c)||((t=n).nodeType?d(e,n,i):u(e,n,i));return t=null,r}];l1&&elementMatcher(p),l>1&&toSelector(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,l0,r=e.length>0,a=function(a,o,s,l,d){var u,g,h,b=0,v="0",_=a&&[],y=[],E=c,C=a||r&&i.find.TAG("*",d),T=S+=null==E?1:Math.random()||.1,x=C.length;for(d&&(c=o===m||o||d);v!==x&&null!=(u=C[v]);v++){if(r&&u){for(g=0,o||u.ownerDocument===m||(p(u),s=!f);h=e[g++];)if(h(u,o||m,s)){l.push(u);break}d&&(S=T)}n&&((u=!h&&u)&&b--,a&&_.push(u))}if(b+=v,n&&v!==b){for(g=0;h=t[g++];)h(_,y,o,s);if(a){if(b>0)for(;v--;)_[v]||y[v]||(y[v]=A.call(l));y=condense(y)}k.apply(l,y),d&&!a&&y.length>0&&b+t.length>1&&Sizzle.uniqueSort(l)}return d&&(S=T,c=E),_};return n?markFunction(a):a}var t,n,i,r,a,o,s,l,c,d,u,p,m,g,f,h,b,v,_,y="sizzle"+1*new Date,E=e.document,S=0,C=0,T=createCache(),x=createCache(),w=createCache(),N=function(e,t){return e===t&&(u=!0),0},D=1<<31,M={}.hasOwnProperty,O=[],A=O.pop,I=O.push,k=O.push,R=O.slice,P=function(e,t){for(var n=0,i=e.length;n+~]|"+F+")"+F+"*"),W=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),V=new RegExp(U),j=new RegExp("^"+B+"$"),K={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!==i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=function(){p()};try{k.apply(O=R.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(e){k={apply:O.length?function(e,t){I.apply(e,R.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}n=Sizzle.support={},a=Sizzle.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=Sizzle.setDocument=function(e){var t,r,o=e?e.ownerDocument||e:E;return o!==m&&9===o.nodeType&&o.documentElement?(m=o,g=m.documentElement,f=!a(m),(r=m.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ie,!1):r.attachEvent&&r.attachEvent("onunload",ie)),n.attributes=assert(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=assert(function(e){return e.appendChild(m.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(m.getElementsByClassName),n.getById=assert(function(e){return g.appendChild(e).id=y,!m.getElementsByName||!m.getElementsByName(y).length}),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[r++];)1===n.nodeType&&i.push(n);return i}return a},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},b=[],h=[],(n.qsa=Z.test(m.querySelectorAll))&&(assert(function(e){g.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:value|"+L+")"),e.querySelectorAll("[id~="+y+"-]").length||h.push("~="),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+y+"+*").length||h.push(".#.+[+~]")}),assert(function(e){var t=m.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=Z.test(v=g.matches||g.webkitMatchesSelector||g.mozMatchesSelector||g.oMatchesSelector||g.msMatchesSelector))&&assert(function(e){n.disconnectedMatch=v.call(e,"div"),v.call(e,"[s!='']:x"),b.push("!=",U)}),h=h.length&&new RegExp(h.join("|")),b=b.length&&new RegExp(b.join("|")),t=Z.test(g.compareDocumentPosition),_=t||Z.test(g.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return u=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===m||e.ownerDocument===E&&_(E,e)?-1:t===m||t.ownerDocument===E&&_(E,t)?1:d?P(d,e)-P(d,t):0:4&i?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,i=0,r=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!r||!a)return e===m?-1:t===m?1:r?-1:a?1:d?P(d,e)-P(d,t):0;if(r===a)return siblingCheck(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;o[i]===s[i];)i++;return i?siblingCheck(o[i],s[i]):o[i]===E?-1:s[i]===E?1:0},m):m},Sizzle.matches=function(e,t){return Sizzle(e,null,null,t)},Sizzle.matchesSelector=function(e,t){if((e.ownerDocument||e)!==m&&p(e),t=t.replace(W,"='$1']"),n.matchesSelector&&f&&!w[t+" "]&&(!b||!b.test(t))&&(!h||!h.test(t)))try{var i=v.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return Sizzle(t,m,null,[e]).length>0},Sizzle.contains=function(e,t){return(e.ownerDocument||e)!==m&&p(e),_(e,t)},Sizzle.attr=function(e,t){(e.ownerDocument||e)!==m&&p(e);var r=i.attrHandle[t.toLowerCase()],a=r&&M.call(i.attrHandle,t.toLowerCase())?r(e,t,!f):void 0;return void 0!==a?a:n.attributes||!f?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},Sizzle.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Sizzle.uniqueSort=function(e){var t,i=[],r=0,a=0;if(u=!n.detectDuplicates,d=!n.sortStable&&e.slice(0),e.sort(N),u){for(;t=e[a++];)t===e[a]&&(r=i.push(a));for(;r--;)e.splice(i[r],1)}return d=null,e},r=Sizzle.getText=function(e){var t,n="",i=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},i=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Sizzle.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Sizzle.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(i){var r=Sizzle.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(G," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,d,u,p,m,g,f=a!==o?"nextSibling":"previousSibling",h=t.parentNode,b=s&&t.nodeName.toLowerCase(),v=!l&&!s,_=!1;if(h){if(a){for(;f;){for(p=t;p=p[f];)if(s?p.nodeName.toLowerCase()===b:1===p.nodeType)return!1;g=f="only"===e&&!g&&"nextSibling"}return!0}if(g=[o?h.firstChild:h.lastChild],o&&v){for(p=h,u=p[y]||(p[y]={}),d=u[p.uniqueID]||(u[p.uniqueID]={}),c=d[e]||[],m=c[0]===S&&c[1],_=m&&c[2],p=m&&h.childNodes[m];p=++m&&p&&p[f]||(_=m=0)||g.pop();)if(1===p.nodeType&&++_&&p===t){d[e]=[S,m,_];break}}else if(v&&(p=t,u=p[y]||(p[y]={}),d=u[p.uniqueID]||(u[p.uniqueID]={}),c=d[e]||[],m=c[0]===S&&c[1],_=m),!1===_)for(;(p=++m&&p&&p[f]||(_=m=0)||g.pop())&&((s?p.nodeName.toLowerCase()!==b:1!==p.nodeType)||!++_||(v&&(u=p[y]||(p[y]={}),d=u[p.uniqueID]||(u[p.uniqueID]={}),d[e]=[S,_]),p!==t)););return(_-=r)===i||_%i==0&&_/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||Sizzle.error("unsupported pseudo: "+e);return r[y]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?markFunction(function(e,n){for(var i,a=r(e,t),o=a.length;o--;)i=P(e,a[o]),e[i]=!(n[i]=a[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:markFunction(function(e){var t=[],n=[],i=s(e.replace(z,"$1"));return i[y]?markFunction(function(e,t,n,r){for(var a,o=i(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,r,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}}),has:markFunction(function(e){return function(t){return Sizzle(e,t).length>0}}),contains:markFunction(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||r(t)).indexOf(e)>-1}}),lang:markFunction(function(e){return j.test(e||"")||Sizzle.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===g},focus:function(e){return e===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(e,t){return[t-1]}),eq:createPositionalPseudo(function(e,t,n){return[n<0?n+t:n]}),even:createPositionalPseudo(function(e,t){for(var n=0;n=0;)e.push(i);return e}),gt:createPositionalPseudo(function(e,t,n){for(var i=n<0?n+t:n;++i2&&"ID"===(d=c[0]).type&&n.getById&&9===t.nodeType&&f&&i.relative[c[1].type]){if(!(t=(i.find.ID(d.matches[0].replace(te,ne),t)||[])[0]))return r;m&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(l=K.needsContext.test(e)?0:c.length;l--&&(d=c[l],!i.relative[u=d.type]);)if((p=i.find[u])&&(a=p(d.matches[0].replace(te,ne),J.test(c[0].type)&&testContext(t.parentNode)||t))){if(c.splice(l,1),!(e=a.length&&toSelector(c)))return k.apply(r,a),r;break}}return(m||s(e,g))(a,t,!f,r,!t||J.test(e)&&testContext(t.parentNode)||t),r},n.sortStable=y.split("").sort(N).join("")===y,n.detectDuplicates=!!u,p(),n.sortDetached=assert(function(e){return 1&e.compareDocumentPosition(m.createElement("div"))}),assert(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&assert(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||addHandle("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),assert(function(e){return null==e.getAttribute("disabled")})||addHandle(L,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),Sizzle}(n);h.find=E,h.expr=E.selectors,h.expr[":"]=h.expr.pseudos,h.uniqueSort=h.unique=E.uniqueSort,h.text=E.getText,h.isXMLDoc=E.isXML,h.contains=E.contains;var S=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&h(e).is(n))break;i.push(e)}return i},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=h.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;h.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?h.find.matchesSelector(i,e)?[i]:[]:h.find.matches(e,h.grep(t,function(e){return 1===e.nodeType}))},h.fn.extend({find:function(e){var t,n=this.length,i=[],r=this;if("string"!=typeof e)return this.pushStack(h(e).filter(function(){for(t=0;t1?h.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(winnow(this,e||[],!1))},not:function(e){return this.pushStack(winnow(this,e||[],!0))},is:function(e){return!!winnow(this,"string"==typeof e&&T.test(e)?h(e):e||[],!1).length}});var N,D=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(h.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||N,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:D.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),x.test(i[1])&&h.isPlainObject(t))for(i in t)h.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return r=s.getElementById(i[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=s,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?void 0!==n.ready?n.ready(e):e(h):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))}).prototype=h.fn,N=h(s);var M=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};h.fn.extend({has:function(e){var t=h(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&h.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?h.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?u.call(h(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return S(e,"parentNode")},parentsUntil:function(e,t,n){return S(e,"parentNode",n)},next:function(e){return sibling(e,"nextSibling")},prev:function(e){return sibling(e,"previousSibling")},nextAll:function(e){return S(e,"nextSibling")},prevAll:function(e){return S(e,"previousSibling")},nextUntil:function(e,t,n){return S(e,"nextSibling",n)},prevUntil:function(e,t,n){return S(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return e.contentDocument||h.merge([],e.childNodes)}},function(e,t){h.fn[e]=function(n,i){var r=h.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=h.filter(i,r)),this.length>1&&(O[e]||h.uniqueSort(r),M.test(e)&&r.reverse()),this.pushStack(r)}});var A=/\S+/g;h.Callbacks=function(e){e="string"==typeof e?createOptions(e):h.extend({},e);var t,n,i,r,a=[],o=[],s=-1,l=function(){for(r=e.once,i=t=!0;o.length;s=-1)for(n=o.shift();++s-1;)a.splice(n,1),n<=s&&s--}),this},has:function(e){return e?h.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return r=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return r=o=[],n||(a=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred(function(n){h.each(t,function(t,a){var o=h.isFunction(e[t])&&e[t];r[a[1]](function(){var e=o&&o.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this===i?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?h.extend(e,i):i}},r={};return i.pipe=i.then,h.each(t,function(e,a){var o=a[2],s=a[3];i[a[1]]=o.add,s&&o.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),r[a[0]]=function(){return r[a[0]+"With"](this===r?i:this,arguments),this},r[a[0]+"With"]=o.fireWith}),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,a=l.call(arguments),o=a.length,s=1!==o||e&&h.isFunction(e.promise)?o:0,c=1===s?e:h.Deferred(),d=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?l.call(arguments):r,i===t?c.notifyWith(n,i):--s||c.resolveWith(n,i)}};if(o>1)for(t=new Array(o),n=new Array(o),i=new Array(o);r0||(I.resolveWith(s,[h]),h.fn.triggerHandler&&(h(s).triggerHandler("ready"),h(s).off("ready"))))}}),h.ready.promise=function(e){return I||(I=h.Deferred(),"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(h.ready):(s.addEventListener("DOMContentLoaded",completed),n.addEventListener("load",completed))),I.promise(e)},h.ready.promise();var k=function(e,t,n,i,r,a,o){var s=0,l=e.length,c=null==n;if("object"===h.type(n)){r=!0;for(s in n)k(e,t,s,n[s],!0,a,o)}else if(void 0!==i&&(r=!0,h.isFunction(i)||(o=!0),c&&(o?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(h(e),n)})),t))for(;s-1&&void 0!==n&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}}),h.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=P.get(e,t),n&&(!i||h.isArray(n)?i=P.access(e,t,h.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),i=n.length,r=n.shift(),a=h._queueHooks(e,t),o=function(){h.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete a.stop,r.call(e,o,a)),!i&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return P.get(e,n)||P.access(e,n,{empty:h.Callbacks("once memory").add(function(){P.remove(e,[t+"queue",n])})})}}),h.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length",""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};V.optgroup=V.option,V.tbody=V.tfoot=V.colgroup=V.caption=V.thead,V.th=V.td;var j=/<|?\w+;/;!function(){var e=s.createDocumentFragment(),t=e.appendChild(s.createElement("div")),n=s.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),f.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",f.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var K=/^key/,Q=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,X=/^([^.]*)(?:\.(.+)|)/;h.event={global:{},add:function(e,t,n,i,r){var a,o,s,l,c,d,u,p,m,g,f,b=P.get(e);if(b)for(n.handler&&(a=n,n=a.handler,r=a.selector),n.guid||(n.guid=h.guid++),(l=b.events)||(l=b.events={}),(o=b.handle)||(o=b.handle=function(t){return void 0!==h&&h.event.triggered!==t.type?h.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(A)||[""],c=t.length;c--;)s=X.exec(t[c])||[],m=f=s[1],g=(s[2]||"").split(".").sort(),m&&(u=h.event.special[m]||{},m=(r?u.delegateType:u.bindType)||m,u=h.event.special[m]||{},d=h.extend({type:m,origType:f,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&h.expr.match.needsContext.test(r),namespace:g.join(".")},a),(p=l[m])||(p=l[m]=[],p.delegateCount=0,u.setup&&!1!==u.setup.call(e,i,g,o)||e.addEventListener&&e.addEventListener(m,o)),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,d):p.push(d),h.event.global[m]=!0)},remove:function(e,t,n,i,r){var a,o,s,l,c,d,u,p,m,g,f,b=P.hasData(e)&&P.get(e);if(b&&(l=b.events)){for(t=(t||"").match(A)||[""],c=t.length;c--;)if(s=X.exec(t[c])||[],m=f=s[1],g=(s[2]||"").split(".").sort(),m){for(u=h.event.special[m]||{},m=(i?u.delegateType:u.bindType)||m,p=l[m]||[],s=s[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=p.length;a--;)d=p[a],!r&&f!==d.origType||n&&n.guid!==d.guid||s&&!s.test(d.namespace)||i&&i!==d.selector&&("**"!==i||!d.selector)||(p.splice(a,1),d.selector&&p.delegateCount--,u.remove&&u.remove.call(e,d));o&&!p.length&&(u.teardown&&!1!==u.teardown.call(e,g,b.handle)||h.removeEvent(e,m,b.handle),delete l[m])}else for(m in l)h.event.remove(e,m+t[c],n,i,!0);h.isEmptyObject(l)&&P.remove(e,"handle events")}},dispatch:function(e){e=h.event.fix(e);var t,n,i,r,a,o=[],s=l.call(arguments),c=(P.get(this,"events")||{})[e.type]||[],d=h.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,e)){for(o=h.event.handlers.call(this,e,c),t=0;(r=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,n=0;(a=r.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(a.namespace)||(e.handleObj=a,e.data=a.data,void 0!==(i=((h.event.special[a.origType]||{}).handle||a.handler).apply(r.elem,s))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,r,a,o=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;n-1:h.find(r,this,null,[l]).length),i[r]&&i.push(a);i.length&&o.push({elem:l,handlers:i})}return s]*)\/>/gi,Y=/