summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-05 16:39:28 +0100
committerhorchi <vdr@jwendel.de>2017-03-05 16:39:28 +0100
commite2a48d8701f91b8e24fbe9e99e91eb72a87bb749 (patch)
tree726f70554b4ca985a09ef6e30a7fdc8df089993c /http
downloadvdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.gz
vdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.bz2
git init1.1.103
Diffstat (limited to 'http')
-rw-r--r--http/3rdParty/boilerplate5/css/main_post.min.css1
-rw-r--r--http/3rdParty/boilerplate5/css/main_pre.min.css1
-rw-r--r--http/3rdParty/boilerplate5/css/normalize.min.css1
-rw-r--r--http/3rdParty/fontello/LICENSE.txt75
-rw-r--r--http/3rdParty/fontello/README.txt75
-rw-r--r--http/3rdParty/fontello/config.json350
-rw-r--r--http/3rdParty/fontello/css/animation.css85
-rw-r--r--http/3rdParty/fontello/css/epgd-codes.css47
-rw-r--r--http/3rdParty/fontello/css/epgd-embedded.css100
-rw-r--r--http/3rdParty/fontello/css/epgd-ie7-codes.css47
-rw-r--r--http/3rdParty/fontello/css/epgd-ie7.css58
-rw-r--r--http/3rdParty/fontello/css/epgd.css103
-rw-r--r--http/3rdParty/fontello/demo.html376
-rw-r--r--http/3rdParty/fontello/font/epgd.eotbin0 -> 16972 bytes
-rw-r--r--http/3rdParty/fontello/font/epgd.svg102
-rw-r--r--http/3rdParty/fontello/font/epgd.ttfbin0 -> 16820 bytes
-rw-r--r--http/3rdParty/fontello/font/epgd.woffbin0 -> 10484 bytes
-rw-r--r--http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css5
-rw-r--r--http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.js5
-rw-r--r--http/3rdParty/jquery-2.1.4.min.js4
-rw-r--r--http/3rdParty/jquery-2.2.3.min.js4
-rw-r--r--http/3rdParty/jquery-scrollstop-master/LICENSE.md24
-rw-r--r--http/3rdParty/jquery-scrollstop-master/README.md66
-rw-r--r--http/3rdParty/jquery-scrollstop-master/index.html159
-rw-r--r--http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.js78
-rw-r--r--http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.min.js5
-rw-r--r--http/3rdParty/jquery-scrollstop-master/scrollstop.jquery.json19
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/external/jquery/jquery.js9789
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_100_f5f0e5_1x400.pngbin0 -> 354 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_25_cb842e_1x400.pngbin0 -> 335 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_70_ede4d4_1x400.pngbin0 -> 351 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_100_f4f0ec_1x100.pngbin0 -> 327 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_65_fee4bd_1x100.pngbin0 -> 314 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_75_f5f5b5_1x100.pngbin0 -> 323 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_inset-soft_100_f4f0ec_1x100.pngbin0 -> 403 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_c47a23_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_cb672b_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f08000_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f35f07_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ff7519_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ffffff_256x240.pngbin0 -> 6299 bytes
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/index.html484
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.css1093
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.js12749
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css7
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.js12
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.css701
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css5
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.css410
-rw-r--r--http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css5
-rw-r--r--http/3rdParty/jquery.ui.touch-punch.min.js11
-rw-r--r--http/3rdParty/jqueryUI-download.txt12
-rw-r--r--http/3rdParty/modernizr.custom.js4
-rw-r--r--http/3rdParty/yaMD5/README.md90
-rw-r--r--http/3rdParty/yaMD5/test/lib/ireal-md5.js346
-rw-r--r--http/3rdParty/yaMD5/test/lib/izumo-md5.js206
-rw-r--r--http/3rdParty/yaMD5/test/lib/jbt-md5.js74
-rw-r--r--http/3rdParty/yaMD5/test/lib/jkm-md5.js191
-rw-r--r--http/3rdParty/yaMD5/test/lib/paj-md5.js360
-rw-r--r--http/3rdParty/yaMD5/test/lib/satazor-md5.js600
-rw-r--r--http/3rdParty/yaMD5/test/lib/valums-md5.js218
-rw-r--r--http/3rdParty/yaMD5/test/test.html99
-rw-r--r--http/3rdParty/yaMD5/yamd5.js402
-rw-r--r--http/3rdParty/yaMD5/yamd5.min.js46
-rw-r--r--http/Makefile84
-rw-r--r--http/README77
-rw-r--r--http/custom.sample.css1
-rw-r--r--http/dev-watch.sh22
-rw-r--r--http/src/css/epgd.less1724
-rw-r--r--http/src/css/theme/default.less7
-rw-r--r--http/src/js/1_main.js714
-rw-r--r--http/src/js/5_timerDialog.js640
-rw-r--r--http/src/js/channels.js46
-rw-r--r--http/src/js/epgd3
-rw-r--r--http/src/js/eventDetail.js523
-rw-r--r--http/src/js/pages.editChannels.js313
-rw-r--r--http/src/js/pages.editUser.js96
-rw-r--r--http/src/js/pages.help.js49
-rw-r--r--http/src/js/pages.login.js114
-rw-r--r--http/src/js/pages.magazine.js413
-rw-r--r--http/src/js/pages.now.js135
-rw-r--r--http/src/js/pages.profile.js251
-rw-r--r--http/src/js/pages.records.js453
-rw-r--r--http/src/js/pages.timer.js743
-rw-r--r--http/src/js/vdr.js57
-rw-r--r--http/src/lang/de.js299
-rw-r--r--http/src/lang/hilfe.html303
-rw-r--r--http/tools/less-rhino-1.7.0.js9301
-rw-r--r--http/tools/lessc-rhino-1.7.0.js449
-rw-r--r--http/tools/yuicompressor-2.4.8.jarbin0 -> 787524 bytes
-rw-r--r--http/www/common.js79
-rw-r--r--http/www/epgd.css1554
-rw-r--r--http/www/epgd.js1
-rw-r--r--http/www/favicon.icobin0 -> 596 bytes
-rw-r--r--http/www/font/LICENSE.txt75
-rw-r--r--http/www/font/epgd.eotbin0 -> 16972 bytes
-rw-r--r--http/www/font/epgd.svg102
-rw-r--r--http/www/font/epgd.ttfbin0 -> 16820 bytes
-rw-r--r--http/www/font/epgd.woffbin0 -> 10484 bytes
-rw-r--r--http/www/font/epgd.woff2bin0 -> 8848 bytes
-rw-r--r--http/www/images/169.pngbin0 -> 3590 bytes
-rw-r--r--http/www/images/2kanal.pngbin0 -> 2245 bytes
-rw-r--r--http/www/images/43.pngbin0 -> 2980 bytes
-rw-r--r--http/www/images/TagesTipp_32.pngbin0 -> 3307 bytes
-rw-r--r--http/www/images/Tipp_32.pngbin0 -> 1043 bytes
-rw-r--r--http/www/images/TopTipp_32.pngbin0 -> 1951 bytes
-rw-r--r--http/www/images/animated-overlay.gifbin0 -> 1738 bytes
-rw-r--r--http/www/images/audio_description.pngbin0 -> 3705 bytes
-rw-r--r--http/www/images/dd.pngbin0 -> 2477 bytes
-rw-r--r--http/www/images/epg_icons_24x24_orange.pngbin0 -> 48518 bytes
-rw-r--r--http/www/images/epgd-4x.pngbin0 -> 6243 bytes
-rw-r--r--http/www/images/hd.pngbin0 -> 4412 bytes
-rw-r--r--http/www/images/loader.pngbin0 -> 7531 bytes
-rw-r--r--http/www/images/stereo.pngbin0 -> 3528 bytes
-rw-r--r--http/www/images/sw.pngbin0 -> 3572 bytes
-rw-r--r--http/www/images/thumb-rate1.svg6
-rw-r--r--http/www/images/thumb-rate2.svg6
-rw-r--r--http/www/images/thumb-rate3.svg6
-rw-r--r--http/www/images/thumb-rate4.svg6
-rw-r--r--http/www/images/thumb-rate5.svg6
-rw-r--r--http/www/images/ui-bg_flat_75_aaaaaa_40x100.pngbin0 -> 212 bytes
-rw-r--r--http/www/images/ui-bg_glass_100_f5f0e5_1x400.pngbin0 -> 354 bytes
-rw-r--r--http/www/images/ui-bg_glass_25_cb842e_1x400.pngbin0 -> 335 bytes
-rw-r--r--http/www/images/ui-bg_glass_70_ede4d4_1x400.pngbin0 -> 351 bytes
-rw-r--r--http/www/images/ui-bg_highlight-hard_100_f4f0ec_1x100.pngbin0 -> 327 bytes
-rw-r--r--http/www/images/ui-bg_highlight-hard_65_fee4bd_1x100.pngbin0 -> 314 bytes
-rw-r--r--http/www/images/ui-bg_highlight-hard_75_f5f5b5_1x100.pngbin0 -> 323 bytes
-rw-r--r--http/www/images/ui-bg_inset-soft_100_f4f0ec_1x100.pngbin0 -> 403 bytes
-rw-r--r--http/www/images/ui-icons_c47a23_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/www/images/ui-icons_cb672b_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/www/images/ui-icons_f08000_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/www/images/ui-icons_f35f07_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/www/images/ui-icons_ff7519_256x240.pngbin0 -> 4549 bytes
-rw-r--r--http/www/images/ui-icons_ffffff_256x240.pngbin0 -> 6299 bytes
-rw-r--r--http/www/images/untertitel.pngbin0 -> 2349 bytes
-rw-r--r--http/www/index.html28
-rw-r--r--http/www/lang/de.js299
-rw-r--r--http/www/lang/hilfe.html303
138 files changed, 48992 insertions, 0 deletions
diff --git a/http/3rdParty/boilerplate5/css/main_post.min.css b/http/3rdParty/boilerplate5/css/main_post.min.css
new file mode 100644
index 0000000..19f8328
--- /dev/null
+++ b/http/3rdParty/boilerplate5/css/main_post.min.css
@@ -0,0 +1 @@
+.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{*zoom:1}@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}} \ No newline at end of file
diff --git a/http/3rdParty/boilerplate5/css/main_pre.min.css b/http/3rdParty/boilerplate5/css/main_pre.min.css
new file mode 100644
index 0000000..a7baa33
--- /dev/null
+++ b/http/3rdParty/boilerplate5/css/main_pre.min.css
@@ -0,0 +1 @@
+/*! HTML5 Boilerplate v5.0 | MIT License | http://h5bp.com/ */html{color:#222;font-size:1em;line-height:1.4}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}audio,canvas,iframe,img,svg,video{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.browserupgrade{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0} \ No newline at end of file
diff --git a/http/3rdParty/boilerplate5/css/normalize.min.css b/http/3rdParty/boilerplate5/css/normalize.min.css
new file mode 100644
index 0000000..f6e0b65
--- /dev/null
+++ b/http/3rdParty/boilerplate5/css/normalize.min.css
@@ -0,0 +1 @@
+/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} \ No newline at end of file
diff --git a/http/3rdParty/fontello/LICENSE.txt b/http/3rdParty/fontello/LICENSE.txt
new file mode 100644
index 0000000..6a22557
--- /dev/null
+++ b/http/3rdParty/fontello/LICENSE.txt
@@ -0,0 +1,75 @@
+Font license info
+
+
+## Fontelico
+
+ Copyright (C) 2012 by Fontello project
+
+ Author: Crowdsourced, for Fontello project
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://fontello.com
+
+
+## Font Awesome
+
+ Copyright (C) 2016 by Dave Gandy
+
+ Author: Dave Gandy
+ License: SIL ()
+ Homepage: http://fortawesome.github.com/Font-Awesome/
+
+
+## Entypo
+
+ Copyright (C) 2012 by Daniel Bruce
+
+ Author: Daniel Bruce
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://www.entypo.com
+
+
+## Typicons
+
+ (c) Stephen Hutchings 2012
+
+ Author: Stephen Hutchings
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://typicons.com/
+
+
+## Modern Pictograms
+
+ Copyright (c) 2012 by John Caserta. All rights reserved.
+
+ Author: John Caserta
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://thedesignoffice.org/project/modern-pictograms/
+
+
+## Zocial
+
+ Copyright (C) 2012 by Sam Collins
+
+ Author: Sam Collins
+ License: MIT (http://opensource.org/licenses/mit-license.php)
+ Homepage: http://zocial.smcllns.com/
+
+
+## Elusive
+
+ Copyright (C) 2013 by Aristeides Stathopoulos
+
+ Author: Aristeides Stathopoulos
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://aristeides.com/
+
+
+## Linecons
+
+ Copyright (C) 2013 by Designmodo
+
+ Author: Designmodo for Smashing Magazine
+ License: CC BY ()
+ Homepage: http://designmodo.com/linecons-free/
+
+
diff --git a/http/3rdParty/fontello/README.txt b/http/3rdParty/fontello/README.txt
new file mode 100644
index 0000000..beaab33
--- /dev/null
+++ b/http/3rdParty/fontello/README.txt
@@ -0,0 +1,75 @@
+This webfont is generated by http://fontello.com open source project.
+
+
+================================================================================
+Please, note, that you should obey original font licenses, used to make this
+webfont pack. Details available in LICENSE.txt file.
+
+- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
+ site in "About" section.
+
+- If your project is open-source, usually, it will be ok to make LICENSE.txt
+ file publicly available in your repository.
+
+- Fonts, used in Fontello, don't require a clickable link on your site.
+ But any kind of additional authors crediting is welcome.
+================================================================================
+
+
+Comments on archive content
+---------------------------
+
+- /font/* - fonts in different formats
+
+- /css/* - different kinds of css, for all situations. Should be ok with
+ twitter bootstrap. Also, you can skip <i> style and assign icon classes
+ directly to text elements, if you don't mind about IE7.
+
+- demo.html - demo file, to show your webfont content
+
+- LICENSE.txt - license info about source fonts, used to build your one.
+
+- config.json - keeps your settings. You can import it back into fontello
+ anytime, to continue your work
+
+
+Why so many CSS files ?
+-----------------------
+
+Because we like to fit all your needs :)
+
+- basic file, <your_font_name>.css - is usually enough, it contains @font-face
+ and character code definitions
+
+- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
+ directly into html
+
+- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
+ rules, but still wish to benefit from css generation. That can be very
+ convenient for automated asset build systems. When you need to update font -
+ no need to manually edit files, just override old version with archive
+ content. See fontello source code for examples.
+
+- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
+ CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
+ We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
+ server headers. But if you ok with dirty hack - this file is for you. Note,
+ that data url moved to separate @font-face to avoid problems with <IE9, when
+ string is too long.
+
+- animate.css - use it to get ideas about spinner rotation animation.
+
+
+Attention for server setup
+--------------------------
+
+You MUST setup server to reply with proper `mime-types` for font files -
+otherwise some browsers will fail to show fonts.
+
+Usually, `apache` already has necessary settings, but `nginx` and other
+webservers should be tuned. Here is list of mime types for our file extensions:
+
+- `application/vnd.ms-fontobject` - eot
+- `application/x-font-woff` - woff
+- `application/x-font-ttf` - ttf
+- `image/svg+xml` - svg
diff --git a/http/3rdParty/fontello/config.json b/http/3rdParty/fontello/config.json
new file mode 100644
index 0000000..ea91e9f
--- /dev/null
+++ b/http/3rdParty/fontello/config.json
@@ -0,0 +1,350 @@
+{
+ "name": "epgd",
+ "css_prefix_text": "i-",
+ "css_use_suffix": false,
+ "hinting": true,
+ "units_per_em": 1000,
+ "ascent": 850,
+ "glyphs": [
+ {
+ "uid": "9bc2902722abb366a213a052ade360bc",
+ "css": "progress",
+ "code": 59392,
+ "src": "fontelico"
+ },
+ {
+ "uid": "0f99ab40ab0b4d64a74f2d0deeb03e42",
+ "css": "record",
+ "code": 59393,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "5211af474d3a9848f67f945e2ccaf143",
+ "css": "cancel",
+ "code": 59394,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "ce3cf091d6ebd004dd0b52d24074e6e3",
+ "css": "help",
+ "code": 59395,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "17ebadd1e3f274ff0205601eef7b9cc4",
+ "css": "help-circled",
+ "code": 59396,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "e82cedfa1d5f15b00c5a81c9bd731ea2",
+ "css": "info-circled",
+ "code": 59397,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "3d4ea8a78dc34efe891f3a0f3d961274",
+ "css": "info",
+ "code": 59398,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "e15f0d620a7897e2035c18c80142f6d9",
+ "css": "link-ext",
+ "code": 59399,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "f48ae54adfb27d8ada53d0fd9e34ee10",
+ "css": "trash",
+ "code": 59400,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "b091a8bd0fdade174951f17d936f51e4",
+ "css": "folder-closed",
+ "code": 59401,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "6533bdc16ab201eb3f3b27ce989cab33",
+ "css": "folder-opened",
+ "code": 59402,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "559647a6f430b3aeadbecd67194451dd",
+ "css": "menu",
+ "code": 59403,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "3a00327e61b997b58518bd43ed83c3df",
+ "css": "login",
+ "code": 59404,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "0d20938846444af8deb1920dc85a29fb",
+ "css": "logout",
+ "code": 59405,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "2d6150442079cbda7df64522dc24f482",
+ "css": "down-dir",
+ "code": 59406,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "80cd1022bd9ea151d554bec1fa05f2de",
+ "css": "up-dir",
+ "code": 59407,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "9dc654095085167524602c9acc0c5570",
+ "css": "left-dir",
+ "code": 59408,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "fb1c799ffe5bf8fb7f8bcb647c8fe9e6",
+ "css": "right-dir",
+ "code": 59409,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "a73c5deb486c8d66249811642e5d719a",
+ "css": "refresh",
+ "code": 59410,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "dd6c6b221a1088ff8a9b9cd32d0b3dd5",
+ "css": "check",
+ "code": 59411,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "4b900d04e8ab8c82f080c1cfbac5772c",
+ "css": "check-empty",
+ "code": 59412,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "f4445feb55521283572ee88bc304f928",
+ "css": "save",
+ "code": 59413,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "94103e1b3f1e8cf514178ec5912b4469",
+ "css": "sort-down",
+ "code": 59414,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "65b3ce930627cabfb6ac81ac60ec5ae4",
+ "css": "sort-up",
+ "code": 59415,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "3ed68ae14e9cde775121954242a412b2",
+ "css": "sort-name-up",
+ "code": 59416,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "6586267200a42008a9fc0a1bf7ac06c7",
+ "css": "sort-name-down",
+ "code": 59417,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "c9b928dc82d7d77033644fcf59dca3b3",
+ "css": "flashlight",
+ "code": 59418,
+ "src": "entypo"
+ },
+ {
+ "uid": "7f6916533c0842b6cec699fd773693d3",
+ "css": "wait",
+ "code": 59419,
+ "src": "entypo"
+ },
+ {
+ "uid": "cb13afd4722a849d48056540bb74c47e",
+ "css": "play",
+ "code": 59420,
+ "src": "entypo"
+ },
+ {
+ "uid": "48f2e18872fe74d4579a4c8a1527fc1e",
+ "css": "stop",
+ "code": 59421,
+ "src": "entypo"
+ },
+ {
+ "uid": "d8d378d0ce413f231dfa37592e39c227",
+ "css": "pause",
+ "code": 59422,
+ "src": "entypo"
+ },
+ {
+ "uid": "0afbb00323696f49e9c47f4d9fe6390b",
+ "css": "to-end",
+ "code": 59423,
+ "src": "entypo"
+ },
+ {
+ "uid": "ceefe7653a4f6edaacce9e7f196cec5a",
+ "css": "to-start",
+ "code": 59424,
+ "src": "entypo"
+ },
+ {
+ "uid": "18f7c393e3532e40edd45607c9d99988",
+ "css": "forward",
+ "code": 59425,
+ "src": "entypo"
+ },
+ {
+ "uid": "85806fd8ab907f45d34f976354a0df23",
+ "css": "rewind",
+ "code": 59426,
+ "src": "entypo"
+ },
+ {
+ "uid": "40c9502d45c736a0a6ec45e6fbc28656",
+ "css": "ok",
+ "code": 59427,
+ "src": "typicons"
+ },
+ {
+ "uid": "8f28d948aa6379b1a69d2a090e7531d4",
+ "css": "warning",
+ "code": 59428,
+ "src": "typicons"
+ },
+ {
+ "uid": "0ohst63cgq1mf1syayvfl8mphms8dbes",
+ "css": "clock",
+ "code": 59429,
+ "src": "modernpics"
+ },
+ {
+ "uid": "58b5f27abdf85c2b2b8db2770d61162d",
+ "css": "buffer",
+ "code": 59430,
+ "src": "zocial"
+ },
+ {
+ "uid": "9e0404ba55575a540164db9a5ad511df",
+ "css": "doc-new",
+ "code": 59431,
+ "src": "elusive"
+ },
+ {
+ "uid": "9725db89b610135dc76cd8a21afffa83",
+ "css": "search",
+ "code": 59432,
+ "src": "linecons"
+ },
+ {
+ "uid": "2aeb4987b469d22fcb8b471b6d2cdfff",
+ "css": "edit",
+ "code": 59433,
+ "src": "linecons"
+ },
+ {
+ "uid": "7697f1734d53461137f05faab3f79cf0",
+ "css": "tv",
+ "code": 59434,
+ "src": "linecons"
+ },
+ {
+ "uid": "2f518b428fe0bc6fd682e666bd169427",
+ "css": "thumb-rate-up",
+ "code": 59435,
+ "src": "custom_icons",
+ "selected": true,
+ "svg": {
+ "path": "M1204.3 901.1C1199 982.2 1190.2 1028.8 1173.1 1065.4 1146.9 1121.9 1069.7 1209.8 1022.1 1237.5 992.2 1254.9 919.2 1272.6 874.3 1273.3 830.7 1274 820.4 1269 798.6 1236.7 772.6 1198.6 743 1173.2 699.2 1151.7 640.6 1122.9 627.2 1104.7 626.8 1052.8 626.4 1011 614.8 990.2 575.5 961.2 524.3 923.3 497 888.5 488.9 851 482.2 801.6 522.2 750.1 505.6 701.6 475.8 675.9 449.8 657.2 424.7 626.2 391.9 561.6 415.2 467.4 473.5 429.7 507.8 413 561.3 400.4 621.8 394.7 683.8 389 710.3 380 765.8 345.8 835.6 308.2 877.1 285.9 971.3 285L976.9 161.1C896 83.4 882.8 22 911-84.4 938.8-166.1 932.8-228.9 1017.6-269 1061-287 1094.3-290.3 1129.6-280.1 1189.4-262.7 1228.5-233.3 1249.7-189.9 1289.1-109 1295.2 65.2 1263.7 216.5 1244.9 279.5 1255.3 337.7 1283.5 395.6 1324 496.6 1306.2 518.9 1340.8 548.4 1246.6 696.2 1218.4 723.4 1204.2 901.3ZM1239 394.2C1208.3 336.7 1212.3 269.2 1227.8 208 1251.9 83.8 1267-78.3 1208.9-193 1185.3-227.3 1129.6-255 1084.2-255 976.3-252.1 973.6-171.2 948.4-89.1 928.9-45.5 927.2 7.7 947.3 51.4 985.9 125.8 1064.6 160.3 1126.2 211.2 1088.6 217 1053.8 200.2 1019.5 187.6L1023.9 297.8C1139.3 351.3 1147.6 455.2 1104.7 562.1 1143.9 591.1 1179.1 645.4 1178.6 723.3 1199.8 663.1 1249.7 614.9 1271.3 555.3 1284.7 495.4 1266.8 445.2 1239.1 394.2ZM971.9 874.5C930 885.7 889.4 889.8 898 881.9 900.3 879.7 928.9 866 961.4 851.5 1115.1 804.5 1197.7 610.1 1006.5 572.2 915 571 809.3 667.2 721.9 614.4 775.8 624.6 822.7 601.7 870.5 578.9 930.9 548.9 961.4 540.7 1014.1 540.5 1085.4 536.1 1083.7 457.8 1070 404.3 994.3 269.5 850.3 337 747.2 387.3 690.4 415.7 661.7 423.7 580.6 433.6 487 439.7 448.8 479.4 446.8 577.2 444.5 639.2 543.7 649.4 545.4 703.2 543.4 746.4 530.7 788.3 527.4 831.3 527.2 870.8 551.3 901.2 606.7 931.6 649.9 955.3 655 964.4 658.9 1024.6 660.5 1049.7 663.7 1073.2 665.9 1076.9 734.7 1125 776.1 1136.5 830.8 1210.1 914.7 1240.6 1094 1183.4 1075.5 1068.5 1000.3 1076.2 931.9 1080.6 875.2 1036.7 898.6 1031 922.5 1031.6 946.3 1032.9 1149.4 1086.1 1217.8 789.8 972 874.6Z",
+ "width": 1727
+ },
+ "search": [
+ "thumb-rate-up"
+ ]
+ },
+ {
+ "uid": "971842913945f59c7f3cf11e75e1e4f1",
+ "css": "flash-outline",
+ "code": 59436,
+ "src": "typicons"
+ },
+ {
+ "uid": "3ab229dd9bccaaaf6c71096da4b72c04",
+ "css": "error",
+ "code": 59437,
+ "src": "elusive"
+ },
+ {
+ "uid": "97b8d7283a173b3bba043e9738a5fbdc",
+ "css": "thumb-rate-up",
+ "code": 59393,
+ "src": "custom_icons",
+ "selected": false,
+ "svg": {
+ "path": "M971.9 874.5L972 874.6C1217.8 789.8 1149.4 1086.1 946.3 1032.9 922.5 1031.6 898.6 1031 875.2 1036.7 931.9 1080.6 1000.3 1076.2 1075.5 1068.5 1094 1183.4 914.7 1240.6 830.8 1210.1 776.1 1136.5 734.7 1125 665.9 1076.9 663.7 1073.2 660.5 1049.7 658.9 1024.6 655 964.4 649.9 955.3 606.7 931.6 551.3 901.2 527.2 870.8 527.4 831.3 530.7 788.3 543.4 746.4 545.4 703.2 543.7 649.4 444.5 639.2 446.8 577.2 448.8 479.4 487 439.7 580.6 433.6 661.7 423.7 690.4 415.7 747.2 387.3 850.3 337 994.3 269.5 1070 404.3 1083.7 457.8 1085.4 536.1 1014.1 540.5 961.4 540.7 930.9 548.9 870.5 578.9 822.7 601.7 775.8 624.6 721.9 614.4 809.3 667.2 915 571 1006.5 572.2 1197.7 610.1 1115.1 804.5 961.4 851.5 928.9 866 900.3 879.7 898 881.9 889.4 889.8 930 885.7 971.9 874.5ZM1239 394.2L1239.1 394.2C1266.8 445.2 1284.7 495.4 1271.3 555.3 1249.7 614.9 1199.8 663.1 1178.6 723.3 1179.1 645.4 1143.9 591.1 1104.7 562.1 1147.6 455.2 1139.3 351.3 1023.9 297.8L1019.5 187.6C1053.8 200.2 1088.6 217 1126.2 211.2 1064.6 160.3 985.9 125.8 947.3 51.4 927.2 7.7 928.9-45.5 948.4-89.1 973.6-171.2 976.3-252.1 1084.2-255 1129.6-255 1185.3-227.3 1208.9-193 1267-78.3 1251.9 83.8 1227.8 208 1212.3 269.2 1208.3 336.7 1239 394.2ZM1204.3 901.1L1204.2 901.3C1218.4 723.4 1246.6 696.2 1340.8 548.4 1306.2 518.9 1324 496.6 1283.5 395.6 1255.3 337.7 1244.9 279.5 1263.7 216.5 1295.2 65.2 1289.1-109 1249.7-189.9 1228.5-233.3 1189.4-262.7 1129.6-280.1 1094.3-290.3 1061-287 1017.6-269 932.8-228.9 938.8-166.1 911-84.4 882.8 22 896 83.4 976.9 161.1L971.3 285C877.1 285.9 835.6 308.2 765.8 345.8 710.3 380 683.8 389 621.8 394.7 561.3 400.4 507.8 413 473.5 429.7 415.2 467.4 391.9 561.6 424.7 626.2 449.8 657.2 475.8 675.9 505.6 701.6 522.2 750.1 482.2 801.6 488.9 851 497 888.5 524.3 923.3 575.5 961.2 614.8 990.2 626.4 1011 626.8 1052.8 627.2 1104.7 640.6 1122.9 699.2 1151.7 743 1173.2 772.6 1198.6 798.6 1236.7 820.4 1269 830.7 1274 874.3 1273.3 919.2 1272.6 992.2 1254.9 1022.1 1237.5 1069.7 1209.8 1146.9 1121.9 1173.1 1065.4 1190.2 1028.8 1199 982.2 1204.3 901.1Z",
+ "width": 1727
+ },
+ "search": [
+ "thumb-rate-up"
+ ]
+ },
+ {
+ "uid": "ec35e3afe47c84e7b9dfd728517b7c74",
+ "css": "thumb-rate-up",
+ "code": 59394,
+ "src": "custom_icons",
+ "selected": false,
+ "svg": {
+ "path": "M824.4 1236.6C1196.5 1253.3 1155 965.4 1196.3 738.4 1241.4 692.9 1296.6 633.6 1302.4 545.9 1284.3 449.8 1270.7 379.8 1230.8 258.6 1295.2-179.7 1226.4-292 1033.9-261.6 967-233.1 842.9-0.1 992 141.5L994.3 290.8C900.6 296.3 839.4 311.8 690.1 393.3 571.1 404.4 432.4 441.7 427.2 543.3 422.5 612.5 470.7 645.4 511.3 684.4 512.7 745.5 513.2 804.7 507.5 864.7 529.7 929.8 646.7 966 647.6 1078.2 684.3 1136.6 765.2 1183.9 824.4 1236.6Z",
+ "width": 1727
+ },
+ "search": [
+ "thumb-rate-up"
+ ]
+ },
+ {
+ "uid": "1a92f9fdade31855ab6e47ba357b0095",
+ "css": "thumb-rate-up",
+ "code": 59395,
+ "src": "custom_icons",
+ "selected": false,
+ "svg": {
+ "path": "M824.4 1236.6C1196.5 1253.3 1155 965.4 1196.3 738.4 1241.4 692.9 1296.6 633.6 1302.4 545.9 1284.3 449.8 1270.7 379.8 1230.8 258.6 1295.2-179.7 1226.4-292 1033.9-261.6 967-233.1 842.9-0.1 992 141.5L994.3 290.8C900.6 296.3 839.4 311.8 690.1 393.3 571.1 404.4 432.4 441.7 427.2 543.3 422.5 612.5 470.7 645.4 511.3 684.4 512.7 745.5 513.2 804.7 507.5 864.7 529.7 929.8 646.7 966 647.6 1078.2 684.3 1136.6 765.2 1183.9 824.4 1236.6ZM1204.3 901.1C1199 982.2 1190.2 1028.8 1173.1 1065.4 1146.9 1121.9 1069.7 1209.8 1022.1 1237.5 992.2 1254.9 919.2 1272.6 874.3 1273.3 830.7 1274 820.4 1269 798.6 1236.7 772.6 1198.6 743 1173.2 699.2 1151.7 640.6 1122.9 627.2 1104.7 626.8 1052.8 626.4 1011 614.8 990.2 575.5 961.2 524.3 923.3 497 888.5 488.9 851 482.2 801.6 522.2 750.1 505.6 701.6 475.8 675.9 449.8 657.2 424.7 626.2 391.9 561.6 415.2 467.4 473.5 429.7 507.8 413 561.3 400.4 621.8 394.7 683.8 389 710.3 380 765.8 345.8 835.6 308.2 877.1 285.9 971.3 285L976.9 161.1C896 83.4 882.8 22 911-84.4 938.8-166.1 932.8-228.9 1017.6-269 1061-287 1094.3-290.3 1129.6-280.1 1189.4-262.7 1228.5-233.3 1249.7-189.9 1289.1-109 1295.2 65.2 1263.7 216.5 1244.9 279.5 1255.3 337.7 1283.5 395.6 1324 496.6 1306.2 518.9 1340.8 548.4 1246.6 696.2 1218.4 723.4 1204.2 901.3ZM1239 394.2C1208.3 336.7 1212.3 269.2 1227.8 208 1251.9 83.8 1267-78.3 1208.9-193 1185.3-227.3 1129.6-255 1084.2-255 976.3-252.1 973.6-171.2 948.4-89.1 928.9-45.5 927.2 7.7 947.3 51.4 985.9 125.8 1064.6 160.3 1126.2 211.2 1088.6 217 1053.8 200.2 1019.5 187.6L1023.9 297.8C1139.3 351.3 1147.6 455.2 1104.7 562.1 1143.9 591.1 1179.1 645.4 1178.6 723.3 1199.8 663.1 1249.7 614.9 1271.3 555.3 1284.7 495.4 1266.8 445.2 1239.1 394.2ZM971.9 874.5C930 885.7 889.4 889.8 898 881.9 900.3 879.7 928.9 866 961.4 851.5 1115.1 804.5 1197.7 610.1 1006.5 572.2 915 571 809.3 667.2 721.9 614.4 775.8 624.6 822.7 601.7 870.5 578.9 930.9 548.9 961.4 540.7 1014.1 540.5 1085.4 536.1 1083.7 457.8 1070 404.3 994.3 269.5 850.3 337 747.2 387.3 690.4 415.7 661.7 423.7 580.6 433.6 487 439.7 448.8 479.4 446.8 577.2 444.5 639.2 543.7 649.4 545.4 703.2 543.4 746.4 530.7 788.3 527.4 831.3 527.2 870.8 551.3 901.2 606.7 931.6 649.9 955.3 655 964.4 658.9 1024.6 660.5 1049.7 663.7 1073.2 665.9 1076.9 734.7 1125 776.1 1136.5 830.8 1210.1 914.7 1240.6 1094 1183.4 1075.5 1068.5 1000.3 1076.2 931.9 1080.6 875.2 1036.7 898.6 1031 922.5 1031.6 946.3 1032.9 1149.4 1086.1 1217.8 789.8 972 874.6Z",
+ "width": 1727
+ },
+ "search": [
+ "thumb-rate-up"
+ ]
+ },
+ {
+ "uid": "373d597841b9e4db4979e00ad49d58a1",
+ "css": "thumb-rate-up",
+ "code": 59396,
+ "src": "custom_icons",
+ "selected": false,
+ "svg": {
+ "path": "M824.4 1236.6C1196.5 1253.3 1155 965.4 1196.3 738.4 1241.4 692.9 1296.6 633.6 1302.4 545.9 1284.3 449.8 1270.7 379.8 1230.8 258.6 1295.2-179.7 1226.4-292 1033.9-261.6 967-233.1 842.9-0.1 992 141.5L994.3 290.8C900.6 296.3 839.4 311.8 690.1 393.3 571.1 404.4 432.4 441.7 427.2 543.3 422.5 612.5 470.7 645.4 511.3 684.4 512.7 745.5 513.2 804.7 507.5 864.7 529.7 929.8 646.7 966 647.6 1078.2 684.3 1136.6 765.2 1183.9 824.4 1236.6ZM1204.3 901.1C1199 982.2 1190.2 1028.8 1173.1 1065.4 1146.9 1121.9 1069.7 1209.8 1022.1 1237.5 992.2 1254.9 919.2 1272.6 874.3 1273.3 830.7 1274 820.4 1269 798.6 1236.7 772.6 1198.6 743 1173.2 699.2 1151.7 640.6 1122.9 627.2 1104.7 626.8 1052.8 626.4 1011 614.8 990.2 575.5 961.2 524.3 923.3 497 888.5 488.9 851 482.2 801.6 522.2 750.1 505.6 701.6 475.8 675.9 449.8 657.2 424.7 626.2 391.9 561.6 415.2 467.4 473.5 429.7 507.8 413 561.3 400.4 621.8 394.7 683.8 389 710.3 380 765.8 345.8 835.6 308.2 877.1 285.9 971.3 285L976.9 161.1C896 83.4 882.8 22 911-84.4 938.8-166.1 932.8-228.9 1017.6-269 1061-287 1094.3-290.3 1129.6-280.1 1189.4-262.7 1228.5-233.3 1249.7-189.9 1289.1-109 1295.2 65.2 1263.7 216.5 1244.9 279.5 1255.3 337.7 1283.5 395.6 1324 496.6 1306.2 518.9 1340.8 548.4 1246.6 696.2 1218.4 723.4 1204.2 901.3ZM1239 394.2C1208.3 336.7 1212.3 269.2 1227.8 208 1251.9 83.8 1267-78.3 1208.9-193 1185.3-227.3 1129.6-255 1084.2-255 976.3-252.1 973.6-171.2 948.4-89.1 928.9-45.5 927.2 7.7 947.3 51.4 985.9 125.8 1064.6 160.3 1126.2 211.2 1088.6 217 1053.8 200.2 1019.5 187.6L1023.9 297.8C1139.3 351.3 1147.6 455.2 1104.7 562.1 1143.9 591.1 1179.1 645.4 1178.6 723.3 1199.8 663.1 1249.7 614.9 1271.3 555.3 1284.7 495.4 1266.8 445.2 1239.1 394.2ZM971.9 874.5C930 885.7 889.4 889.8 898 881.9 900.3 879.7 928.9 866 961.4 851.5 1115.1 804.5 1197.7 610.1 1006.5 572.2 915 571 809.3 667.2 721.9 614.4 775.8 624.6 822.7 601.7 870.5 578.9 930.9 548.9 961.4 540.7 1014.1 540.5 1085.4 536.1 1083.7 457.8 1070 404.3 994.3 269.5 850.3 337 747.2 387.3 690.4 415.7 661.7 423.7 580.6 433.6 487 439.7 448.8 479.4 446.8 577.2 444.5 639.2 543.7 649.4 545.4 703.2 543.4 746.4 530.7 788.3 527.4 831.3 527.2 870.8 551.3 901.2 606.7 931.6 649.9 955.3 655 964.4 658.9 1024.6 660.5 1049.7 663.7 1073.2 665.9 1076.9 734.7 1125 776.1 1136.5 830.8 1210.1 914.7 1240.6 1094 1183.4 1075.5 1068.5 1000.3 1076.2 931.9 1080.6 875.2 1036.7 898.6 1031 922.5 1031.6 946.3 1032.9 1149.4 1086.1 1217.8 789.8 972 874.6Z",
+ "width": 1727
+ },
+ "search": [
+ "thumb-rate-up"
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/http/3rdParty/fontello/css/animation.css b/http/3rdParty/fontello/css/animation.css
new file mode 100644
index 0000000..ac5a956
--- /dev/null
+++ b/http/3rdParty/fontello/css/animation.css
@@ -0,0 +1,85 @@
+/*
+ Animation example, for spinners
+*/
+.animate-spin {
+ -moz-animation: spin 2s infinite linear;
+ -o-animation: spin 2s infinite linear;
+ -webkit-animation: spin 2s infinite linear;
+ animation: spin 2s infinite linear;
+ display: inline-block;
+}
+@-moz-keyframes spin {
+ 0% {
+ -moz-transform: rotate(0deg);
+ -o-transform: rotate(0deg);
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ -moz-transform: rotate(359deg);
+ -o-transform: rotate(359deg);
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+@-webkit-keyframes spin {
+ 0% {
+ -moz-transform: rotate(0deg);
+ -o-transform: rotate(0deg);
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ -moz-transform: rotate(359deg);
+ -o-transform: rotate(359deg);
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+@-o-keyframes spin {
+ 0% {
+ -moz-transform: rotate(0deg);
+ -o-transform: rotate(0deg);
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ -moz-transform: rotate(359deg);
+ -o-transform: rotate(359deg);
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+@-ms-keyframes spin {
+ 0% {
+ -moz-transform: rotate(0deg);
+ -o-transform: rotate(0deg);
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ -moz-transform: rotate(359deg);
+ -o-transform: rotate(359deg);
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+@keyframes spin {
+ 0% {
+ -moz-transform: rotate(0deg);
+ -o-transform: rotate(0deg);
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ -moz-transform: rotate(359deg);
+ -o-transform: rotate(359deg);
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
diff --git a/http/3rdParty/fontello/css/epgd-codes.css b/http/3rdParty/fontello/css/epgd-codes.css
new file mode 100644
index 0000000..98daddc
--- /dev/null
+++ b/http/3rdParty/fontello/css/epgd-codes.css
@@ -0,0 +1,47 @@
+
+.i-progress:before { content: '\e800'; } /* '' */
+.i-record:before { content: '\e801'; } /* '' */
+.i-cancel:before { content: '\e802'; } /* '' */
+.i-help:before { content: '\e803'; } /* '' */
+.i-help-circled:before { content: '\e804'; } /* '' */
+.i-info-circled:before { content: '\e805'; } /* '' */
+.i-info:before { content: '\e806'; } /* '' */
+.i-link-ext:before { content: '\e807'; } /* '' */
+.i-trash:before { content: '\e808'; } /* '' */
+.i-folder-closed:before { content: '\e809'; } /* '' */
+.i-folder-opened:before { content: '\e80a'; } /* '' */
+.i-menu:before { content: '\e80b'; } /* '' */
+.i-login:before { content: '\e80c'; } /* '' */
+.i-logout:before { content: '\e80d'; } /* '' */
+.i-down-dir:before { content: '\e80e'; } /* '' */
+.i-up-dir:before { content: '\e80f'; } /* '' */
+.i-left-dir:before { content: '\e810'; } /* '' */
+.i-right-dir:before { content: '\e811'; } /* '' */
+.i-refresh:before { content: '\e812'; } /* '' */
+.i-check:before { content: '\e813'; } /* '' */
+.i-check-empty:before { content: '\e814'; } /* '' */
+.i-save:before { content: '\e815'; } /* '' */
+.i-sort-down:before { content: '\e816'; } /* '' */
+.i-sort-up:before { content: '\e817'; } /* '' */
+.i-sort-name-up:before { content: '\e818'; } /* '' */
+.i-sort-name-down:before { content: '\e819'; } /* '' */
+.i-flashlight:before { content: '\e81a'; } /* '' */
+.i-wait:before { content: '\e81b'; } /* '' */
+.i-play:before { content: '\e81c'; } /* '' */
+.i-stop:before { content: '\e81d'; } /* '' */
+.i-pause:before { content: '\e81e'; } /* '' */
+.i-to-end:before { content: '\e81f'; } /* '' */
+.i-to-start:before { content: '\e820'; } /* '' */
+.i-forward:before { content: '\e821'; } /* '' */
+.i-rewind:before { content: '\e822'; } /* '' */
+.i-ok:before { content: '\e823'; } /* '' */
+.i-warning:before { content: '\e824'; } /* '' */
+.i-clock:before { content: '\e825'; } /* '' */
+.i-buffer:before { content: '\e826'; } /* '' */
+.i-doc-new:before { content: '\e827'; } /* '' */
+.i-search:before { content: '\e828'; } /* '' */
+.i-edit:before { content: '\e829'; } /* '' */
+.i-tv:before { content: '\e82a'; } /* '' */
+.i-thumb-rate-up:before { content: '\e82b'; } /* '' */
+.i-flash-outline:before { content: '\e82c'; } /* '' */
+.i-error:before { content: '\e82d'; } /* '' */ \ No newline at end of file
diff --git a/http/3rdParty/fontello/css/epgd-embedded.css b/http/3rdParty/fontello/css/epgd-embedded.css
new file mode 100644
index 0000000..592255d
--- /dev/null
+++ b/http/3rdParty/fontello/css/epgd-embedded.css
@@ -0,0 +1,100 @@
+@font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.eot?45443790');
+ src: url('../font/epgd.eot?45443790#iefix') format('embedded-opentype'),
+ url('../font/epgd.svg?45443790#epgd') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+@font-face {
+ font-family: 'epgd';
+ src: url('data:application/octet-stream;base64,d09GRgABAAAAACj0AA8AAAAAQbQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIwleU9TLzIAAAGUAAAAQwAAAFY/MkoJY21hcAAAAdgAAAEbAAAD5ljZ8FtjdnQgAAAC9AAAABMAAAAgCRX84GZwZ20AAAMIAAAFkAAAC3CKkZBZZ2FzcAAACJgAAAAIAAAACAAAABBnbHlmAAAIoAAAG7kAACnQ27ixt2hlYWQAACRcAAAAMgAAADYNC5xTaGhlYQAAJJAAAAAgAAAAJAh1Bj1obXR4AAAksAAAAHQAAAC8lTj/vGxvY2EAACUkAAAAYAAAAGDfHOpabWF4cAAAJYQAAAAgAAAAIAGBDJ9uYW1lAAAlpAAAAXgAAAKdc1jeP3Bvc3QAACccAAABWgAAAfu5TV0AcHJlcAAAKHgAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYMpJLMlj4HNx8wlhkGJgYYAAkDwymzEnMz2RgQPGA8qxgGkOIGaDiAIAKVkFSAB4nGNgZNZlnMDAysDAVMW0h4GBoQdCMz5gMGRkAooysDIzYAUBaa4pDA4vGF7oMgf9z2KIYiliXAEUZgTJAQDTLAu7AHic7dNZUsJAFIXhPxBxQsV5nnAeyLOLc0E+ua6zCzy3OcswVV9XpSsEivs3sAaM7dN66H7pqOvHu13bH7PV9nu+2zN97WuxXHqlVt/3bR352d5vnLDOBpv+3DZTdthljxn7HHDIEceccMoZ51xwyRXX3HDLHffMeeCRJ5554ZU33vnw9y8Y/PIJ/9e0ltFX7ob6/1faRMJTQFGTVdSMFDV1haeFwnND4Qmi8CxRVA0KzxdF/TqFZ47C00fhDlC4CBRuA4UrQeFeULgcFG4IhWtC4a5QuDAUbg2Fq0Ph/lC4RBRuEoXrROFOUbhYFG4XhStG4Z5RuGwUbhyFa0fh7lH4BKDwWUDhU4HC5wNFnWCFz4xP6ArDH+xSbWcAeJxjYEADEhDIUvQvAoQBE0QD+QB4nK1WaXfTRhQdeUmchCwlCy1qYcTEabBGJmzBgAlBsmMgXZytlaCLFDvpvvGJ3+Bf82Tac+g3flrvGy8kkLTncJqTo3fnzdXM22USWpLYC+uRlJsvxdTWJo3sPAnphk3LUXwoO3shZYrJ3wVREK2W2rcdh0REIlC1rrBEEPseWZpkfOhRRsu2pFdNyi096S5b40G9Vd9+GjrKsTuhpGYzdGg9siVVGFWiSKY9UtKmZaj6K0krvL/CzFfNUMKITiJpvBnG0EjeG2e0ymg1tuMoimyy3ChSJJrhQRR5lNUS5+SKCQzKB82Q8sqnEeXD/Iis2KOcVrBLttP8vi95p3c5P7Ffb1G25EAfyI7s4Ox0JV+EW1th3LST7ShUEXbXd0Js2exU/2aP8ppGA7crMr3QjGCpfIUQKz+hzP4hWS2cT/mSR6NaspETQetlTuxLPoHW44gpcc0YWdDd0QkR1P2SMwz2mD4e/PHeKZYLEwJ4HMt6RyWcCBMpYXM0SdowcmAlZYsqqfWumDjldVrEW8J+7drRl85o41B3YjxbDx1bOVHJ8WhSp5lMndpJzaMpDaKUdCZ4zK8DKD+iSV5tYzWJlUfTOGbGhEQiAi3cS1NBLDuxpCkEzaMZvbkbprl2LVqkyQP13KP39OZWuLnTU9oO9LNGf1anYjrYC9PpaeQv8Wna5SJF6frpGX5M4kHWAjKRLTbDlIMHb/0O0svXlhyF1wbY7u3zK6h91kTwpAH7G9AeT9UpCUyFmFWIVkBirWtZlsnVrBapyNR3Q5pWvqzTBIpyHBfHvoxx/V8zM5aYEr7fidOzIy49c+1LCNMcfJt1PZrXqcVyAXFmeU6nWZbv6zTH8gOd5lme1+kIS1unoyw/1GmB5Uc6HWN5QQuadN/BkIsw5AIOkDCEpQNDWF6CISwVDGG5CENYFmEIyyUYwvJjGMJyGYawvKxl1dRTSePamVgGbEJgYo4eucxF5WoquVRCu2hUakOeEm6VVBTPqn9loF488oY5sBZIl8iaXzHOlY9G5fjWFS1vGjtXwLHqbx+O9jnxUtaLhT8F/9XWVCW9Ys3Dk6vwG4aebCeqNql4dE2Xz1U9uv5fVFRYC/QbSIVYKMqybHBnIoSPOp2GaqCVQ8xszDy063XLmp/D/TcxQhZQ/fg3FBoL3INOWUlZ7eCs1dfbstw7g3I4EyxJMTfz+lb4IiOz0n6RWcqej3wecAWMSmXYagOtFbzZJzEPmd4kzwRxW1E2SNrYzgSJDRzzgHnznQQmYeqqDeRO4YYN+AVhbsF5J1yieqMsh+5F7PMopPxbp+JE9qhojMCz2Rthr+9Cym9xDCQ0+aV+DFQVoakYNRXQNFJuqAZfxtm6bULGDvQjKnbDsqziw8cW95WSbRmEfKSI1aOjn9Zeok6q3H5mFJfvnb4FwSA1MX9733RxkMq7WskyR20DU7calVPXmkPjVYfq5lH1vePsEzlrmm66Jx56X9Oq28HFXCyw9m0O0lImF9T1YYUNosvFpVDqZTRJ77gHGBYY0O9Qio3/q/rYfJ4rVYXRcSTfTtS30edgDPwP2H9H9QPQ92Pocg0uz/eaE59u9OFsma6iF+un6Dcwa625WboG3NB0A+IhR62OuMoNfKcGcXqkuRzpIeBj3RXiAcAmgMXgE921jOZTAKP5jDk+wOfMYdBkDoMt5jDYZs4awA5zGOwyh8Eecxh8wZx1gC+ZwyBkDoOIOQyeMCcAeMocBl8xh8HXzGHwDXPuA3zLHAYxcxgkzGGwr+nWMMwtXtBdoLZBVaADU09Y3MPiUFNlyP6OF4b9vUHM/sEgpv6o6faQ+hMvDPVng5j6i0FM/VXTnSH1N14Y6u8GMfUPg5j6TL8Yy2UGv4x8lwoHlF1sPufvifcP28VAuQABAAH//wAPeJytegl0HMd1bb3qvWemp2e6p2cwABqz9mAZDMBZQRIEhgBBgEOQhkCaAihwCNEkLQmiKCmSqMhytDhRKCcRk9hhZEdOKEVOzk+8aLfi7/99EusoznGiLTLj6Hz7W7aTr28nkU8i59g8RCOverBpcZycBEt1dXf163qvXt13X1UTWPnhyl3cD7gJspUE6/48kAlCyEkDhEhfVpREJ+f91qqjUK1VbSqJ7Ddqsd9qbQRyZbxdAKlSbV2LWnibu3Li6OE/P9zcdSSbjsffr6tK+1hB1iRlIt5mRccb1x57fryyFRI9B2b+6sStZ25dWBxIUzpU05WJdFLM5nYduetDH777A4YqhKTCSHtAaSw2r2qON8zwxL4dD87MTl9d35FKQY9h7N5z4+z8lX8wYWGnCRCy8hPuDfoV0kUy9WSbTAkHk4Ry9DThCHeatThNAE5GKpUML8T6IGRKYjo1ABFTTCdTTiVUrpaSRasTatVSMWpxb1iSFFRfb465Z8abzXG4f6z5uhqUJIs+sHwhqnDq6wve9bOsXHhdpepaP96kr9L7SIbY9fZUmy7xhMIkB5TQ04C3T5odpsl6kDWDIGIHJFY45VHIsaJa7MIeYGHh7ahFXw1O63n90UexmNbZUd84DwYffTR4o8Uqn/508N0NgwXWgFBmG7oVbRMk28nS09hJgMm9jwVn5uoO4TnK8SewjxyFJSIQjhe4RaYHHMRmZI7pNN1ez7Ua0lM/o+V8XcmZfbaTEYV4XxaNK6VTzg4oV6OlomWYGidpsOkqulHZyaWYY7HBKHjWtyncr8n3KZqm3Kf4H9djTjwStfFE9jd6kx3lVCZmdkuqJF0lU37+j/oPTxV+CxuC9wz4YcIupxJhNTAYUHWwlHhh1tATxRToWlHhd4u6/PHUtkOEcCvLK49zRzkf2qVGdpGp+kQPCJwCFAidJDw6D8+dIpxAOWGJSITyEl1EvQkIBPUWRU9vcY6IIE5H7D7Dcpy0LHT0ZStlpw9SYieY1nYoVo1yAdKoIw5qqYgaFy1mAQ2ikdb9Ms6wES5qapAqULxtA7ylykuy6hXnRha2nJ1UAg1eVAQ7O9RrtaeHwbsVC3eotun/m5uff+OrN4h3fOmtL/7C7NpjKty15WDhTMBX4yWn3Q5H4v7gWNbEG+GUTxfjHd2ztz53yy3PfZ8Vm2xhkwJ6yZ767u4EFQVNpBRiQHnCTRKZCKIsLBKRABVhEWcXoJXQFrwk8QcJz0tzROKl6Qgawgk56bQidK4aI7TZIpH0hm24d9hK2GQFul2Vqqr8BNOoUmHlJUmd3LAMnNis+DxesNkdrDzplSpcnl+9oH57k7L4480JOLmq72h9uAsEMR6mlJPxHqCyIhE4EZXlPIdf5MFzdDyseXrFSTtJqyQJ7S0/RxDJVdCjS5X0Wq1oRUNYcJscHnW04ISpu98NmmBp6bR3uIhlOmhNWdo5zcIiaB6f9G6w8mLrYGnuly1665JXXcJm63pwb3CzJEdGyXR9Tzd6ZAg9uFagPE2CwPOTzD9P40AJlBdOoVZU4JZQAcoDZeoR7iDhOKYUR6a3tWcr1ayn1GZkrHnI6J2LUsi0oslidU0bI4RDNgDQgrEagzEPSblwc9wdbGGnpKqSeyZbhmoGXsqWVTkjqxetDt8x9+OCztdxKl1/zGdp0InKTT/hPfPSWBO8duWsO+g9yfwAXmOGo358UBTr6J7swY6WLUS0xeNc2JvPXWQAvXicfJAcr1995QQV5Z5kW0gB5rqTaAKsiEBO8ZQSSSTSEtGIImvKYjBAZb+K3i2LTSL5fNJBIkm+OeKTfNMnjl/dvGr+wOz7pvdM7hw1M6bDftI6OjlGExG92LMVs0n0Z5wboWTItAHNNAJQwjCaFiUhwtqEWkbPhdb9BQGDeVIXYAG2ZxKvOLdRfUCVWlVJnXL9skzhJSrL7v2X2nnhcZGHH6hyddWM3jT6TE7JW09Ee5XcZ3HSfMH9MrsIO1n5U+rucRpaftNvqqpJT+wUAIQD+MblNwu7xgrU8DpxJNIBtnlEXfXJh3EcoiRP8vUewiNk8uBhJ2XYSTmOHiQ42eYIBpXpdAV/Sl7AQJxYnUgOzhgxgr6GRqoaoQ1fZPbrBOZg83bUPRO1wY4+aSUSFv1DKzHZKC3PlxqN0pOlBpwpNW6D+60EJKwMlnZ0+Q1sB7/nnmEtaIyV4QabAis/4XuwvyGcRROkUZ/M4CwHhgG8JPKLiP0clbhFWUF3QQdi6C8IHvoLc0QAYdoIj9V3bB+qDPYn7TYrnDNy1S2qYPVBmc0YjPMRk6mB4T2brLxTRRxgAYO9Bu/SMBphEGJx37GXH7bKgUd9Nj0aLQYfVZc/Ap9NWO6X15Q/1zZDv9/26dhsdvnhNe0HylOwZJd9Muw1YqGvBRQzrn/Nf/zwJnu4mc/bzuF04mu2s2GP0uF4e4jNJ88u3GH63Op8qtXL3cALHkBifBSQEQj8OkC+kwg4FfwtrbOANXRMtuAwt3oeXT1Pbz6fN/XLb3owx4WCFvw7Z5tQ0gJ9SsPbQa8EbZIB6SR7YAMn51GXGKmTmfo+PyBITiZxmHcTDukHJyKzQaCkcAoHVwSM+ETgUcdTOPoicl/mvbxwkAgCP4cVfjqf7c0ZVtpkER9MCfEPJ+w69GNhRcGqrU78Ws7BGA9Igqq5kDfwZaeKeLl60aK/5XNf9tnmJU+fS6btgwHfc83xJyTsKOuqLD+RrSJXekpUMSKvXhlvQlPzuS+pZvDhVhB5WLOogheedm8fb6qyTxEDksxQ9yw+zVOZX73SXLfJEvLCHNpkrD5qolTm9RgpxI1IwSN/5skpFjFEL2Lwb4sYVrot25vNeWHQtJgbs1C35saRqHcpl16NGx6522QsjwOuGQtO0DW9UHNEpjXFGfo/JVLkIiIzU4d1iQ3uJQwgaKUCDQuawkOLi6/rXHbc2/FB1Bny722jVb6OhhiGf8QAEK2bLWrMytMsFaqYlE3iVaK+GteQlVzydfgusXj1FvraX2hYxz8vCsHKCsrbDn+B8kJ1bV1SpMgkZT3HL0CL5qMkM+j6WTi7pNrqJfWPmefavksqvmCtb/BBeicJvEffoobXN/Sv1fSh6hGLhOI93hGjc65fs3yrXV3XFXbSD2Pf1C8wGSZL9VrqsREbAewU7FQ9XfAxlXlXS89WJ1s+8zh3FWJlhkySI/XD41kqKgM4Y6IIAjIAh3xDkUVZEU9JeBUdiZ5CosGJlJEOdCWMukgkRUHGGYUnm11p94STzVazTsXMqCyomhHNm1CSuMGdEExtqBUxIa21ImmkNcEQWx3mZPjrzbfKCIuXUUylLG5v5nufuOLB4SmmlnaJjf6+7uO1xr05Mcb7kUdqpt66OnvjXrwYFfyncdpl/v4TV3ySPRTDpADOf3Fk65TPexxNsy/TC40RdSjgh2dXr+xrnYv8asu1+XUBbdVPxsj++t7twItZjIQInhJ6toTJlIgsTUSM4Rk5W9pEzsT3IGdmNJKrbK2UPMR5OzvDQICjmM4572Bo6BYsmzVgw0u6oOV95iaC9lLaVjipHUlIwL/KthhPEzIIjLzvHndrIKP9UNN2aBntY3AtnowEYO/j6zxN4w2xQwBunar9miykUTUQ3G2a9kOvfYA9GEAJq3YxVnlaX70bIQWYb2AMQWxjMYTOYVCh05TY7ZahSiRIg4Jg9sEm5VBxJxp6O0WlN23qfPnODfXGFulX1jvHbs6v32kiLyHIUJhfz2OfOJIkW5AFXFHf39ebTvEyD5MBHDiQ6W6iSsDLKgY9mXCizHmpEBLJpoDEQFHILDsSZY4oRJmu7xiqRJ1SyNgeCuk+9OdospIUSthtludK60EvHWL4x5BFWkuGWGKInK8qrLPBVoMu9P2L8Fn3ALw15Rc+JXTIGMP/t2XD1FQiAi9jTL+IiRH6bqs8jownjJ6B1EiIVoMP6ZZ08SK8Jcelh0Q/MC5kvbFc9Y5ge1kWCzequnzJo1P/ZCVi2qeC1bV1ja8jTkbfEycds4Vu6zhZezdO/ktQZTCJ+Sps4CT9f++Jk61M46fiJEKuh09M3OrYXcf9HuZAKkmREbIfttSDUYSWch55vwOgcJN7HzNm5uqNEHiLQRLiknQCYUkVqbpkgKoo6gdQUsBPAk0zrGu8Pwg+2e9rMqiSWC6goJiDOMYwj+RXgX3tex8zUeLenypRVJWl/6TI+vRmaR5u/hfEzc/Xu0dH0+nR/aP7903vbeyZmtw9sWt8bGc9PZIe2YFe2Waa6YytRxjWlnDcKmkcQGk93CG+rkVxlsUKkWTFQJitpBFhI+lKMsIhGEcYDFcMPC/l0lKJHY2SQT9xrJutHCDFd18Tn8A87UlZDix5WTtL3F9xv/iCJIiyqN47Djte4DFgCL5fufXh3vjZeO+F3N1X3U1vuCOuUJ+qisu7RekJQXhSiXCE+egyURv3FiHnQwpO63cX3W/wOC2BjsGPhodnZoaH4Sb3HHmXXxTJPhiv+3ePRDmNq0IgRFed4goS1MJa8IQJ4VAo/AHiC9CAzzM+CVCypOOQaEFOa2J2EPCFAkdRMksZm4ZflREWQJxt1UQ4pAiYWEJj1TdmNwnWwqGl/w7J9QMtoeFT/41SmaeUSul0aV9p3/Selo9UyuliurhlcKDQnw+FQhuekt3wFOGnesrbvYFb85yUmFv3HeY6pcrPcBTKb3IJX8tpgOdW3cYvyr9TarmJIt31Li/5je3bZ2a2b4eb3QfoRz5SgpwqCOxVzGf+NojVcbYG+JOV89zHuEFikg7Sg7zISbRZhsL19wELqUhdQSzQGjCCUbXAquYcjYJNqwVetIHLjRQ67tMXiu414f1T8TA8KJr62dhZ9xcSzYQ22I2hwZ4eFP3dw1MFWe2mfzZyNnafborYPNaYxubFBf1sx6Dbm1jIaHJ3AeJ2tyoXGsPdfnlwejUHu44Oog+3k25yjK3LVYpoLEbm5/ZRInKYiPEiL2D6gtmqSBhI3IBwymFShok2z3uJNktZKD99YDbensl1xiXMysDUkGwCW9Xx2NUIlAvAWBYOosCW+UvFGiqbThnlEYq6V2piKhc1uzjLwaRHo0EqOmJF7IQRWikXIygqWikPUC+40cHFY8cWP/ONz7DD5179nGuHeXnhzl+c0+zF627/dbnD39a5QI+/dZw/3G+EQn7bj0An+4NBmjos37KrPHaHuNAXDgh+iac35K9pDi+cLNyW2r8/dVvh5MJw85r8bYn9+xOiJovlompW3UbYzmixjgW7WK0WE4f7jEiEDqrhsKYGdZ2m4HBijHcGU7adGnT4MXuhx9Bk02+tc+K36G8SHxGfVAXAcbdYfuJxiij8vaa5B2OpVAxux9Dj/qtu2pTapr6RO8zRjxI/idUjFNb2GIBIPPGDj2OUpRgJmRjMvP0FqjUa7sh0ppt+tO72jo3BxUyHxxOxCNMvIZSHSLqeQC7IMVkcJkAnVQWIFlBCakjgiQyyuCaUiUyuVeDZw0+5lw8/Rb9UX35+bIxuq68d1+TP0XtRR/PtPQ34Q7rfDJheT1FvYVXv7Lrch9AA562ODgv+T+M83KbG1e9p4Th8MR7Wure5hW3b4JVtZPM7/PgOFtHXXmHYLKIb5Vq2iuiACVDWyZVb4j+nwfVmR4fpflz73PnzmGx4st3dKPt76r9u88SvyeZuxDyIrSjJT1shVaD9b+uvtKnOHcMu/6pl29YsVh40EwkT+90h/1jTO+A7Hbr2480nb5PvJ22efIVH+aHNXc5uPtHgNibV/agGz2twjVd/UGP9Z2Jdm71D1t52trYG8Tdclv4dMYhDttarGXV1lwroaWTAHLkRWTDnEWBuDuk0cNMRE4jpRJxgQJaIAQYbfaG10MqokeFlOeiuSBqRHVrVGlSdnIOsPefAqbH+lwqF/C/mRy+Yjd65hbx7uc99JZIA/aVw2Q+8TwsZ3b7vXgj29L9cuKeQz2P+5+QfvMLtm4GHEz36y4Zswdej3bLqD7vXXAh6MXXluyvneZtzPFvZiJjT9T0pRo+91TKCuYwMVEJS7O0LEAF4YXGTVoQppQWAdOfszo72SDjQprXJAs4Wv8J8MIW6eCt+OXByxShYHv9FrYxy0UwZGHByTgWxyqJ0S8L9y0TvGL1pZz7l/lVy4LpRTHc++OHlcx9aqkNlJHf27G+Kk3vEwlie/q/a8kptZqZGoXbt0vLKtf/zT5YoLC3fMnEW7tSCTz4Z1BIFWmT6IZ9c+SrXT3+EXtxDtmLetpccJEfISXTm28nH6r8ewVnPSYRji4KyIMmLCghEFQV10QCfCX7e58esIAp8gC0cBogWDmiLOK3DwVB4ERMenQb1RYsttNCDFkt35jDpgel8r4WSz9z2czffcOq6a08cv3px4aq5Kw/Mvm9/Y8/uiZ31HcPVcnFL79b81kRXpMfq8anEBDPmYQHbeTVZ4pti27VllhkbRVay/VnH21szWRuD7bA5I9RbSdYwW0OoZ+AffVdFelcl964KnL/h6EJ1aKi6cPSbzYVqrVZdaJ4+1Jjq7evrnWp8Zq3ywl0R/zmNj6e1e6+3ojT66WA4qJnaH2p4MLQ9rbMx/Mfa51uHR9g9M7C3daA/Gqq0XsHe1fzm0YXK0HJ/3nvHJHvHpPeyPPiDDwVTMao90J5phy5VY8KGWodHlCB70e/imaFpo62zva3Dn7QOa7GW+2uMtRUc719j650/D5Q7WKWE78JJyrbAOIr0HHP20+jb/Mau8i/fd+r67dvyfaYgRPoqI7RWxHCIJsfpubZ9Dpi8UbymUUkD/GPUCbFkgBZoiD1gdVG2r84a4ym2L9kcayxoHNtmx4I1yxaZICu6KgqFtP6cdDZXwLnh6x3yG3ZGGvi6kcrTfVvtXscK2HowzMVVkQO1d1jt+6O81KHEkdK5PxbjpWpnSvH1bsOnzLa73t9rZCJtuxZ8vSlDT/QicmsSPlRXXFdyzLx2sSBOj4xwvJof9sGCPViXb92f48d6UbSSKiu/eqRgakqbboVWyOj2QwI/F7TComzRyDFe7kjHAxFDwJRM8VFZlng1YFmCedDgwrxPoh/ifFYsYCkQCZqmIPu0bTlTUP1aoluIaTwnx5H1+RTNivF3cpbsF09EuERHQuSxfcwUH9EcrpoxaNxSeCUQNvmxfNQnM7lnOuLdKr+Gv9dxT+P4Yrwmx+pHge1kszHFUWbLvhIFaYklX5LIaBTlCG3KICK7VnhRaRJeEPhZwvPCIdVPBV5oBAKYkcUCsagVMY1wSEc38hM/0uVQWBPa+iKhWjKUDiUj7D9XKVVKEaTESH+/RKVD7rk/gEc+8vKFF1+8cJ4rPuM+CvxDy8fnXnzkRfa3kb+8wR0gYeSmWbKF7K1PxWMcx8saAFtFQiNKMn8K2woi8TZmMROUGO4Cx/ZbOGSKbP2ILadwdNpIZow200hH2b5spIyktlKu8pYuSqkcWwKsmcz/2HobmFamqjsZESGhVjTTKTFqppLA970G21577VPNWfdycqFeSxRCl/uTl0NAnwH+mWfcy88cuXde1/ffAImeAWw+2/zkt+hr7vPfgD58oF6wUlS/nOzHB/7hnmfpUyA+RZ+95/DdkLj+fcioJE/ff8LxsUkfYu8o2UOuwCgyXz905aEr9kzsEAVxF8aTaVRu30CWbdCzzU0J2SpbreYlgV9aTXaYCdjuPTJgBrRkHWePHjkw22lYZr5fRg4cKVfL1R1gYNiseJ992CCBJzAlpj17lIo4IXMOzrAazuhRFl0LgIhas6LgSBz76gXYVzJYi9Qq1QEPjSOMODPqLFHaUCMw8eDwoetmGtpONxPrcn+i8qrK99dH46ao/xw/0D+c4PLjJ+EWX49WLd09KPEf6O+H3NzQHU47hv8ePWpnPx/i/3mH/afXzeyWy/28sHV0Zrinh5dlGRXzdVmwi35y+0zjz+puV1TezWGK02908IltA/30jPYoPb7bFgfOVraYKdV3moYhZ9XcH5htVhL6umKdunuwpyf2Izq8+Ncze45Ytf6xxtaRHi/Wr6zcz/1/ruTt/oyScfIrdX0ARCEHvNQe01iKgTm0iqnugGfn45scUZHZjJGRCctsNNBf2QcCMIeclofp9nqBsZ4b/8MPzNe18bGwU62UnWq2xFaH19b8pBDbXYqwKdjiCmVMNJPe4LFlQrbbkkui/xqra2iRUGs3CqdmstrN5XNDUO12v/qVqB5cfkELQ/Qr7ldzQ3U9yOXxTA9efhUPI+EAfSwQDgeWZwLhLvrY8sxxelOuCkPO8jk8ZNvEOLsbF9uyQ46mAza/yTu4fnhaw0TE3eudwtOtOOPOCTv4m8lVGGX+gRytL9xaRWt8GGncPQcoJ/w+prgvPP9LhJf417/JNqhbFJHg/dMEJwEGH07ieOnU+kc4ksSWiJFu7Pm77zz7hT/+H49c+J1PHj9WKcdkjEeCF28kjTLfzRVohZXAPuxivzmr9ZnXCNRGuNalUm3jNgYj9GicF5gRssBjRdH7Nd5wamEUktag9VUY+5ql9RFY67OxEqtL+B9phT+koxowaeDNjRTrkIgVa/Vaa8Z4crxbLWERJtlkr1/7wqz17Rlrzp5GbIpa+Dw+yj/FawFjMRNd2NmumwNJ2/ZDpDPXyxbYZQmoALbu03yYDXbG91011NtnJrpS/WJPFkATfbKk6sZIpX2+q1OOxgsBWcGM2r89oKhBvyIlujtLu8N7Ul29ml8RZR8XhGAoafUOhAPtmi/YjkAX1tMJ01LMlKmwjfNvJrZI/Pahg/5ArH1XLBl+n5los2OZnthg/7buQb8SSA8PjvdM9Y3smBwBCKqxuKyDJFOnN2pgys5z2kDSaG/rOtzdZ7WJU5mao5v+6NaB3r5gtre0Y7q971QkYEEg1tmtB9sS7QnH6qx06BGlM6pFdGjTkOl07Z8IB8KyEY8qQVG+MzfZ69SMXEpvC5vtoty2c8cbN115JNnZE1b86pGIHk47/RX428aNIH00noFwKGjpnY6a3JtIdZp2Iohgy4nKDU5j55UxJ19rS1QTbb29KbchCyIfD88UBtM5TRFsUUGFJL8UtXTgCpnSiKZGAmkrLAk790RCfj0s6+FoT79hD0b9hq4l+iXVNkPRpF8xzK5Ut8QLNk7+oBGaHPMFvPWZ99P/y13jfd9hs2/7YgFR4DmWY8DkRiYrSxFDsmXby2S3sB2brFG0ouwjOg/UEc5HmdtjKgFvuj8Pwr1wn3v53r5hUI8806fl3Du6eoaGI0efzuvdcF8XXXHP/bb753DzeXhkpM+yvn1t2zVZ94HOZul717adzMHNnS2+eC33fYzPLG+PkCLCIPG2RxG/RGA7Os13xp9wOBwJRwwD6YKEDCFUxkCF9JLU1gNuJRkBBx6Cbt79trvgfueXXoXCq6+6r7x6NTWh+SI41P2W23S/RcF58fxF+goMvkIv/vi558i/AYqGo0sAAAB4nGNgZGBgAGIjEe5H8fw2Xxm4mV8ARRiupOkEwej/j/9FsNqyFAG5HAxMIFEALCgLNQAAeJxjYGRgYA76n8XAwLb//+P/T1htGYAiKEAfAKHSBrx4nGN+wcDA/OL/B2YQLcjAwGQNpCP//wVhxlSQHESceQEDA4s+SA6KF0DUMln//w9SB1YLFQerj0TIg8VAuO3/TyYDoNovQPEIIBaC0kDMXADF/EB7mP4/ZtYFsi8D8VaoGyDu/M+2H6j+5v+fID4AdXQoYwAAAAAAZgCqAPQBgAIGAn4C4gNoBCwEhAUQBXYGAAaCBqoG0Ab4BxoHsAg8CIYJFgk+CWQKcAuCC9IMggygDMQM9A0mDVQNhA24DhoOig+IEHgQ0BFIEhASvBRSFKAU6AABAAAALwDtAAoAAAAAAAIAMABAAHMAAACkC3AAAAAAeJx1j19LAkEUxc+opSX0UNRbMC9FEqx/ICF7EQzt2cCeVx13V9adZXYUfO079NCX66vU2XWUCNphZn733HvP3AVwji8I7L4H7h0LVBjtuIQqHh2XqfcdV7ieHR+hjhfHx9RfHZ/iHm+O67jAOx1E5YTREh+OBWr4dlzCmag6LqMmLh1XyNeOj3AlbhwfU39yfIqJGDiu41Z8DnS6NVEQWnk3aMhOq92V063UlKLEj6W/tqE2mezLhU6simPtzfRKpcF8rIJ17Jsc8z1RJot0ItteKw9HKlHGt2qeu2WboGPtQi6MXsmh85Gp0Us1s15obdprNn/7YwCNFFsYRAgQwkLijmqDdwcttNElTVkhWbmripDAR0zFx5odYZHJGPe5F4wSqooVMdnDjOeKccreOcakgH0xu81B3d8TUu4VFS6S73ucYp8dkZKiwi9emB9my7BhRYeq5QT5FKZ4VWL4Zx5Jrzy3pDKj7hV/ban20OT6Z/4fO0p1nnicbZBbUxQxEIXnLHPbZRcVFO8igihqhL8Ukp6d1GaTVCfD4L83MxbFi/3Qp7+qrtOXYlH8i1Xx/7jBAgcoUaFGgxZLrHCINTY4wjM8xwsc4wQv8QqneI03eIt3eI8P+IhPOMNnnOMLLnCJr7jCN3zHNX7gJ35B4DducFu0gf2WKcaaSXnWtZJOkS17smE9JaEMK0t6bVznH6GcoLXG7QQ9pCqxjP2m81YTC2V9JP1IPpDL/XtyQ2X91rg6Zz+kVvvRCW24HsIkraUuTcWSzbafq4apy5v1lepJ7Q7nLGgf0p8yyntaRs+5L9s0czWE9axO7inD0RNMPavO5h3t5F2O0qQyWJl9kg9VkEOkOnlBTrdZYpKcms7zKPM/mEbj9MLvmozOuG2VD1S7+m7oOuJGeyUcjXUkyaovSZu0SPeb1A/7O8EyTats5tkiX50/RhUxey6Kv4VLi/oAAHicY/DewXAiKGIjI2Nf5AbGnRwMHAzJBRsZWJ02MTAyaIEYm7mYGDkgLD4GMIvNaRfTAaA0J5DN7rSLwQHCZmZw2ajC2BEYscGhI2Ijc4rLRjUQbxdHAwMji0NHckgESEkkEGzmYWLk0drB+L91A0vvRiYGFwAMdiP0AAA=') format('woff'),
+ url('data:application/octet-stream;base64,AAEAAAAPAIAAAwBwR1NVQiCMJXkAAAD8AAAAVE9TLzI/MkoJAAABUAAAAFZjbWFwWNnwWwAAAagAAAPmY3Z0IAkV/OAAADWcAAAAIGZwZ22KkZBZAAA1vAAAC3BnYXNwAAAAEAAANZQAAAAIZ2x5Ztu4sbcAAAWQAAAp0GhlYWQNC5xTAAAvYAAAADZoaGVhCHUGPQAAL5gAAAAkaG10eJU4/7wAAC+8AAAAvGxvY2HfHOpaAAAweAAAAGBtYXhwAYEMnwAAMNgAAAAgbmFtZXNY3j8AADD4AAACnXBvc3S5TV0AAAAzmAAAAftwcmVw5UErvAAAQSwAAACGAAEAAAAKADAAPgACbGF0bgAOREZMVAAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAEDLQGQAAUAAAJ6ArwAAACMAnoCvAAAAeAAMQECAAACAAUDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBmRWQAQOgA6C0DUv9qAFoEcgGoAAAAAQAAAAAAAAAAAAUAAAADAAAALAAAAAQAAAGuAAEAAAAAAKgAAwABAAAALAADAAoAAAGuAAQAfAAAAAQABAABAADoLf//AADoAP//AAAAAQAEAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAACOAAAAAAAAAAuAADoAAAA6AAAAAABAADoAQAA6AEAAAACAADoAgAA6AIAAAADAADoAwAA6AMAAAAEAADoBAAA6AQAAAAFAADoBQAA6AUAAAAGAADoBgAA6AYAAAAHAADoBwAA6AcAAAAIAADoCAAA6AgAAAAJAADoCQAA6AkAAAAKAADoCgAA6AoAAAALAADoCwAA6AsAAAAMAADoDAAA6AwAAAANAADoDQAA6A0AAAAOAADoDgAA6A4AAAAPAADoDwAA6A8AAAAQAADoEAAA6BAAAAARAADoEQAA6BEAAAASAADoEgAA6BIAAAATAADoEwAA6BMAAAAUAADoFAAA6BQAAAAVAADoFQAA6BUAAAAWAADoFgAA6BYAAAAXAADoFwAA6BcAAAAYAADoGAAA6BgAAAAZAADoGQAA6BkAAAAaAADoGgAA6BoAAAAbAADoGwAA6BsAAAAcAADoHAAA6BwAAAAdAADoHQAA6B0AAAAeAADoHgAA6B4AAAAfAADoHwAA6B8AAAAgAADoIAAA6CAAAAAhAADoIQAA6CEAAAAiAADoIgAA6CIAAAAjAADoIwAA6CMAAAAkAADoJAAA6CQAAAAlAADoJQAA6CUAAAAmAADoJgAA6CYAAAAnAADoJwAA6CcAAAAoAADoKAAA6CgAAAApAADoKQAA6CkAAAAqAADoKgAA6CoAAAArAADoKwAA6CsAAAAsAADoLAAA6CwAAAAtAADoLQAA6C0AAAAuAAAAAf/w/38D6wNFADkAD0AMLAEARQAAAGYTAQUVKyUGBwYmJyYnJicmNzY/ATY3Nh4CBwYHBgcGFxYXFhcWNjc+ASc0JyYnLgEHNTYXFhcWFxYXFgYHBgNXRV9ax1peRF0lIxoaVRAKCRtCLggOBwlFGhkWF0NKaWLGQzU5ASApU1DNZXV3dVxgLyMCAjg3EAlFIyEGJSdEXX97fYBjEwoFEQcuPhsNCUpgXlteQ0oUEkVNPZhQUkxhQD0iIgEpExNGSXBSWVemRRYAAAAAAQAA//kD6ALDAB8AJEAhGQgCAAMBRwACAwJvAAMAA28AAAEAbwABAWYVNTUkBAUYKwERFAcGIyIvARUUBiMhIiY1ETQ2MyEyFh0BNzYzMhcWA+gWBwcPCuFeQv53Q15eQwGJQl7hCg8HBxYCjv2gFwkDCuFcQ15eQwGIQ15eQ1zhCgIKAAAAAAEAAP/vAtQChgAkAB5AGyIZEAcEAAIBRwMBAgACbwEBAABmFBwUFAQFGCslFA8BBiIvAQcGIi8BJjQ/AScmND8BNjIfATc2Mh8BFhQPARcWAtQPTBAsEKSkECwQTBAQpKQQEEwQLBCkpBAsEEwPD6SkD3AWEEwPD6WlDw9MECwQpKQQLBBMEBCkpBAQTA8uD6SkDwACAAD/+QI5AsMADwA7AGu1AAEAAQFHS7APUFhAJgAEAwIDBGUAAgEDAgFrAAUAAwQFA2AAAQAAAVQAAQEAWAAAAQBMG0AnAAQDAgMEAm0AAgEDAgFrAAUAAwQFA2AAAQAAAVQAAQEAWAAAAQBMWUAJJxQrHiYkBgUaKyUVFAYHIyImPQE0NhczMhYTFA4DBw4BFRQGByMiJj0BNDY3PgE0JiciBwYHBiMiLwEuATc2MzIeAgGJDgiGCQ4OCYYJDLEQGCYaFRceDgmGCAxKKiEcNCIkGBQoBwoHB1sIAgRZqi1aSC6VhgkMAQ4IhgkOAQwBRR40IiASCg0wDQoQARYJGi5SExAgMiIBEA4yCQRGBhAIlCI6VgAAA//9/7EDXwMLAA8ANwBEAEhARSkBBQMJAQIBAAJHAAQCAwIEA20AAwUCAwVrAAcAAgQHAmAABQAAAQUAYAABBgYBVAABAQZYAAYBBkwVHisTFiYmIwgFHCslNTQmKwEiBh0BFBY7ATI2EzQuASMiBwYfARYzMjc+ATIWFRQGBw4BFxUUFjsBMjY0Nj8BPgMXFA4BIi4CPgEyHgEB9AoIawgKCghrCAqPPlwxiEcJDUoEBgkFHiU4KhYbIzwBCghrCAoYEhwKHhQM13LG6MhuBnq89Lp+UmsICgoIawgKCgF/MVQudw0LNwQHJhseEhUaDA9CJRQICgoSIgsQBhocKFJ1xHR0xOrEdHTEAAP//f+xA18DCwAeAC4AOwBJQEYoIAIGBQ4GAgIBGAECBAADRwAIAAUGCAVgAAYAAQIGAWAAAgMBAAQCAGAABAcHBFQABAQHWAAHBAdMFRYmJiYRJiMjCQUdKyU1NCYrARE0JisBIgYdARQWOwEVIyIGHQEUFjsBMjYDNTQmKwEiBh0BFBY7ATI2BRQOASIuAj4BMh4BAjsKBzYKCLIICgoINTUICgoI+gcKRwoIawgKCghrCAoBZXLG6MhuBnq89Lp+UlkICgEeCAoKCFkICrMKCFkICgoB/FkICgoIWQgKCuB1xHR0xOrEdHTEAAAAAAIAAP/5AWYDCwAeAC4AP0A8HwEFBhoSAgIDCAACAAEDRwAGAAUDBgVgAAMAAgEDAmAEAQEAAAFUBAEBAQBYAAABAEw1JiMmIRYzBwUbKyUVFAYHISImJzU0NjczNSMiJic1NDY3MzIWFxEzMhYDFRQGByMiJj0BNDY7ATIWAWUUEP7jDxQBFg4jIw8UARYO1g8UASMPFkgWDo8OFhYOjw8UZEcPFAEWDkcPFAHWFg5HDxQBFg7+vxYCdWsPFAEWDmsOFhYAAAAAAgAA//kD6ANSACcAPwBMQEkoAQEGEQECATcuAgQCIQEFBARHAAYBBm8ABAIFAgQFbQAFAwIFA2sAAQACBAECYAADAAADVAADAwBYAAADAEw6GyU1NiUzBwUbKwEVFAYjISImNRE0NjchMhYdARQGIyEiBgcRFBYXITI2PQE0NjsBMhYTERQOAS8BAQYiLwEmNDcBJyY0NjMhMhYDEl5D/jBDXl5DAYkHCgoH/nclNAE2JAHQJTQKCCQICtYWHAti/pQFEARABgYBbGILFg4BHQ8UAUyyQ15eQwHQQl4BCggkCAo0Jf4wJTQBNiSyCAoKAdr+4w8UAgxi/pQGBkAFDgYBbGILHBYWAAAAAAYAAP+xAxIDCwAPAB8ALwA7AEMAZwBkQGFXRQIGCCkhGREJAQYAAQJHBQMCAQYABgEAbQQCAgAHBgAHawAOAAkIDglgDw0CCAwKAgYBCAZeAAcLCwdUAAcHC1gACwcLTGVkYV5bWVNST0xJR0E/FCQUJiYmJiYjEAUdKwERFAYrASImNRE0NjsBMhYXERQGKwEiJjURNDY7ATIWFxEUBisBIiY1ETQ2OwEyFhMRIREUHgEzITI+AQEzJyYnIwYHBRUUBisBERQGIyEiJicRIyImPQE0NjsBNz4BNzMyFh8BMzIWAR4KCCQICgoIJAgKjwoIJAgKCggkCAqOCgckCAoKCCQHCkj+DAgIAgHQAggI/on6GwQFsQYEAesKCDY0Jf4wJTQBNQgKCgisJwksFrIXKgknrQgKAbf+vwgKCggBQQgKCgj+vwgKCggBQQgKCgj+vwgKCggBQQgKCv5kAhH97wwUCgoUAmVBBQEBBVMkCAr97y5EQi4CEwoIJAgKXRUcAR4UXQoAAgAA//kDoQMLABcALAAsQCkABAABBQQBYAAFAAACBQBgAAIDAwJUAAICA1gAAwIDTCM1NTU1MwYFGislETQmByEiJic1NCYHIyIGFREUFjMhMjYTERQGIyEiJjURNDY7ATIWHQEhMhYDWR4X/ncXHgEeF7MWICAWAqcWIEdKM/1ZM0pKM7MzSgF3M0p2AYkWIAEgFiQWIAEeF/3oFiAgAZ/+dzNKSjMCGDNKSjMSSgADAAD/+QQpAwsAEQAnAEUASkBHJAEBAAFHAAYABAcGBGAABwADAgcDYAgJAgIAAAECAGAAAQUFAVQAAQEFWAAFAQVMExJCQD07ODUwLSEeGRYSJxMnNjEKBRYrATQjISIGDwEGFRQzITI2PwE2JSE1NCYHISImJzU0JgcjIgYVETc+AQUUDwEOASMhIiY1ETQ2OwEyFh0BITIWFxUzMhYXFgPiHv2hFjQNpAseAl8XMg+kCv2DAa0gFv6/Fx4BHhezFiCPGVAC6hmlGFIl/aEzSkozszNKAS80SAFrHjQLCAFLExgRyw0JFBoQywxkWhYgASAWJBYgAR4X/iSvHiZaIyDLHiZKMwIYM0pKMxJKM1oaGxEAAAAAAwAA//kDWgLEAA8AHwAvADdANCgBBAUIAAIAAQJHAAUABAMFBGAAAwACAQMCYAABAAABVAABAQBYAAABAEwmNSY1JjMGBRorJRUUBgchIiYnNTQ2NyEyFgMVFAYnISImJzU0NhchMhYDFRQGIyEiJic1NDYXITIWA1kUEPzvDxQBFg4DEQ8WARQQ/O8PFAEWDgMRDxYBFBD87w8UARYOAxEPFmRHDxQBFg5HDxQBFgEQSA4WARQPSA4WARQBDkcOFhYORw8WARQAAAAAAgAA//kDWQLEABgAQABQQE0MAQECAUchAQABRgADBwYHAwZtAAIGAQYCAW0AAQUGAQVrAAAFBAUABG0ABwAGAgcGYAAFAAQFVAAFBQRYAAQFBEwsJSonExYjFAgFHCsBFAcBBiImPQEjIiYnNTQ2NzM1NDYWFwEWNxEUBisBIiY3JyY/AT4BFzMyNicRNCYHIyI0JjYvASY/AT4BFzMyFgKVC/7RCx4U+g8UARYO+hQeCwEvC8ReQ7IHDAEBAQECAQgIsiU2ATQmtAYKAgIBAQECAQgIskNeAV4OC/7QChQPoRYO1g8UAaEOFgIJ/tAKtf54Q14KCAsJBg0HCAE2JAGIJTYBBAIIBAsJBg0HCAFeAAAAAgAA//kDawLDACcAQABCQD8UAQIBAUcABgIFAgYFbQAFAwIFA2sABAMAAwQAbQABAAIGAQJgAAMEAANUAAMDAFgAAAMATBYjGSUqJScHBRsrJRQWDwEOAQcjIiY1ETQ2OwEyFhUXFg8BDgEnIyIGBxEUFhczMh4CARQHAQYiJj0BIyImPQE0NjczNTQ2FhcBFgFlAgECAQgIskNeXkOyCAoBAQECAQgIsiU0ATYktAYCBgICBgv+0QscFvoOFhYO+hYcCwEvCy4CEgUOCQQBXkMBiENeCggLCQYNBwgBNCb+eCU0AQQCCAEsDgv+0AoUD6EWDtYPFAGhDhYCCf7QCgAAAAABAAAAAAI8Ae0ADgAXQBQAAQABAUcAAQABbwAAAGY1FAIFFisBFA8BBiIvASY0NjMhMhYCOwr6CxwL+gsWDgH0DhYByQ4L+gsL+gscFhYAAAH//wAAAjsByQAOABFADgABAAFvAAAAZhUyAgUWKyUUBichIi4BPwE2Mh8BFgI7FA/+DA8UAgz6Ch4K+gqrDhYBFB4L+goK+gsAAAABAAAAAAFnAnwADQAXQBQAAQABAUcAAQABbwAAAGYXEwIFFisBERQGIi8BJjQ/ATYyFgFlFCAJ+goK+gscGAJY/gwOFgv6CxwL+gsWAAAAAAEAAAAAAUECfQAOAAq3AAAAZhQBBRUrARQPAQYiJjURND4BHwEWAUEK+gscFhYcC/oKAV4OC/oLFg4B9A8UAgz6CgAAAgAA/7EDWwMLACQARwBdQFpDJQIGCS8BBQYXAQMCCAEBAwRHAAkIBggJBm0HAQUGAgYFAm0EAQIDBgIDawABAwADAQBtAAgABgUIBmAAAwEAA1QAAwMAWAAAAwBMRkUmJSU2JSY1FCQKBR0rARQVDgEjIiYnBwYiJj0BNDY7ATIWBg8BHgE3MjY3Njc2OwEyFhMVFAYrASImNj8BJiMiBgcGBwYrASImNzU+ATMyFhc3NjIWA0sk5JlRmDxICxwWFg76DhYCCU0oZDdKgicGGAQMawgKDhQQ+g4WAglNUnBLgicGFwUMbwcMASTmmVGaPEgLHBgBBQMBlro+OUgLFg76DhYWHAtNJCoBSj4KOA0MAbj6DhYWHAtNTUo+CjgNDAYElro+OUgLFgAAAgAA//kDoAMLAC0AQgBOQEs7AQQGJQEFBAJHAAcBAgEHAm0ABgIEAgYEbQAEBQIEBWsABQMCBQNrAAEAAgYBAmAAAwAAA1QAAwMAWAAAAwBMFBcVJzU5NTMIBRwrARUUBiMhIiY1ETQ2NyEyFx4BDwEGIycmIyEiBgcRFBYXITI2PQE0PwE2MzIXFhMBBiIvASY0PwE2Mh8BATYyHwEWFAMSXkP+MENeXkMB0CMeCQMHGwYHBQ0M/jAlNAE2JAHQJTQFJAYHAwQLgf45DSQO8A4OPQ4kDpMBaQ0kDj4NAUuxQ15eQwHQQl4BDgQTBhwFAQM0Jf4wJTQBNiSNCAUjBgIEAQX+Og4O8A0kDj4NDZMBaQ0NPQ4kAAIAAP/5AxMDCwAPAB8AK0AoAAMEAQABAwBgAAECAgFUAAEBAlgAAgECTAIAHhsWEwoHAA8CDwUFFCsBISIGBxEUFhchMjY1ETQmFxEUBiMhIiY1ETQ2NyEyFgJx/jAlNAE2JAHQJTQ0fF5D/jBDXl5DAdBCYALDNCX+MCU0ATYkAdAlNFn+MENeXkMB0EJeAWAAAAAEAAD/sQNZAwsAAwAhADEARQBRQE4rKiMiBAgEAUcNAQQGAQgCRgAKBwEECAoEYAAIAAMGCANgAAYAAQAGAV4FAgIACQkAUgUCAgAACVgACQAJTEA9ODUXJjMREzsRERALBR0rFyE1IQUzETQmLwEuAQcVFAYjISImJzUjETM1NDYzITIWBwM1NCYrASIGFxUUFjczMjYFERQGIyEiJicRNDYzITIWHwEeAdYBrf5TAfRIDAWdBRwIHhf+vhYeAUhIIBUB0RYgAdYKCGsHDAEKCGsHDAFkHhf9EhceASAWAgUXNg+cEBYH1tYB9AgaB5wGDAHoFiAgFuj9NugWICAWAR6yCAoKCLIHDAEKCv36FiAgFgLuFiAYDp0PNgAAAAABAAD/1QI8ARcADgAXQBQAAQABAUcAAQABbwAAAGYmFAIFFislFA8BBiIvASY0NjchMhYCOwr6CxwL+gsWDgH0DhbzDwr6Cwv6Ch4UARYAAAH//wAAAjsC5wAOABFADgABAAFvAAAAZhUyAgUWKwEUBiMhIi4BPwE2Mh8BFgI7FA/+DA8UAgz6Ch4K+goByQ4WFhwL+gsL+goAAAAEAAD/agOfA1IACgAiAD4ATgExQA8XAQADNCwCBggmAQEJA0dLsBNQWEBKEQEDAANvAAcGAgYHZQQBAgoGAgprEwEKCQkKYwAAAA0MAA1eFBIQDgQMDwELCAwLXgAIAAYHCAZeAAkBAQlUAAkJAVkFAQEJAU0bS7AUUFhASxEBAwADbwAHBgIGB2UEAQIKBgIKaxMBCgkGCglrAAAADQwADV4UEhAOBAwPAQsIDAteAAgABgcIBl4ACQEBCVQACQkBWQUBAQkBTRtATBEBAwADbwAHBgIGBwJtBAECCgYCCmsTAQoJBgoJawAAAA0MAA1eFBIQDgQMDwELCAwLXgAIAAYHCAZeAAkBAQlUAAkJAVkFAQEJAU1ZWUAoPz8jIz9OP05NTEtKSUhHRkVEQ0JBQCM+Iz49OxERGRQUIyQeEBUFHSsBMy8BJjUjDwEGBwEUDwEGIi8BJjY7ARE0NjsBMhYVETMyFgUVITUTNj8BNSMGKwEVIzUhFQMGDwEVNzY7ATUTFSM1MycjBzMVIzUzEzMTApliKAYCAgECAgP+2gayBQ4GswgIDWsKCGsICmsICgHS/rrOBwUGCAYKgkMBPc4ECAYIBQuLdaEqGogaKqAngFuAAm56GgkCCwoKBv1GBgeyBQWzCRUDAAgKCgj9AApKgjIBJwsFBQECQIAy/tgECgcBAQJCAfU8PFBQPDwBcf6PAAAAAAQAAP9qA58DUgAKACIAMgBNAUNADEY+FwMOAzYBDRECR0uwE1BYQFEADw4SDg9lFAESERESYwALDQINCwJtBAECAA0CAGsQAQMADg8DDl4AEQANCxENXwAAAAcGAAdeEwwKCAQGAQEGUhMMCggEBgYBVgkFAgEGAUobS7AUUFhAUgAPDhIOD2UUARIRDhIRawALDQINCwJtBAECAA0CAGsQAQMADg8DDl4AEQANCxENXwAAAAcGAAdeEwwKCAQGAQEGUhMMCggEBgYBVgkFAgEGAUobQFMADw4SDg8SbRQBEhEOEhFrAAsNAg0LAm0EAQIADQIAaxABAwAODwMOXgARAA0LEQ1fAAAABwYAB14TDAoIBAYBAQZSEwwKCAQGBgFWCQUCAQYBSllZQCgzMyMjM00zTUxJRURDQkFANTQjMiMyMTAvLi0sERERFBQjJB4QFQUdKyUzLwEmNSMPAQYHBRQPAQYiLwEmNjsBETQ2OwEyFhURMzIWBRUjNTMnIwczFSM1MxMzEwMVITUTNj8BNSIGJwYrARUjNSEVAw8BFTczNQKZYigGAgIBAgID/toGsgUOBrMICA1rCghrCAprCAoCBKEqGogaKqAngFuAC/66zgcFBgEEAwYKgkMBPc4MBgibM3oaCQILCgkHfwYHsgUFswkVAwAICgoI/QAKkTs7UFA7OwFy/o4Cg4MzAScKBQUCAgECQIAy/tkPBQICQwAAA//5/5YDkwMwABQAHAApAAq3JiAZFhMJAy0rAR4BDwEOAScBBi4CNwEmNj8BNhYBFjYnJg4CAR4CNi4EBh4BAyc+LhyGEFwy/mgSTkgaEgGYBhQQiBiI/n4gXiAOMCgGAV4eTDAGDCg8SC4ICigCwj6IGIYQFAb+aBIYSkwSAZgyXBCIHDD+KiBcJA4IKC4BGh4oCgguSjwoDAgwTAAAAAMAAP9qAjADUgAbACgAYgBJQEY1MgICAzYBBAJYTQIABgNHAAUEBgQFBm0ABgAEBgBrAAAAbgABAAMCAQNgAAIEBAJUAAICBFgABAIETFNSGhskJx0aBwUaKwEUDgEUHgEdARQGIiY9ATQ+ATQuAT0BNDYyFhUFBwYXFjMyNzYnJiMiEzQ+Aj8BNjU3BiInFxQfAxYmFiMUDgIPAgYmBjUGHQE+AjU0MhUUHgEXNTQvAiYvAS4BAjBgYmJgrNisYGJiYK7Urv4eEgQIXHyEWA4eYGp4kAgcDBkdXAJk9GQEWi0TEREMHgwCCgYIDA8PAiJaCHRENEJ6BlwrEg0FDAcEAm4saF48XGYudiJOTiJ2LmZcPF5oLHYgTk4gBg4IBjQyChQ2/koSHiQOGBxcHjI2NjIgWisTFRUCMAoSEg4KDxAQAiIBWiBCBCYwIh4eIjAmBEIeXCkTDggUDBYAAAABAAAAAAH0ApIACwAGswoFAS0rARYUBwEGJjURNDYXAeYODv5UGCIiGAF4Ch4K/vYQFB4CAh4UEAAAAAABAAAAAAJYAooADAAYQBUCAQABAG8AAQFmAQAHBAAMAQsDBRQrATIVERQjISI1ETQ2MwIOSkr+PkwkKAKKQP4qQkIB1iQcAAACAAAAAAISArwACAARACNAIAUCBAMAAQBvAwEBAWYKCQEADg0JEQoRBQQACAEIBgUUKwEyFREUIjURNCEyFREUIjURNAG4WrT+/Fq0ArxA/cZCQgI6QED9xkJCAjpAAAACAAAAAAJYAoIACwAUABhAFQIBAAEAbwABAWYNDBEQDBQNFAMFFCsBFhQHBQYmNRE0NhclMhURFCI1ETQBnA4O/pYWHBwWAdxKlgF2ChoK5A4SGgG6GhIOKDr+Ljo6AdI6AAAAAgAAAAACWAKCAAwAFAARQA4AAAEAbwABAWYTHgIFFisTNDclNhYVERQGJyUmJzQyFREUIjWuDgFsFBwcFP6UDq6WlgFeDgrkDhIa/kYaEg7kCvY6Ov4uOjoAAAACAAAAAANwAnwACwAXAAi1FhEKBQItKwEWFAcFBiY1ETQ2FwcWFAcFBiY1ETQ2FwNiDg7+jBYeHhZSDg7+mBQgIBQBdgocCPgOEBwB4hwQDvgKHAj4DhAcAeIcEA4AAAACAAAAAANwAnwADAAZAAi1FhEJBAItKxE0NyU2FhURFAYnJSYlNDclNhYVERQGJyUmDgF2FCAgFP6KDgHGDgFoFCAgFP6YDgFeDgr4DhAc/h4cEA74CA4OCvgOEBz+HhwQDvgIAAAAAAIAAP/XAyUC5QATACYAOUA2JAoCAAMBRwACAQJvBAEAAwBwAAEDAwFUAAEBA1gFAQMBA0wVFAEAFCYVJg8NCAcAEwETBgUUKwUiLwEmNDc2Mh8BEz4BMzIWBwEGASIGFh8BFjY3ATYmJyYGBwMnJgFtQi3QLi4shCw/oBRKKlhcLP78K/7SFSABENASNAwBBAsOERMoC+OgDykt0S6BLiwsPgEfJiyYUf4rUAGhICkQ0RMIFgHVFygICgwS/migDwAAAAAE/+P/lgQeAyYADAAZAB4AKQBMQEkiAQQGAUcABgAEAAYEbQgBAgcBAAYCAGAABAAFAQQFYAABAwMBVAABAQNYAAMBA0wODQEAKCceHRwbFRINGQ4ZCAUADAEMCQUUKwEiBwEGFjMhMjYnASYnMhcBFgYjISImNwE2EzQyFCITFA8BJyY1ND4BFgICMSD+zCAqQgJxQSwi/s0hL2o/ATQ/Z339j3trQAE1PieIiJIGR0kGLkIsAr03/f83UFA3AgE3aWv9/2m7uWsCAWv9dEWIAXwOD7OzDw4gLgIyAAAAAAoAAP/IAy0C9QAUACkAOQBCAEsAVABdAGYAbwB4AJNAkBUBAAADBwADYAAHAAgFBwhgCQEFAAoGBQpgEwELFAEMBAsMYAAGFwEEDQYEYAANAA4SDQ5gABEAEg8REmAADwAQAg8QYBYBAgEBAlQWAQICAVgAAQIBTCwqFhUBAHd2c3JubWppZWRhYFxbWFdTUk9OSklGRUFAPTw2NDIxKjksOSAfFSkWKQsKABQBFBgFFCsBMhcWFxYUBwYHBiInJicmNDc2NzYTMjc2NzY0JyYnJiIHBgcGFBcWFxYTIyIvASY+Ah8BMzIWDgEDNDYyFhQGIiYXNDYyFhQGIiYXNDYyFhQGIiYHNDYyFhQGIiYHNDYyFhQGIiYnNDYyFhQGIiYnNDYyFhQGIiYBlm5fXDY4ODZcX91eXDY3NzZcXm9WSkgqKysqSEqsSkgqKysqSErOfxUMjw4EGiMOgmwWFwIXpQ8SDw4UDqcOEg8OEw5JDxIPDhQOQg4UDg8SD68OFA4PEg+iDhIPDhQNSw4SDw4UDQL1ODVcX91eXDY4ODZcXt1fXDU4/S0sKkhKrEpHKisrKkdKrEpIKiwBDA+cDyIYAg6OGyQbAR8KDg4UDg84Cg4OFA4PogkPDxIPDp4KDg4TDg4/CQ8PEg8OSwkPDxIPDrkJDw8SDw4AAAADAAD/agPTA1IANQBmAI0AN0A0eQECA1Q2AgAEHwACAQADRwADAgNvAAIEAm8ABAAEbwAAAQBvAAEBZoeGbWw7OiwrFAUFFSs1PgI3Mh4BFxYXFj4BMzc2PwE2NzYeAR8BHgIXFhcOAgcOAQcOAQ8BBiInJSYvAi4CET4CNzIWHwIWFxY2PwE2Nz4CNzYeATMeAxcOAgcFDgMnJicuAycmET4CNyUyHgEfARYXHgIXFhcOAg8BBg8BBg8BBiYjJScuAScmCyo4DBMeJAcv1RMiLAJNOR4qJhYNHhAPEgMaCgYDAQoqPAorqiwHHAkaERQU/vgGGjM2HSIJCyo6DBMeFBl/VSoTJBUZRFwLKiITECAqAgUWDgcBCipACf7+ByYULA7WLgZMPj4DBAosPAsBXB4wQAh1TicEQioGAwEJIjQJjF0uFA4JGRAWEf8APztWBQRYDxYSBggWAhViBAgcIxoNFRMFAgYICQsCCAgHBAoNFhYFFFQTAxIECwcCewMLFhgNFgkBFQ8UFAUICw46JxQFCgwOICgFGA4EAwgaAwYKCwkOFhgEfAMWCAwGZRUDIBwgBgQBFQ8YFAaiDiYDNiQTAhoWCQQJDRIUBEIsFwsIBAsHAnccGigKBAAAAAACAAD/agO1A1IADAAYAGJAXwEBAwIBRwADAgECAwFtAAEHAgEHawAHBgIHBmsAAAACAwACXggBBg0LAgkEBgleAAQFBQRSAAQEBVYKDAIFBAVKDQ0AAA0YDRgXFhUUExIREA8OAAwADBERERESDgUZKxURNyERIxEhFSMRIRUnNTM1MxUzFSMVIzW8AgdW/o+mAaKD0aDPz6CWAzK2/qQBBJz9ZFjPos/Pos/PAAAAAAQAAP9qA+gDUwASABwAJQAxAEtASBoYAwMECA4BAQQCRwAIBwQHCARtAAAABQYABWAABgAHCAYHYAAEAAEDBAFgAAMCAgNUAAMDAlgAAgMCTBMhJBMZFBMjFwkFHSsVNDcBJjU0NgQWEAYHIicBBiImNxQWNj8BJicHBgEUFiQ2ECYkBhc0NjcyFCMiBhcUIiEBBCvaATra2p1eUv78IVxANyAuEfwtIfwRAQK2AQS2tv78tl2CWRAQTm4BICkvIQEEUl6a3gLa/sbYASv+/CFALhYiAhD8IS38EQHsgbgCtAEGtAK4gVqAASBsTxAAAAcAAP9qA+4DUgAeACsAOQA/AEkAUQBgAFlAVldWUUlFPQYFBkQBBAVMAQMETS8lAAQCAwRHAAYHBQcGBW0ABQQHBQRrAAAABwYAB2AABAADAgQDYAACAQECVAACAgFYAAECAUxfXVNSHRMWFCwtCAUaKxU0NjQ2PQETNjcBNTc2MzIXHgEHAQYHBQcGIgYjIiY3FBYzMj8BNicmDwEGNx4BFz8BNiYnLgEHBgc3FhcBJgcDFhcWFwEmJyYnAxYXFTc1Ni8BMhcWFxU3NicmJyYjIgcCAkoKFQFFmDxWalBKDkH+JBgf/vkKBAoKBC1APxoUBhBzBC8tPCADLENmAXQLKQ42M4AwBwRjLS0BJ1g4eiYbFRQBKRAXHiWvEQTyPR7BalBGCDQtBAU5P1A8KSkECAgIAgIBCx8WAUQCmjtQSsJA/h8XCEYDAQJALRMcBCA6Ly0Cdw6kAmRGHgYviDUxFCIKC28CEgEnFjf+6xQZFiEBKx8YHRD+VCkpGPUCPGDTUEldFjctQko5PikAAAAE////iQPpAzMAHwAvAD8AQwCLQBAvAQYFJwEEBxsYDgMCAQNHS7AKUFhALwACAQECZAAAAAUGAAVgAAYACQgGCV4ACAAHBAgHYAAEAQEEVAAEBAFYAwEBBAFMG0AuAAIBAnAAAAAFBgAFYAAGAAkIBgleAAgABwQIB2AABAEBBFQABAQBWAMBAQQBTFlADkNCEiY2NTQmNiUzCgUdKzURNDY3ITIWBxEUBgchFRcWFRQGIyEiJjc0PwE1ISImNxQWFyEyNicRNCYnISIGFxMRNDYzITIWFREUBgchIiY3IREhNigDLCc4ATYo/sjDFxAP/c4OEgEXw/7IJzhAEA8DLA4SARAP/NQOEgE+Eg0CsA0SEg39UA0SHwKw/VBkAnEnNgE4Jv2PJzYBJRkGGg0SEg0aBhklOCYOEAESDQJxDhABEg3+DAG1DhISDv5LDhABEg0BtQAAAAMAAP5YBT0EcgBbAI0A7ABfQFx1NgIBAn0BBgGBUwIDBaMBBAPOxoUABAcE4d0CAAcGRwACAQJvAAEGAW8ABgUGbwAEAwcDBAdtAAUAAwQFA2AABwcAWAAAAA0ASeXiuLerqaKgm5pkYjU0GAgFFSsFDgEHDgEHDgImJy4BJy4CNS4BJy4BJyY3Njc2NzYnFicmJyYnJj4BNz4DNzY3Njc2MzcuAScmNzY3Njc2Nz4CFxYXHgEHBhcWHwEWFxYXBwYHDgQTJjcSJy4BIw4BBwYHBgcGBw4BFxYXFhcWFwYmJyYnJjMXFhcWBxYXFhU2PwE2NzYnJgEOATc2Nz4BNzYnJiciBw4BBwYnJicWNzY3PgE3Njc2JyYnJgcGBw4BBw4BBwYXFhcWFxYVBgcGBxQWFx4BFxYXFhcWFxYXFhcWNjc2NzYnBicmJzY3MhcWNz4BJicmBLQEDg0TYCQXXEEbEBQvIR4eDAEVHScqBgIEAggHAQIFAR4QCw4LEAIiHRpNWzgqKxQgHyItBiklAQEOBgsIBwoQEz41G1kfHQgXGi4NCAkEBQYMOw0JCg8MCQcgKB0zRhJJIh8qDgwJBggLAw8BDxEhFiovEg0bDgsPGwEEUhIQIyAUFgkUIhQJCgoI/t0gMQcEOzhUDA0YG0QYIRJPFCAZHhgkKRgwLTooMAwJDSM8MEMpSCs+PUc+AQEPChgaCBABBwgCJioXEwQEAgQDDi8hExsZH1ooKxYZBkgkNyYQFAwXOS8qKw8lKjM9TBsrbRUNFgENGB0oEA8ZIBsgJhYdNRwQFQkdFw4VEAEZDgoODh9ORRINEggTGhcJDwYIfCdHKiY3EyciEBkSFBsGCBlBPehxV10hHSkSCQwKXRUQEiMmLTUB2UpwAQeKGiQBEhEPFhAdJgohSyAiHRQeIA8CAwQDBgluJkpBVxgmLDcZIDYgGSoqIv5KCAUGBBoSUC4wIycOCQUeBgkBAQ8HDAcXFhABAy4kMz4OChUNIxYSBwVBSRURDBASCBASFyktEx4wFwwTEA4gLQcKHhQRFyEMCRMUHyIoBwQFHgQBAQ8TEUdCCw0AA//5/1UC3wNoAAAABgAeACRAIRgNBgUEAwIHAQABRwIBAAEAbwABAWYIBxUTBx4IHgMFFCsBMQEFAwElEzIWFxQPARceAQcBBiMiJj8BJy4BNwE2Ae/+eQEFggGG/vyCKzwBCl22Kw4n/nofKTg8FV+1LBAoAYYfAv/+j5f+xwFylgGiPisWFuBpGWgl/o4dXjPkaRlmJwFyHQAAAwAA/2kD6gNTAAgAEQAVADJALwAAAAMEAANgAAQGAQUCBAVeAAIBAQJUAAICAVgAAQIBTBISEhUSFRMTFBMSBwUZKxE0AAQAAgAEADcUFiQ2ECYkBhc1IRUBJgGcASgE/uD+XP7ihdQBLtTU/tLUYQIUAV7PASYC/t7+Xv7eAgEmz5bWAtIBMNIC1vjExAAAAQAAAAEAADIUC+JfDzz1AAsD6AAAAADUZixSAAAAANRmLFL/4/5YBT0EcgAAAAgAAgAAAAAAAAABAAADUv9qAAAGv//j/+QFPQABAAAAAAAAAAAAAAAAAAAALwPoAAAD6P/wA+gAAAMRAAACOwAAA1n//QNZ//0BZQAAA+gAAAMRAAADoAAABC8AAANZAAADWQAAA6AAAAI7AAACO///AWUAAAFlAAADWQAAA6AAAAMRAAADWQAAAjsAAAI7//8DoAAAA6AAAAOG//kCMAAAAfQAAAJYAAACEgAAAlgAAAJYAAADcAAAA3AAAAMPAAAEAv/jAy0AAAPTAAADtQAAA+gAAAPoAAAD6P//Br8AAALZ//kD6AAAAAAAAABmAKoA9AGAAgYCfgLiA2gELASEBRAFdgYABoIGqgbQBvgHGgewCDwIhgkWCT4JZApwC4IL0gyCDKAMxAz0DSYNVA2EDbgOGg6KD4gQeBDQEUgSEBK8FFIUoBToAAEAAAAvAO0ACgAAAAAAAgAwAEAAcwAAAKQLcAAAAAAAAAASAN4AAQAAAAAAAAA1AAAAAQAAAAAAAQAEADUAAQAAAAAAAgAHADkAAQAAAAAAAwAEAEAAAQAAAAAABAAEAEQAAQAAAAAABQALAEgAAQAAAAAABgAEAFMAAQAAAAAACgArAFcAAQAAAAAACwATAIIAAwABBAkAAABqAJUAAwABBAkAAQAIAP8AAwABBAkAAgAOAQcAAwABBAkAAwAIARUAAwABBAkABAAIAR0AAwABBAkABQAWASUAAwABBAkABgAIATsAAwABBAkACgBWAUMAAwABBAkACwAmAZlDb3B5cmlnaHQgKEMpIDIwMTYgYnkgb3JpZ2luYWwgYXV0aG9ycyBAIGZvbnRlbGxvLmNvbWVwZ2RSZWd1bGFyZXBnZGVwZ2RWZXJzaW9uIDEuMGVwZ2RHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuaHR0cDovL2ZvbnRlbGxvLmNvbQBDAG8AcAB5AHIAaQBnAGgAdAAgACgAQwApACAAMgAwADEANgAgAGIAeQAgAG8AcgBpAGcAaQBuAGEAbAAgAGEAdQB0AGgAbwByAHMAIABAACAAZgBvAG4AdABlAGwAbABvAC4AYwBvAG0AZQBwAGcAZABSAGUAZwB1AGwAYQByAGUAcABnAGQAZQBwAGcAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAZQBwAGcAZABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAGgAdAB0AHAAOgAvAC8AZgBvAG4AdABlAGwAbABvAC4AYwBvAG0AAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETARQBFQEWARcBGAEZARoBGwEcAR0BHgEfASABIQEiASMBJAElASYBJwEoASkBKgErASwBLQEuAS8BMAAIcHJvZ3Jlc3MGcmVjb3JkBmNhbmNlbARoZWxwDGhlbHAtY2lyY2xlZAxpbmZvLWNpcmNsZWQEaW5mbwhsaW5rLWV4dAV0cmFzaA1mb2xkZXItY2xvc2VkDWZvbGRlci1vcGVuZWQEbWVudQVsb2dpbgZsb2dvdXQIZG93bi1kaXIGdXAtZGlyCGxlZnQtZGlyCXJpZ2h0LWRpcgdyZWZyZXNoBWNoZWNrC2NoZWNrLWVtcHR5BHNhdmUJc29ydC1kb3duB3NvcnQtdXAMc29ydC1uYW1lLXVwDnNvcnQtbmFtZS1kb3duCmZsYXNobGlnaHQEd2FpdARwbGF5BHN0b3AFcGF1c2UGdG8tZW5kCHRvLXN0YXJ0B2ZvcndhcmQGcmV3aW5kAm9rB3dhcm5pbmcFY2xvY2sGYnVmZmVyB2RvYy1uZXcGc2VhcmNoBGVkaXQCdHYNdGh1bWItcmF0ZS11cA1mbGFzaC1vdXRsaW5lBWVycm9yAAAAAAEAAf//AA8AAAAAAAAAAAAAAAAAAAAAABgAGAAYABgEcv5YBHL+WLAALCCwAFVYRVkgIEu4AA5RS7AGU1pYsDQbsChZYGYgilVYsAIlYbkIAAgAY2MjYhshIbAAWbAAQyNEsgABAENgQi2wASywIGBmLbACLCBkILDAULAEJlqyKAEKQ0VjRVJbWCEjIRuKWCCwUFBYIbBAWRsgsDhQWCGwOFlZILEBCkNFY0VhZLAoUFghsQEKQ0VjRSCwMFBYIbAwWRsgsMBQWCBmIIqKYSCwClBYYBsgsCBQWCGwCmAbILA2UFghsDZgG2BZWVkbsAErWVkjsABQWGVZWS2wAywgRSCwBCVhZCCwBUNQWLAFI0KwBiNCGyEhWbABYC2wBCwjISMhIGSxBWJCILAGI0KxAQpDRWOxAQpDsAFgRWOwAyohILAGQyCKIIqwASuxMAUlsAQmUVhgUBthUllYI1khILBAU1iwASsbIbBAWSOwAFBYZVktsAUssAdDK7IAAgBDYEItsAYssAcjQiMgsAAjQmGwAmJmsAFjsAFgsAUqLbAHLCAgRSCwC0NjuAQAYiCwAFBYsEBgWWawAWNgRLABYC2wCCyyBwsAQ0VCKiGyAAEAQ2BCLbAJLLAAQyNEsgABAENgQi2wCiwgIEUgsAErI7AAQ7AEJWAgRYojYSBkILAgUFghsAAbsDBQWLAgG7BAWVkjsABQWGVZsAMlI2FERLABYC2wCywgIEUgsAErI7AAQ7AEJWAgRYojYSBksCRQWLAAG7BAWSOwAFBYZVmwAyUjYUREsAFgLbAMLCCwACNCsgsKA0VYIRsjIVkqIS2wDSyxAgJFsGRhRC2wDiywAWAgILAMQ0qwAFBYILAMI0JZsA1DSrAAUlggsA0jQlktsA8sILAQYmawAWMguAQAY4ojYbAOQ2AgimAgsA4jQiMtsBAsS1RYsQRkRFkksA1lI3gtsBEsS1FYS1NYsQRkRFkbIVkksBNlI3gtsBIssQAPQ1VYsQ8PQ7ABYUKwDytZsABDsAIlQrEMAiVCsQ0CJUKwARYjILADJVBYsQEAQ2CwBCVCioogiiNhsA4qISOwAWEgiiNhsA4qIRuxAQBDYLACJUKwAiVhsA4qIVmwDENHsA1DR2CwAmIgsABQWLBAYFlmsAFjILALQ2O4BABiILAAUFiwQGBZZrABY2CxAAATI0SwAUOwAD6yAQEBQ2BCLbATLACxAAJFVFiwDyNCIEWwCyNCsAojsAFgQiBgsAFhtRAQAQAOAEJCimCxEgYrsHIrGyJZLbAULLEAEystsBUssQETKy2wFiyxAhMrLbAXLLEDEystsBgssQQTKy2wGSyxBRMrLbAaLLEGEystsBsssQcTKy2wHCyxCBMrLbAdLLEJEystsB4sALANK7EAAkVUWLAPI0IgRbALI0KwCiOwAWBCIGCwAWG1EBABAA4AQkKKYLESBiuwcisbIlktsB8ssQAeKy2wICyxAR4rLbAhLLECHistsCIssQMeKy2wIyyxBB4rLbAkLLEFHistsCUssQYeKy2wJiyxBx4rLbAnLLEIHistsCgssQkeKy2wKSwgPLABYC2wKiwgYLAQYCBDI7ABYEOwAiVhsAFgsCkqIS2wKyywKiuwKiotsCwsICBHICCwC0NjuAQAYiCwAFBYsEBgWWawAWNgI2E4IyCKVVggRyAgsAtDY7gEAGIgsABQWLBAYFlmsAFjYCNhOBshWS2wLSwAsQACRVRYsAEWsCwqsAEVMBsiWS2wLiwAsA0rsQACRVRYsAEWsCwqsAEVMBsiWS2wLywgNbABYC2wMCwAsAFFY7gEAGIgsABQWLBAYFlmsAFjsAErsAtDY7gEAGIgsABQWLBAYFlmsAFjsAErsAAWtAAAAAAARD4jOLEvARUqLbAxLCA8IEcgsAtDY7gEAGIgsABQWLBAYFlmsAFjYLAAQ2E4LbAyLC4XPC2wMywgPCBHILALQ2O4BABiILAAUFiwQGBZZrABY2CwAENhsAFDYzgtsDQssQIAFiUgLiBHsAAjQrACJUmKikcjRyNhIFhiGyFZsAEjQrIzAQEVFCotsDUssAAWsAQlsAQlRyNHI2GwCUMrZYouIyAgPIo4LbA2LLAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjILAIQyCKI0cjRyNhI0ZgsARDsAJiILAAUFiwQGBZZrABY2AgsAErIIqKYSCwAkNgZCOwA0NhZFBYsAJDYRuwA0NgWbADJbACYiCwAFBYsEBgWWawAWNhIyAgsAQmI0ZhOBsjsAhDRrACJbAIQ0cjRyNhYCCwBEOwAmIgsABQWLBAYFlmsAFjYCMgsAErI7AEQ2CwASuwBSVhsAUlsAJiILAAUFiwQGBZZrABY7AEJmEgsAQlYGQjsAMlYGRQWCEbIyFZIyAgsAQmI0ZhOFktsDcssAAWICAgsAUmIC5HI0cjYSM8OC2wOCywABYgsAgjQiAgIEYjR7ABKyNhOC2wOSywABawAyWwAiVHI0cjYbAAVFguIDwjIRuwAiWwAiVHI0cjYSCwBSWwBCVHI0cjYbAGJbAFJUmwAiVhuQgACABjYyMgWGIbIVljuAQAYiCwAFBYsEBgWWawAWNgIy4jICA8ijgjIVktsDossAAWILAIQyAuRyNHI2EgYLAgYGawAmIgsABQWLBAYFlmsAFjIyAgPIo4LbA7LCMgLkawAiVGUlggPFkusSsBFCstsDwsIyAuRrACJUZQWCA8WS6xKwEUKy2wPSwjIC5GsAIlRlJYIDxZIyAuRrACJUZQWCA8WS6xKwEUKy2wPiywNSsjIC5GsAIlRlJYIDxZLrErARQrLbA/LLA2K4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrErARQrsARDLrArKy2wQCywABawBCWwBCYgLkcjRyNhsAlDKyMgPCAuIzixKwEUKy2wQSyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsAJiILAAUFiwQGBZZrABY2GwAiVGYTgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=') format('truetype');
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.svg?45443790#epgd') format('svg');
+ }
+}
+*/
+
+ [class^="i-"]:before, [class*=" i-"]:before {
+ font-family: "epgd";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+.i-progress:before { content: '\e800'; } /* '' */
+.i-record:before { content: '\e801'; } /* '' */
+.i-cancel:before { content: '\e802'; } /* '' */
+.i-help:before { content: '\e803'; } /* '' */
+.i-help-circled:before { content: '\e804'; } /* '' */
+.i-info-circled:before { content: '\e805'; } /* '' */
+.i-info:before { content: '\e806'; } /* '' */
+.i-link-ext:before { content: '\e807'; } /* '' */
+.i-trash:before { content: '\e808'; } /* '' */
+.i-folder-closed:before { content: '\e809'; } /* '' */
+.i-folder-opened:before { content: '\e80a'; } /* '' */
+.i-menu:before { content: '\e80b'; } /* '' */
+.i-login:before { content: '\e80c'; } /* '' */
+.i-logout:before { content: '\e80d'; } /* '' */
+.i-down-dir:before { content: '\e80e'; } /* '' */
+.i-up-dir:before { content: '\e80f'; } /* '' */
+.i-left-dir:before { content: '\e810'; } /* '' */
+.i-right-dir:before { content: '\e811'; } /* '' */
+.i-refresh:before { content: '\e812'; } /* '' */
+.i-check:before { content: '\e813'; } /* '' */
+.i-check-empty:before { content: '\e814'; } /* '' */
+.i-save:before { content: '\e815'; } /* '' */
+.i-sort-down:before { content: '\e816'; } /* '' */
+.i-sort-up:before { content: '\e817'; } /* '' */
+.i-sort-name-up:before { content: '\e818'; } /* '' */
+.i-sort-name-down:before { content: '\e819'; } /* '' */
+.i-flashlight:before { content: '\e81a'; } /* '' */
+.i-wait:before { content: '\e81b'; } /* '' */
+.i-play:before { content: '\e81c'; } /* '' */
+.i-stop:before { content: '\e81d'; } /* '' */
+.i-pause:before { content: '\e81e'; } /* '' */
+.i-to-end:before { content: '\e81f'; } /* '' */
+.i-to-start:before { content: '\e820'; } /* '' */
+.i-forward:before { content: '\e821'; } /* '' */
+.i-rewind:before { content: '\e822'; } /* '' */
+.i-ok:before { content: '\e823'; } /* '' */
+.i-warning:before { content: '\e824'; } /* '' */
+.i-clock:before { content: '\e825'; } /* '' */
+.i-buffer:before { content: '\e826'; } /* '' */
+.i-doc-new:before { content: '\e827'; } /* '' */
+.i-search:before { content: '\e828'; } /* '' */
+.i-edit:before { content: '\e829'; } /* '' */
+.i-tv:before { content: '\e82a'; } /* '' */
+.i-thumb-rate-up:before { content: '\e82b'; } /* '' */
+.i-flash-outline:before { content: '\e82c'; } /* '' */
+.i-error:before { content: '\e82d'; } /* '' */ \ No newline at end of file
diff --git a/http/3rdParty/fontello/css/epgd-ie7-codes.css b/http/3rdParty/fontello/css/epgd-ie7-codes.css
new file mode 100644
index 0000000..c1b51dc
--- /dev/null
+++ b/http/3rdParty/fontello/css/epgd-ie7-codes.css
@@ -0,0 +1,47 @@
+
+.i-progress { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
+.i-record { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
+.i-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
+.i-help { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
+.i-help-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe804;&nbsp;'); }
+.i-info-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
+.i-info { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
+.i-link-ext { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
+.i-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
+.i-folder-closed { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
+.i-folder-opened { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
+.i-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80b;&nbsp;'); }
+.i-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
+.i-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
+.i-down-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
+.i-up-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
+.i-left-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe810;&nbsp;'); }
+.i-right-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe811;&nbsp;'); }
+.i-refresh { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
+.i-check { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe813;&nbsp;'); }
+.i-check-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe814;&nbsp;'); }
+.i-save { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe815;&nbsp;'); }
+.i-sort-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe816;&nbsp;'); }
+.i-sort-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe817;&nbsp;'); }
+.i-sort-name-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe818;&nbsp;'); }
+.i-sort-name-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe819;&nbsp;'); }
+.i-flashlight { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81a;&nbsp;'); }
+.i-wait { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81b;&nbsp;'); }
+.i-play { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81c;&nbsp;'); }
+.i-stop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81d;&nbsp;'); }
+.i-pause { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
+.i-to-end { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
+.i-to-start { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
+.i-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
+.i-rewind { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
+.i-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe823;&nbsp;'); }
+.i-warning { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe824;&nbsp;'); }
+.i-clock { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe825;&nbsp;'); }
+.i-buffer { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe826;&nbsp;'); }
+.i-doc-new { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe827;&nbsp;'); }
+.i-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe828;&nbsp;'); }
+.i-edit { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe829;&nbsp;'); }
+.i-tv { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82a;&nbsp;'); }
+.i-thumb-rate-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82b;&nbsp;'); }
+.i-flash-outline { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82c;&nbsp;'); }
+.i-error { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82d;&nbsp;'); } \ No newline at end of file
diff --git a/http/3rdParty/fontello/css/epgd-ie7.css b/http/3rdParty/fontello/css/epgd-ie7.css
new file mode 100644
index 0000000..e9a25ae
--- /dev/null
+++ b/http/3rdParty/fontello/css/epgd-ie7.css
@@ -0,0 +1,58 @@
+[class^="i-"], [class*=" i-"] {
+ font-family: 'epgd';
+ font-style: normal;
+ font-weight: normal;
+
+ /* fix buttons height */
+ line-height: 1em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+}
+
+.i-progress { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
+.i-record { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
+.i-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
+.i-help { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
+.i-help-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe804;&nbsp;'); }
+.i-info-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
+.i-info { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
+.i-link-ext { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
+.i-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
+.i-folder-closed { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
+.i-folder-opened { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
+.i-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80b;&nbsp;'); }
+.i-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
+.i-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
+.i-down-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
+.i-up-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
+.i-left-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe810;&nbsp;'); }
+.i-right-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe811;&nbsp;'); }
+.i-refresh { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
+.i-check { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe813;&nbsp;'); }
+.i-check-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe814;&nbsp;'); }
+.i-save { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe815;&nbsp;'); }
+.i-sort-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe816;&nbsp;'); }
+.i-sort-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe817;&nbsp;'); }
+.i-sort-name-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe818;&nbsp;'); }
+.i-sort-name-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe819;&nbsp;'); }
+.i-flashlight { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81a;&nbsp;'); }
+.i-wait { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81b;&nbsp;'); }
+.i-play { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81c;&nbsp;'); }
+.i-stop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81d;&nbsp;'); }
+.i-pause { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
+.i-to-end { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
+.i-to-start { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
+.i-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
+.i-rewind { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
+.i-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe823;&nbsp;'); }
+.i-warning { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe824;&nbsp;'); }
+.i-clock { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe825;&nbsp;'); }
+.i-buffer { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe826;&nbsp;'); }
+.i-doc-new { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe827;&nbsp;'); }
+.i-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe828;&nbsp;'); }
+.i-edit { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe829;&nbsp;'); }
+.i-tv { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82a;&nbsp;'); }
+.i-thumb-rate-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82b;&nbsp;'); }
+.i-flash-outline { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82c;&nbsp;'); }
+.i-error { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe82d;&nbsp;'); } \ No newline at end of file
diff --git a/http/3rdParty/fontello/css/epgd.css b/http/3rdParty/fontello/css/epgd.css
new file mode 100644
index 0000000..3396c72
--- /dev/null
+++ b/http/3rdParty/fontello/css/epgd.css
@@ -0,0 +1,103 @@
+@font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.eot?78346169');
+ src: url('../font/epgd.eot?78346169#iefix') format('embedded-opentype'),
+ url('../font/epgd.woff2?78346169') format('woff2'),
+ url('../font/epgd.woff?78346169') format('woff'),
+ url('../font/epgd.ttf?78346169') format('truetype'),
+ url('../font/epgd.svg?78346169#epgd') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.svg?78346169#epgd') format('svg');
+ }
+}
+*/
+
+ [class^="i-"]:before, [class*=" i-"]:before {
+ font-family: "epgd";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Font smoothing. That was taken from TWBS */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+
+.i-progress:before { content: '\e800'; } /* '' */
+.i-record:before { content: '\e801'; } /* '' */
+.i-cancel:before { content: '\e802'; } /* '' */
+.i-help:before { content: '\e803'; } /* '' */
+.i-help-circled:before { content: '\e804'; } /* '' */
+.i-info-circled:before { content: '\e805'; } /* '' */
+.i-info:before { content: '\e806'; } /* '' */
+.i-link-ext:before { content: '\e807'; } /* '' */
+.i-trash:before { content: '\e808'; } /* '' */
+.i-folder-closed:before { content: '\e809'; } /* '' */
+.i-folder-opened:before { content: '\e80a'; } /* '' */
+.i-menu:before { content: '\e80b'; } /* '' */
+.i-login:before { content: '\e80c'; } /* '' */
+.i-logout:before { content: '\e80d'; } /* '' */
+.i-down-dir:before { content: '\e80e'; } /* '' */
+.i-up-dir:before { content: '\e80f'; } /* '' */
+.i-left-dir:before { content: '\e810'; } /* '' */
+.i-right-dir:before { content: '\e811'; } /* '' */
+.i-refresh:before { content: '\e812'; } /* '' */
+.i-check:before { content: '\e813'; } /* '' */
+.i-check-empty:before { content: '\e814'; } /* '' */
+.i-save:before { content: '\e815'; } /* '' */
+.i-sort-down:before { content: '\e816'; } /* '' */
+.i-sort-up:before { content: '\e817'; } /* '' */
+.i-sort-name-up:before { content: '\e818'; } /* '' */
+.i-sort-name-down:before { content: '\e819'; } /* '' */
+.i-flashlight:before { content: '\e81a'; } /* '' */
+.i-wait:before { content: '\e81b'; } /* '' */
+.i-play:before { content: '\e81c'; } /* '' */
+.i-stop:before { content: '\e81d'; } /* '' */
+.i-pause:before { content: '\e81e'; } /* '' */
+.i-to-end:before { content: '\e81f'; } /* '' */
+.i-to-start:before { content: '\e820'; } /* '' */
+.i-forward:before { content: '\e821'; } /* '' */
+.i-rewind:before { content: '\e822'; } /* '' */
+.i-ok:before { content: '\e823'; } /* '' */
+.i-warning:before { content: '\e824'; } /* '' */
+.i-clock:before { content: '\e825'; } /* '' */
+.i-buffer:before { content: '\e826'; } /* '' */
+.i-doc-new:before { content: '\e827'; } /* '' */
+.i-search:before { content: '\e828'; } /* '' */
+.i-edit:before { content: '\e829'; } /* '' */
+.i-tv:before { content: '\e82a'; } /* '' */
+.i-thumb-rate-up:before { content: '\e82b'; } /* '' */
+.i-flash-outline:before { content: '\e82c'; } /* '' */
+.i-error:before { content: '\e82d'; } /* '' */ \ No newline at end of file
diff --git a/http/3rdParty/fontello/demo.html b/http/3rdParty/fontello/demo.html
new file mode 100644
index 0000000..6e86ed0
--- /dev/null
+++ b/http/3rdParty/fontello/demo.html
@@ -0,0 +1,376 @@
+<!DOCTYPE html>
+<html>
+ <head><!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
+ <meta charset="UTF-8"><style>/*
+ * Bootstrap v2.2.1
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+.clearfix {
+ *zoom: 1;
+}
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+ line-height: 0;
+}
+.clearfix:after {
+ clear: both;
+}
+html {
+ font-size: 100%;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+}
+a:focus {
+ outline: thin dotted #333;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+a:hover,
+a:active {
+ outline: 0;
+}
+button,
+input,
+select,
+textarea {
+ margin: 0;
+ font-size: 100%;
+ vertical-align: middle;
+}
+button,
+input {
+ *overflow: visible;
+ line-height: normal;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ padding: 0;
+ border: 0;
+}
+body {
+ margin: 0;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ line-height: 20px;
+ color: #333;
+ background-color: #fff;
+}
+a {
+ color: #08c;
+ text-decoration: none;
+}
+a:hover {
+ color: #005580;
+ text-decoration: underline;
+}
+.row {
+ margin-left: -20px;
+ *zoom: 1;
+}
+.row:before,
+.row:after {
+ display: table;
+ content: "";
+ line-height: 0;
+}
+.row:after {
+ clear: both;
+}
+[class*="span"] {
+ float: left;
+ min-height: 1px;
+ margin-left: 20px;
+}
+.container,
+.navbar-static-top .container,
+.navbar-fixed-top .container,
+.navbar-fixed-bottom .container {
+ width: 940px;
+}
+.span12 {
+ width: 940px;
+}
+.span11 {
+ width: 860px;
+}
+.span10 {
+ width: 780px;
+}
+.span9 {
+ width: 700px;
+}
+.span8 {
+ width: 620px;
+}
+.span7 {
+ width: 540px;
+}
+.span6 {
+ width: 460px;
+}
+.span5 {
+ width: 380px;
+}
+.span4 {
+ width: 300px;
+}
+.span3 {
+ width: 220px;
+}
+.span2 {
+ width: 140px;
+}
+.span1 {
+ width: 60px;
+}
+[class*="span"].pull-right,
+.row-fluid [class*="span"].pull-right {
+ float: right;
+}
+.container {
+ margin-right: auto;
+ margin-left: auto;
+ *zoom: 1;
+}
+.container:before,
+.container:after {
+ display: table;
+ content: "";
+ line-height: 0;
+}
+.container:after {
+ clear: both;
+}
+p {
+ margin: 0 0 10px;
+}
+.lead {
+ margin-bottom: 20px;
+ font-size: 21px;
+ font-weight: 200;
+ line-height: 30px;
+}
+small {
+ font-size: 85%;
+}
+h1 {
+ margin: 10px 0;
+ font-family: inherit;
+ font-weight: bold;
+ line-height: 20px;
+ color: inherit;
+ text-rendering: optimizelegibility;
+}
+h1 small {
+ font-weight: normal;
+ line-height: 1;
+ color: #999;
+}
+h1 {
+ line-height: 40px;
+}
+h1 {
+ font-size: 38.5px;
+}
+h1 small {
+ font-size: 24.5px;
+}
+body {
+ margin-top: 90px;
+}
+.header {
+ position: fixed;
+ top: 0;
+ left: 50%;
+ margin-left: -480px;
+ background-color: #fff;
+ border-bottom: 1px solid #ddd;
+ padding-top: 10px;
+ z-index: 10;
+}
+.footer {
+ color: #ddd;
+ font-size: 12px;
+ text-align: center;
+ margin-top: 20px;
+}
+.footer a {
+ color: #ccc;
+ text-decoration: underline;
+}
+.the-icons {
+ font-size: 14px;
+ line-height: 24px;
+}
+.switch {
+ position: absolute;
+ right: 0;
+ bottom: 10px;
+ color: #666;
+}
+.switch input {
+ margin-right: 0.3em;
+}
+.codesOn .i-name {
+ display: none;
+}
+.codesOn .i-code {
+ display: inline;
+}
+.i-code {
+ display: none;
+}
+@font-face {
+ font-family: 'epgd';
+ src: url('./font/epgd.eot?36693829');
+ src: url('./font/epgd.eot?36693829#iefix') format('embedded-opentype'),
+ url('./font/epgd.woff?36693829') format('woff'),
+ url('./font/epgd.ttf?36693829') format('truetype'),
+ url('./font/epgd.svg?36693829#epgd') format('svg');
+ font-weight: normal;
+ font-style: normal;
+ }
+
+
+ .demo-icon
+ {
+ font-family: "epgd";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* You can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Font smoothing. That was taken from TWBS */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+ }
+ </style>
+ <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/epgd-ie7.css"><![endif]-->
+ <script>
+ function toggleCodes(on) {
+ var obj = document.getElementById('icons');
+
+ if (on) {
+ obj.className += ' codesOn';
+ } else {
+ obj.className = obj.className.replace(' codesOn', '');
+ }
+ }
+
+ </script>
+ </head>
+ <body>
+ <div class="container header">
+ <h1>
+ epgd
+ <small>font demo</small>
+ </h1>
+ <label class="switch">
+ <input type="checkbox" onclick="toggleCodes(this.checked)">show codes
+ </label>
+ </div>
+ <div id="icons" class="container">
+ <div class="row">
+ <div title="Code: 0xe800" class="the-icons span3"><i class="demo-icon i-progress animate-spin">&#xe800;</i> <span class="i-name">i-progress</span><span class="i-code">0xe800</span></div>
+ <div title="Code: 0xe801" class="the-icons span3"><i class="demo-icon i-record">&#xe801;</i> <span class="i-name">i-record</span><span class="i-code">0xe801</span></div>
+ <div title="Code: 0xe802" class="the-icons span3"><i class="demo-icon i-cancel">&#xe802;</i> <span class="i-name">i-cancel</span><span class="i-code">0xe802</span></div>
+ <div title="Code: 0xe803" class="the-icons span3"><i class="demo-icon i-help">&#xe803;</i> <span class="i-name">i-help</span><span class="i-code">0xe803</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe804" class="the-icons span3"><i class="demo-icon i-help-circled">&#xe804;</i> <span class="i-name">i-help-circled</span><span class="i-code">0xe804</span></div>
+ <div title="Code: 0xe805" class="the-icons span3"><i class="demo-icon i-info-circled">&#xe805;</i> <span class="i-name">i-info-circled</span><span class="i-code">0xe805</span></div>
+ <div title="Code: 0xe806" class="the-icons span3"><i class="demo-icon i-info">&#xe806;</i> <span class="i-name">i-info</span><span class="i-code">0xe806</span></div>
+ <div title="Code: 0xe807" class="the-icons span3"><i class="demo-icon i-link-ext">&#xe807;</i> <span class="i-name">i-link-ext</span><span class="i-code">0xe807</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe808" class="the-icons span3"><i class="demo-icon i-trash">&#xe808;</i> <span class="i-name">i-trash</span><span class="i-code">0xe808</span></div>
+ <div title="Code: 0xe809" class="the-icons span3"><i class="demo-icon i-folder-closed">&#xe809;</i> <span class="i-name">i-folder-closed</span><span class="i-code">0xe809</span></div>
+ <div title="Code: 0xe80a" class="the-icons span3"><i class="demo-icon i-folder-opened">&#xe80a;</i> <span class="i-name">i-folder-opened</span><span class="i-code">0xe80a</span></div>
+ <div title="Code: 0xe80b" class="the-icons span3"><i class="demo-icon i-menu">&#xe80b;</i> <span class="i-name">i-menu</span><span class="i-code">0xe80b</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe80c" class="the-icons span3"><i class="demo-icon i-login">&#xe80c;</i> <span class="i-name">i-login</span><span class="i-code">0xe80c</span></div>
+ <div title="Code: 0xe80d" class="the-icons span3"><i class="demo-icon i-logout">&#xe80d;</i> <span class="i-name">i-logout</span><span class="i-code">0xe80d</span></div>
+ <div title="Code: 0xe80e" class="the-icons span3"><i class="demo-icon i-down-dir">&#xe80e;</i> <span class="i-name">i-down-dir</span><span class="i-code">0xe80e</span></div>
+ <div title="Code: 0xe80f" class="the-icons span3"><i class="demo-icon i-up-dir">&#xe80f;</i> <span class="i-name">i-up-dir</span><span class="i-code">0xe80f</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe810" class="the-icons span3"><i class="demo-icon i-left-dir">&#xe810;</i> <span class="i-name">i-left-dir</span><span class="i-code">0xe810</span></div>
+ <div title="Code: 0xe811" class="the-icons span3"><i class="demo-icon i-right-dir">&#xe811;</i> <span class="i-name">i-right-dir</span><span class="i-code">0xe811</span></div>
+ <div title="Code: 0xe812" class="the-icons span3"><i class="demo-icon i-refresh">&#xe812;</i> <span class="i-name">i-refresh</span><span class="i-code">0xe812</span></div>
+ <div title="Code: 0xe813" class="the-icons span3"><i class="demo-icon i-check">&#xe813;</i> <span class="i-name">i-check</span><span class="i-code">0xe813</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe814" class="the-icons span3"><i class="demo-icon i-check-empty">&#xe814;</i> <span class="i-name">i-check-empty</span><span class="i-code">0xe814</span></div>
+ <div title="Code: 0xe815" class="the-icons span3"><i class="demo-icon i-save">&#xe815;</i> <span class="i-name">i-save</span><span class="i-code">0xe815</span></div>
+ <div title="Code: 0xe816" class="the-icons span3"><i class="demo-icon i-sort-down">&#xe816;</i> <span class="i-name">i-sort-down</span><span class="i-code">0xe816</span></div>
+ <div title="Code: 0xe817" class="the-icons span3"><i class="demo-icon i-sort-up">&#xe817;</i> <span class="i-name">i-sort-up</span><span class="i-code">0xe817</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe818" class="the-icons span3"><i class="demo-icon i-sort-name-up">&#xe818;</i> <span class="i-name">i-sort-name-up</span><span class="i-code">0xe818</span></div>
+ <div title="Code: 0xe819" class="the-icons span3"><i class="demo-icon i-sort-name-down">&#xe819;</i> <span class="i-name">i-sort-name-down</span><span class="i-code">0xe819</span></div>
+ <div title="Code: 0xe81a" class="the-icons span3"><i class="demo-icon i-flashlight">&#xe81a;</i> <span class="i-name">i-flashlight</span><span class="i-code">0xe81a</span></div>
+ <div title="Code: 0xe81b" class="the-icons span3"><i class="demo-icon i-wait">&#xe81b;</i> <span class="i-name">i-wait</span><span class="i-code">0xe81b</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe81c" class="the-icons span3"><i class="demo-icon i-play">&#xe81c;</i> <span class="i-name">i-play</span><span class="i-code">0xe81c</span></div>
+ <div title="Code: 0xe81d" class="the-icons span3"><i class="demo-icon i-stop">&#xe81d;</i> <span class="i-name">i-stop</span><span class="i-code">0xe81d</span></div>
+ <div title="Code: 0xe81e" class="the-icons span3"><i class="demo-icon i-pause">&#xe81e;</i> <span class="i-name">i-pause</span><span class="i-code">0xe81e</span></div>
+ <div title="Code: 0xe81f" class="the-icons span3"><i class="demo-icon i-to-end">&#xe81f;</i> <span class="i-name">i-to-end</span><span class="i-code">0xe81f</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe820" class="the-icons span3"><i class="demo-icon i-to-start">&#xe820;</i> <span class="i-name">i-to-start</span><span class="i-code">0xe820</span></div>
+ <div title="Code: 0xe821" class="the-icons span3"><i class="demo-icon i-forward">&#xe821;</i> <span class="i-name">i-forward</span><span class="i-code">0xe821</span></div>
+ <div title="Code: 0xe822" class="the-icons span3"><i class="demo-icon i-rewind">&#xe822;</i> <span class="i-name">i-rewind</span><span class="i-code">0xe822</span></div>
+ <div title="Code: 0xe823" class="the-icons span3"><i class="demo-icon i-ok">&#xe823;</i> <span class="i-name">i-ok</span><span class="i-code">0xe823</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe824" class="the-icons span3"><i class="demo-icon i-warning">&#xe824;</i> <span class="i-name">i-warning</span><span class="i-code">0xe824</span></div>
+ <div title="Code: 0xe825" class="the-icons span3"><i class="demo-icon i-clock">&#xe825;</i> <span class="i-name">i-clock</span><span class="i-code">0xe825</span></div>
+ <div title="Code: 0xe826" class="the-icons span3"><i class="demo-icon i-buffer">&#xe826;</i> <span class="i-name">i-buffer</span><span class="i-code">0xe826</span></div>
+ <div title="Code: 0xe827" class="the-icons span3"><i class="demo-icon i-doc-new">&#xe827;</i> <span class="i-name">i-doc-new</span><span class="i-code">0xe827</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe828" class="the-icons span3"><i class="demo-icon i-search">&#xe828;</i> <span class="i-name">i-search</span><span class="i-code">0xe828</span></div>
+ <div title="Code: 0xe829" class="the-icons span3"><i class="demo-icon i-edit">&#xe829;</i> <span class="i-name">i-edit</span><span class="i-code">0xe829</span></div>
+ <div title="Code: 0xe82a" class="the-icons span3"><i class="demo-icon i-tv">&#xe82a;</i> <span class="i-name">i-tv</span><span class="i-code">0xe82a</span></div>
+ <div title="Code: 0xe82b" class="the-icons span3"><i class="demo-icon i-thumb-rate-up">&#xe82b;</i> <span class="i-name">i-thumb-rate-up</span><span class="i-code">0xe82b</span></div>
+ </div>
+ <div class="row">
+ <div title="Code: 0xe82c" class="the-icons span3"><i class="demo-icon i-flash-outline">&#xe82c;</i> <span class="i-name">i-flash-outline</span><span class="i-code">0xe82c</span></div>
+ <div title="Code: 0xe82d" class="the-icons span3"><i class="demo-icon i-error">&#xe82d;</i> <span class="i-name">i-error</span><span class="i-code">0xe82d</span></div>
+ </div>
+ </div>
+ <div class="container footer">Generated by <a href="http://fontello.com">fontello.com</a></div>
+ </body>
+</html> \ No newline at end of file
diff --git a/http/3rdParty/fontello/font/epgd.eot b/http/3rdParty/fontello/font/epgd.eot
new file mode 100644
index 0000000..afecad6
--- /dev/null
+++ b/http/3rdParty/fontello/font/epgd.eot
Binary files differ
diff --git a/http/3rdParty/fontello/font/epgd.svg b/http/3rdParty/fontello/font/epgd.svg
new file mode 100644
index 0000000..e59f432
--- /dev/null
+++ b/http/3rdParty/fontello/font/epgd.svg
@@ -0,0 +1,102 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
+<defs>
+<font id="epgd" horiz-adv-x="1000" >
+<font-face font-family="epgd" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
+<missing-glyph horiz-adv-x="1000" />
+<glyph glyph-name="progress" unicode="&#xe800;" d="M855 9c-189-190-520-172-705 13-190 190-200 494-28 695 11 13 21 26 35 34 36 23 85 18 117-13 30-31 35-76 16-112-5-9-9-15-16-22-140-151-145-379-8-516 153-153 407-121 542 34 106 122 142 297 77 451-83 198-305 291-510 222l0 1c236 82 492-24 588-252 71-167 37-355-72-493-11-15-23-29-36-42z" horiz-adv-x="1000" />
+
+<glyph glyph-name="record" unicode="&#xe801;" d="M1000 654v-608q0-23-22-32-7-3-14-3-15 0-25 10l-225 225v-92q0-67-47-114t-113-47h-393q-67 0-114 47t-47 114v392q0 67 47 114t114 47h393q66 0 113-47t47-114v-92l225 225q10 10 25 10 7 0 14-2 22-10 22-33z" horiz-adv-x="1000" />
+
+<glyph glyph-name="cancel" unicode="&#xe802;" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="help" unicode="&#xe803;" d="M393 149v-134q0-9-7-15t-15-7h-134q-9 0-16 7t-7 15v134q0 9 7 16t16 6h134q9 0 15-6t7-16z m176 335q0-30-8-56t-20-43-31-33-32-25-34-19q-23-13-38-37t-15-37q0-10-7-18t-16-9h-134q-8 0-14 11t-6 20v26q0 46 37 87t79 60q33 16 47 32t14 42q0 24-26 41t-60 18q-36 0-60-16-20-14-60-64-7-9-17-9-7 0-14 4l-91 70q-8 6-9 14t3 16q89 148 259 148 45 0 90-17t81-46 59-72 23-88z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="help-circled" unicode="&#xe804;" d="M500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-13 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-15-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="info-circled" unicode="&#xe805;" d="M571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="info" unicode="&#xe806;" d="M357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="link-ext" unicode="&#xe807;" d="M786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-25t-25-11-25 11l-98 98-364-364q-5-6-13-6t-12 6l-64 64q-6 5-6 12t6 13l364 364-98 98q-11 11-11 25t11 25 25 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
+
+<glyph glyph-name="trash" unicode="&#xe808;" d="M286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="folder-closed" unicode="&#xe809;" d="M857 118v393q0 22-15 38t-38 15h-393q-23 0-38 16t-16 38v36q0 22-15 38t-38 15h-179q-22 0-38-15t-16-38v-536q0-22 16-38t38-16h679q22 0 38 16t15 38z m72 393v-393q0-51-37-88t-88-37h-679q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h375q51 0 88-37t37-88z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="folder-opened" unicode="&#xe80a;" d="M994 331q0 19-30 19h-607q-22 0-48-12t-39-29l-164-203q-11-13-11-22 0-20 30-20h607q23 0 48 13t40 29l164 203q10 12 10 22z m-637 90h429v90q0 22-16 38t-38 15h-321q-23 0-38 16t-16 38v36q0 22-15 38t-38 15h-179q-22 0-38-15t-16-38v-476l143 175q25 30 65 49t78 19z m708-90q0-35-25-67l-165-203q-24-30-65-49t-78-19h-607q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h303q52 0 88-37t37-88v-90h107q30 0 56-13t37-40q8-17 8-37z" horiz-adv-x="1071.4" />
+
+<glyph glyph-name="menu" unicode="&#xe80b;" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="login" unicode="&#xe80c;" d="M661 350q0-14-11-25l-303-304q-11-10-26-10t-25 10-10 25v161h-250q-15 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 10 25t25 10 26-10l303-304q11-10 11-25z m196 196v-392q0-67-47-114t-114-47h-178q-7 0-13 5t-5 13q0 2-1 11t0 15 2 13 5 11 12 3h178q37 0 64 27t26 63v392q0 37-26 64t-64 26h-174t-6 0-6 2-5 3-4 5-1 8q0 2-1 11t0 15 2 13 5 11 12 3h178q67 0 114-47t47-114z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="logout" unicode="&#xe80d;" d="M357 46q0-2 1-11t0-14-2-14-5-11-12-3h-178q-67 0-114 47t-47 114v392q0 67 47 114t114 47h178q8 0 13-5t5-13q0-2 1-11t0-15-2-13-5-11-12-3h-178q-37 0-63-26t-27-64v-392q0-37 27-63t63-27h174t6 0 7-2 4-3 4-5 1-8z m518 304q0-14-11-25l-303-304q-11-10-25-10t-25 10-11 25v161h-250q-14 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 11 25t25 10 25-10l303-304q11-10 11-25z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="down-dir" unicode="&#xe80e;" d="M571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="up-dir" unicode="&#xe80f;" d="M571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25 11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="left-dir" unicode="&#xe810;" d="M357 600v-500q0-14-10-25t-26-11-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11 10-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="right-dir" unicode="&#xe811;" d="M321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11-11 25v500q0 15 11 25t25 11 25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="refresh" unicode="&#xe812;" d="M843 261q0-3 0-4-36-150-150-243t-267-93q-81 0-157 31t-136 88l-72-72q-11-11-25-11t-25 11-11 25v250q0 14 11 25t25 11h250q14 0 25-11t10-25-10-25l-77-77q40-36 90-57t105-20q74 0 139 37t104 99q6 10 30 66 4 13 16 13h107q8 0 13-6t5-12z m14 446v-250q0-14-10-25t-26-11h-250q-14 0-25 11t-10 25 10 25l77 77q-82 77-194 77-75 0-140-37t-104-99q-6-10-29-66-5-13-17-13h-111q-7 0-13 6t-5 12v4q36 150 151 243t268 93q81 0 158-31t137-88l72 72q11 11 25 11t26-11 10-25z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="check" unicode="&#xe813;" d="M786 331v-177q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q35 0 65-14 9-4 10-13 2-10-5-16l-27-28q-6-5-13-5-1 0-5 1-13 3-25 3h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v141q0 8 5 13l36 35q6 6 13 6 3 0 7-2 11-4 11-16z m129 273l-455-454q-13-14-31-14t-32 14l-240 240q-14 13-14 31t14 32l61 62q14 13 32 13t32-13l147-147 361 361q13 13 31 13t32-13l62-61q13-14 13-32t-13-32z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="check-empty" unicode="&#xe814;" d="M625 707h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v464q0 37-26 63t-63 26z m161-89v-464q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q66 0 114-48t47-113z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="save" unicode="&#xe815;" d="M214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-7 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="sort-down" unicode="&#xe816;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="sort-up" unicode="&#xe817;" d="M571 457q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25 11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="sort-name-up" unicode="&#xe818;" d="M665 622h98l-40 122-6 26q-2 9-2 11h-2l-1-11q0 0-2-10t-5-16z m-254-576q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m466-66v-130h-326v50l206 295q7 11 12 16l6 5v1q-1 0-3 0t-5 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-296q-4-4-12-14l-6-7v-1l8 1q5 2 16 2h139v66h67z m50 501v-60h-161v60h42l-26 80h-136l-26-80h42v-60h-160v60h39l128 369h91l128-369h39z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="sort-name-down" unicode="&#xe819;" d="M665 51h98l-40 122-6 26q-2 9-2 11h-2l-1-11q0-1-2-10t-5-16z m-254-5q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m516-137v-59h-161v59h42l-26 80h-136l-26-80h42v-59h-160v59h39l128 370h91l128-370h39z m-50 643v-131h-326v51l206 295q7 10 12 15l6 5v2q-1 0-3-1t-5 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-295q-4-5-12-15l-6-5v-2l8 2q5 0 16 0h139v67h67z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="flashlight" unicode="&#xe81a;" d="M807 706q62-62 85-130t-5-92l-134-134q-16-16-62-26t-96-4l-408-408q-18-18-57-6t-75 50q-36 36-49 74t5 56l408 408q-6 50 4 96t26 62l136 136q24 28 92 4t130-86z m-448-408q32-32 80 14 46 46 14 82-14 14-38 10t-44-24-23-43 11-39z m336 298q30-30 68-50t62-25 28-1q2 4-4 27t-26 60-50 67-66 50-59 26-27 2 1-28 25-62 48-66z" horiz-adv-x="902" />
+
+<glyph glyph-name="wait" unicode="&#xe81b;" d="M560 622q0-44-48-96t-97-99-49-77 49-76 97-97 48-97l0-118q0-34-86-73t-194-39-194 39-86 73l0 118q0 46 48 97t97 97 49 76-49 77-97 99-48 96l0 118q0 32 87 71t193 39 193-39 87-71l0-118z m-482 112l-18-14q-4-8 4-14 92-52 216-52 132 0 220 50 14 10-16 30-96 54-202 54-120 0-204-54z m228-384q0 18 4 33t18 33 20 25 31 31 29 28q92 92 92 122l2 50q-100-54-222-54t-222 54l4-50q0-32 90-122 6-6 22-21t23-22l19-19t17-21 11-20 9-23 3-24q0-10-1-19t-6-18-8-16-11-17l-12-15t-15-16-16-15-18-16-17-16q-90-90-90-122l0-66q8 4 66 23t92 43 34 58q0 30 26 30t26-30q0-34 33-58t94-43 67-23l0 66q0 30-92 122-4 4-21 20t-22 21-18 19-18 22-12 20-9 23-2 23z" horiz-adv-x="560" />
+
+<glyph glyph-name="play" unicode="&#xe81c;" d="M486 376q14-10 14-26 0-14-14-24l-428-266q-24-16-41-6t-17 40l0 514q0 30 17 40t41-6z" horiz-adv-x="500" />
+
+<glyph glyph-name="stop" unicode="&#xe81d;" d="M526 650q74 0 74-64l0-470q0-66-74-66l-450 0q-76 0-76 66l0 470q0 36 18 50t58 14l450 0z" horiz-adv-x="600" />
+
+<glyph glyph-name="pause" unicode="&#xe81e;" d="M440 700q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z m-350 0q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z" horiz-adv-x="530" />
+
+<glyph glyph-name="to-end" unicode="&#xe81f;" d="M412 374q14-10 14-24 0-12-14-22l-362-228q-22-14-36-5t-14 35l0 442q0 26 14 35t36-5z m114 268q74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466q0 58 76 58z" horiz-adv-x="600" />
+
+<glyph glyph-name="to-start" unicode="&#xe820;" d="M174 350q0 14 14 24l364 228q20 14 34 5t14-35l0-442q0-26-14-35t-34 5l-364 228q-14 10-14 22z m-174 234q0 58 76 58 74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466z" horiz-adv-x="600" />
+
+<glyph glyph-name="forward" unicode="&#xe821;" d="M866 374q14-10 14-24t-14-22l-372-248q-22-14-37-6t-15 36l0 482q0 28 15 36t37-6z m-454 0q14-10 14-24t-14-22l-360-248q-20-14-36-6t-16 36l0 482q0 28 16 36t36-6z" horiz-adv-x="880" />
+
+<glyph glyph-name="rewind" unicode="&#xe822;" d="M0 350q0 14 14 24l374 248q20 14 36 6t16-36l0-482q0-28-16-36t-36 6l-374 248q-14 8-14 22z m454 0q0 14 14 24l360 248q20 14 36 6t16-36l0-482q0-28-16-36t-36 6l-360 248q-14 8-14 22z" horiz-adv-x="880" />
+
+<glyph glyph-name="ok" unicode="&#xe823;" d="M365-41q-66 0-111 45l-208 209q-46 46-46 110 0 65 46 111 44 44 110 44t110-44l63-62 160 287q20 38 57 60t79 22q88 0 134-76t2-157l-260-469q-43-80-136-80z m-209 417q-21 0-37-16t-15-37q0-20 16-36l208-209q18-19 44-15t38 26l260 469q11 23 4 43t-24 28q-19 10-39 4t-31-24l-227-408-160 160q-15 15-37 15z" horiz-adv-x="783" />
+
+<glyph glyph-name="warning" unicode="&#xe824;" d="M514 701q-49 0-81-55l-308-513q-32-55-11-95t87-40l625 0q65 0 87 40t-12 95l-307 513q-33 55-80 55z m0 105q106 0 169-107l308-513q63-105 12-199-52-93-177-93l-625 0q-123 0-177 93-53 92 11 199l309 513q62 107 170 107z m-69-652q0 69 69 69 67 0 67-69 0-67-67-67-69 0-69 67z m146 313q0-14-6-29l-71-179q-44 108-73 179-6 15-6 29 0 32 23 55t56 24 55-24 22-55z" horiz-adv-x="1026" />
+
+<glyph glyph-name="clock" unicode="&#xe825;" d="M406 757c224 0 407-182 407-407 0-223-183-406-407-406-225 0-406 183-406 406 0 225 181 407 406 407z m0-723c175 0 317 143 317 318s-142 316-317 316-317-141-317-316 142-318 317-318z m120 268l-127 0c-14 0-25 5-33 15l-143 156c-39 41 25 101 65 61l130-142 108 0c62 0 55-90 0-90z m-145 287c0 13 12 24 24 24s24-11 24-24-11-24-24-24-24 12-24 24z m167-65c0 13 11 24 23 24s24-11 24-24-11-24-24-24-23 12-23 24z m73-171c0 12 12 24 24 24s24-12 24-24-11-24-24-24-24 11-24 24z m-66-168c0 13 11 24 24 24s24-11 24-24-12-23-24-23-24 11-24 23z m-175-72c0 12 11 24 24 24s24-12 24-24-12-24-24-24-24 11-24 24z m-162 65c0 12 11 24 23 24s24-12 24-24-11-24-24-24-23 11-23 24z m-75 175c0 12 11 24 23 24s24-12 24-24-11-24-24-24-23 11-23 24z" horiz-adv-x="813" />
+
+<glyph glyph-name="buffer" unicode="&#xe826;" d="M0 88q11 15 32 26t49 20 40 15q19 0 34-4t33-15 25-13q47-21 260-119 19-4 36 0t39 18 24 14q20 9 77 35t87 39q4 2 42 21t60 24q13 2 28-1t23-7 23-13 18-11 16-6 18-8 11-11q3-4 4-14-10-13-31-24t-51-22-40-16q-43-20-128-62t-129-61q-7-3-21-12t-23-13-26-11-27-7-30 2l-264 123q-6 3-32 14t-51 22-54 24-46 24-22 16q-4 4-4 13z m0 268q11 15 32 25t50 20 41 15q19 0 34-4t35-15 25-14q42-19 127-58t127-59q19-5 37 0t39 17 25 14q68 32 160 72 11 5 32 17t38 19 36 11q16 3 32-1t37-17 23-13q5-3 16-6t18-8 11-11q3-5 4-14-10-14-31-25t-53-23-41-16q-48-23-135-65t-123-59q-7-3-26-14t-29-15-32-10-36 0q-214 101-260 122-6 3-44 19t-69 30-62 30-34 22q-4 4-4 14z m0 267q10 15 32 27t52 22 41 16l348 162q30 0 54-7t56-26 40-22q39-18 117-54t117-55q4-2 37-15t54-24 27-20q3-4 4-13-9-13-26-22t-43-19-35-14q-47-22-140-66t-139-67q-6-3-20-11t-23-12-25-11-27-6-28 1q-245 114-256 119-4 2-63 28t-102 46-48 30q-4 4-4 13z" horiz-adv-x="979" />
+
+<glyph glyph-name="doc-new" unicode="&#xe827;" d="M0-150l0 818 188 182 519 0 0-348-86 0 0 260-369 0 0-156-166 0 0-668 418 0 0-88-504 0z m373 207l0 162 209 0 0 207 160 0 0-207 207 0 0-162-207 0 0-207-160 0 0 207-209 0z" horiz-adv-x="949" />
+
+<glyph glyph-name="search" unicode="&#xe828;" d="M0-41q0 47 33 80l260 260q-43 82-43 176 0 154 109 265t266 110 266-110 109-266-109-265-266-109q-94 0-176 43l-260-260q-33-33-80-33-45 0-77 32t-32 77z m55 1q0-22 16-39t39-16 40 17l252 252q-45 33-78 78l-252-252q-17-17-17-40z m258 515q0-129 91-221t221-91 221 91 91 221-91 221-221 91-221-91-91-221z m93 0q0 90 65 154t154 65q16 0 16-16t-16-16q-78 0-133-54t-54-133q0-16-16-16t-16 16z" horiz-adv-x="1000" />
+
+<glyph glyph-name="edit" unicode="&#xe829;" d="M0-41q0 4 1 8t1 8 1 8 1 6l0 2 74 267q10 31 31 53l325 324 0 2 2 2 150 152q60 59 146 59 106 0 186-80 74-74 81-171t-58-161l-476-481q-24-23-55-31l-263-70-3-1q-3-1-7-2t-9-1-10-1-9-1q-45 0-77 32t-32 77z m63 0q0-19 13-33t33-14q6 0 22 4l115 32q4 58-43 105-45 45-105 43l-32-119q-3-14-3-18z m44 168q67-2 118-52t52-120l116 30 11 6q41 47 34 115t-61 121q-51 49-115 59t-112-24q-7-10-11-21z m131 225q45-2 90-20l295 295q-88 22-144-33z m119-35q38-20 65-45 21-22 41-55l297 299q-16 31-39 55-30 29-67 45z m122-129q17-41 21-82l0-24 242 245 0 2q61 60 31 156z m101 508q106 0 186-80 70-73 78-166l0-22 52 55q45 45 41 111-5 74-62 131-63 62-143 62-60 0-101-41z" horiz-adv-x="1000" />
+
+<glyph glyph-name="tv" unicode="&#xe82a;" d="M0 100l0 625q0 39 27 66t67 28l812 0q39 0 67-28t27-66l0-625q0-39-27-66t-67-28l-312 0 0-37 195-25q23-6 23-32 0-13-8-22t-23-9l-562 0q-14 0-23 9t-8 22q0 26 23 32l195 25 0 37-312 0q-39 0-67 28t-27 66z m63 0q0-14 8-22t23-9l812 0q14 0 23 9t8 22l0 625q0 14-8 22t-23 9l-812 0q-14 0-23-9t-8-22l0-625z m62 125l0 437q0 14 9 23t22 9l688 0q13 0 22-9t9-23l0-437q0-14-9-22t-22-9l-688 0q-13 0-22 9t-9 22z m31 0l688 0 0 437-688 0 0-437z" horiz-adv-x="1000" />
+
+<glyph glyph-name="thumb-rate-up" unicode="&#xe82b;" d="M1204-51c-5-81-14-128-31-164-26-57-103-145-151-173-30-17-103-35-148-35-43-1-54 4-75 36-26 38-56 64-100 85-58 29-72 47-72 99-1 42-12 63-51 92-52 38-79 72-87 110-7 49 33 101 17 149-30 26-56 45-81 76-33 64-10 159 49 196 34 17 87 30 148 35 62 6 88 15 144 49 70 38 111 60 205 61l6 124c-81 78-94 139-66 245 28 82 22 145 107 185 43 18 76 21 112 11 59-17 99-47 120-90 39-81 45-255 14-406-19-63-9-122 20-180 40-101 22-123 57-152-94-148-123-175-137-353z m35 507c-31 57-27 125-11 186 24 124 39 286-19 401-24 34-79 62-125 62-108-3-110-84-136-166-19-43-21-97-1-140 39-75 118-109 179-160-37-6-72 11-106 23l4-110c115-53 124-157 81-264 39-29 74-83 74-161 21 60 71 108 92 168 14 60-4 110-32 161z m-267-481c-42-11-83-15-74-7 2 2 31 16 63 30 154 48 237 242 46 280-92 1-198-95-285-42 54-11 101 12 149 35 60 30 90 38 143 39 71 4 70 82 56 136-76 135-220 67-323 17-57-29-85-37-166-47-94-6-132-45-134-143-2-62 97-72 98-126-2-43-14-85-18-128 0-40 24-70 80-101 43-23 48-32 52-93 2-25 5-48 7-52 69-48 110-60 165-133 84-31 263 27 245 141-76-7-144-12-201 32 24 6 48 5 71 4 203-53 272 243 26 158z" horiz-adv-x="1727" />
+
+<glyph glyph-name="flash-outline" unicode="&#xe82c;" d="M495 767z m0 0l-391-369 261-151-130-313 390 370-260 150z m0 105q43 0 73-31t31-74q0-22-10-44l-93-224 182-105q43-25 50-77t-32-89l-390-370q-31-29-72-29-56 0-86 47t-9 98l95 228-181 105q-44 25-52 76t32 90l390 370q31 29 72 29z" horiz-adv-x="729" />
+
+<glyph glyph-name="error" unicode="&#xe82d;" d="M0 350q0 207 147 354t353 146 354-146 146-354-146-354-354-146-353 146-147 354z m137 0q0-150 106-257t257-106 257 106 106 257-106 257-257 106-257-106-106-257z m97-98l0 196 532 0 0-196-532 0z" horiz-adv-x="1000" />
+</font>
+</defs>
+</svg> \ No newline at end of file
diff --git a/http/3rdParty/fontello/font/epgd.ttf b/http/3rdParty/fontello/font/epgd.ttf
new file mode 100644
index 0000000..afcefa7
--- /dev/null
+++ b/http/3rdParty/fontello/font/epgd.ttf
Binary files differ
diff --git a/http/3rdParty/fontello/font/epgd.woff b/http/3rdParty/fontello/font/epgd.woff
new file mode 100644
index 0000000..bab45aa
--- /dev/null
+++ b/http/3rdParty/fontello/font/epgd.woff
Binary files differ
diff --git a/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css b/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css
new file mode 100644
index 0000000..079d885
--- /dev/null
+++ b/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css
@@ -0,0 +1,5 @@
+/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01
+* http://trentrichardson.com/examples/timepicker
+* Copyright (c) 2014 Trent Richardson; Licensed MIT */
+
+.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px} \ No newline at end of file
diff --git a/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.js b/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.js
new file mode 100644
index 0000000..b7f8786
--- /dev/null
+++ b/http/3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.js
@@ -0,0 +1,5 @@
+/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01
+* http://trentrichardson.com/examples/timepicker
+* Copyright (c) 2014 Trent Richardson; Licensed MIT */
+(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.5.0"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(e,t){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],e,t,tp_inst):void 0},onChangeMonthYear:function(e,t,i){tp_inst._updateDateTime(i),$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],e,t,i,tp_inst)},onClose:function(e,t){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(t),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],e,t,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(e){return e.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(e){return e.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&$.ui.slider===void 0&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(e){var t=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(t),this._limitMinMaxDateTime(e,!1),this._injectTimePicker()},_parseTime:function(e,t){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),t||!this._defaults.timeOnly){var i=$.datepicker._get(this.inst,"dateFormat");try{var s=parseDateTimeInternal(i,this._defaults.timeFormat,e,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!s.timeObj)return!1;$.extend(this,s.timeObj)}catch(a){return $.timepicker.log("Error parsing the date/time string: "+a+"\ndate/time string = "+e+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+i),!1}return!0}var n=$.datepicker.parseTime(this._defaults.timeFormat,e,this._defaults);return n?($.extend(this,n),!0):!1},_injectTimePicker:function(){var e=this.inst.dpDiv,t=this.inst.settings,i=this,s="",a="",n=null,r={},l={},o=null,c=0,u=0;if(0===e.find("div.ui-timepicker-div").length&&t.showTimepicker){var m=' style="display:none;"',d='<div class="ui-timepicker-div'+(t.isRTL?" ui-timepicker-rtl":"")+'"><dl>'+'<dt class="ui_tpicker_time_label"'+(t.showTime?"":m)+">"+t.timeText+"</dt>"+'<dd class="ui_tpicker_time"'+(t.showTime?"":m)+"></dd>";for(c=0,u=this.units.length;u>c;c++){if(s=this.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],r[s]=parseInt(t[s+"Max"]-(t[s+"Max"]-t[s+"Min"])%t["step"+a],10),l[s]=0,d+='<dt class="ui_tpicker_'+s+'_label"'+(n?"":m)+">"+t[s+"Text"]+"</dt>"+'<dd class="ui_tpicker_'+s+'"><div class="ui_tpicker_'+s+'_slider"'+(n?"":m)+"></div>",n&&t[s+"Grid"]>0){if(d+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===s)for(var h=t[s+"Min"];r[s]>=h;h+=parseInt(t[s+"Grid"],10)){l[s]++;var p=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},t);d+='<td data-for="'+s+'">'+p+"</td>"}else for(var _=t[s+"Min"];r[s]>=_;_+=parseInt(t[s+"Grid"],10))l[s]++,d+='<td data-for="'+s+'">'+(10>_?"0":"")+_+"</td>";d+="</tr></table></div>"}d+="</dd>"}var f=null!==t.showTimezone?t.showTimezone:this.support.timezone;d+='<dt class="ui_tpicker_timezone_label"'+(f?"":m)+">"+t.timezoneText+"</dt>",d+='<dd class="ui_tpicker_timezone" '+(f?"":m)+"></dd>",d+="</dl></div>";var g=$(d);for(t.timeOnly===!0&&(g.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+t.timeOnlyTitle+"</div>"+"</div>"),e.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),c=0,u=i.units.length;u>c;c++)s=i.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],i[s+"_slider"]=i.control.create(i,g.find(".ui_tpicker_"+s+"_slider"),s,i[s],t[s+"Min"],r[s],t["step"+a]),n&&t[s+"Grid"]>0&&(o=100*l[s]*t[s+"Grid"]/(r[s]-t[s+"Min"]),g.find(".ui_tpicker_"+s+" table").css({width:o+"%",marginLeft:t.isRTL?"0":o/(-2*l[s])+"%",marginRight:t.isRTL?o/(-2*l[s])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(){var e=$(this),t=e.html(),a=parseInt(t.replace(/[^0-9]/g),10),n=t.replace(/[^apm]/gi),r=e.data("for");"hour"===r&&(-1!==n.indexOf("p")&&12>a?a+=12:-1!==n.indexOf("a")&&12===a&&(a=0)),i.control.value(i,i[r+"_slider"],s,a),i._onTimeChange(),i._onSelectHandler()}).css({cursor:"pointer",width:100/l[s]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=g.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(t.timezoneList,function(e){return $("<option />").val("object"==typeof e?e.value:e).text("object"==typeof e?e.label:e)})),this.timezone!==void 0&&null!==this.timezone&&""!==this.timezone){var M=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();M===this.timezone?selectLocalTimezone(i):this.timezone_select.val(this.timezone)}else this.hour!==void 0&&null!==this.hour&&""!==this.hour?this.timezone_select.val(t.timezone):selectLocalTimezone(i);this.timezone_select.change(function(){i._onTimeChange(),i._onSelectHandler()});var v=e.find(".ui-datepicker-buttonpane");if(v.length?v.before(g):e.append(g),this.$timeObj=g.find(".ui_tpicker_time"),null!==this.inst){var k=this.timeDefined;this._onTimeChange(),this.timeDefined=k}if(this._defaults.addSliderAccess){var T=this._defaults.sliderAccessArgs,D=this._defaults.isRTL;T.isRTL=D,setTimeout(function(){if(0===g.find(".ui-slider-access").length){g.find(".ui-slider:visible").sliderAccess(T);var e=g.find(".ui-slider-access:eq(0)").outerWidth(!0);e&&g.find("table:visible").each(function(){var t=$(this),i=t.outerWidth(),s=(""+t.css(D?"marginRight":"marginLeft")).replace("%",""),a=i-e,n=s*a/i+"%",r={width:a,marginRight:0,marginLeft:0};r[D?"marginRight":"marginLeft"]=n,t.css(r)})}},10)}i._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(e,t){var i=this._defaults,s=new Date(e.selectedYear,e.selectedMonth,e.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(e,"minDateTime")&&void 0!==$.datepicker._get(e,"minDateTime")&&s){var a=$.datepicker._get(e,"minDateTime"),n=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=i.hourMin,this.minuteMinOriginal=i.minuteMin,this.secondMinOriginal=i.secondMin,this.millisecMinOriginal=i.millisecMin,this.microsecMinOriginal=i.microsecMin),e.settings.timeOnly||n.getTime()===s.getTime()?(this._defaults.hourMin=a.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=a.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=a.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=a.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=a.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(e,"maxDateTime")&&void 0!==$.datepicker._get(e,"maxDateTime")&&s){var r=$.datepicker._get(e,"maxDateTime"),l=new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=i.hourMax,this.minuteMaxOriginal=i.minuteMax,this.secondMaxOriginal=i.secondMax,this.millisecMaxOriginal=i.millisecMax,this.microsecMaxOriginal=i.microsecMax),e.settings.timeOnly||l.getTime()===s.getTime()?(this._defaults.hourMax=r.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=r.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=r.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=r.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=r.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==e.settings.minTime){var o=new Date("01/01/1970 "+e.settings.minTime);this.hour<o.getHours()?(this.hour=this._defaults.hourMin=o.getHours(),this.minute=this._defaults.minuteMin=o.getMinutes()):this.hour===o.getHours()&&this.minute<o.getMinutes()?this.minute=this._defaults.minuteMin=o.getMinutes():this._defaults.hourMin<o.getHours()?(this._defaults.hourMin=o.getHours(),this._defaults.minuteMin=o.getMinutes()):this._defaults.minuteMin=this._defaults.hourMin===o.getHours()===this.hour&&this._defaults.minuteMin<o.getMinutes()?o.getMinutes():0}if(null!==e.settings.maxTime){var c=new Date("01/01/1970 "+e.settings.maxTime);this.hour>c.getHours()?(this.hour=this._defaults.hourMax=c.getHours(),this.minute=this._defaults.minuteMax=c.getMinutes()):this.hour===c.getHours()&&this.minute>c.getMinutes()?this.minute=this._defaults.minuteMax=c.getMinutes():this._defaults.hourMax>c.getHours()?(this._defaults.hourMax=c.getHours(),this._defaults.minuteMax=c.getMinutes()):this._defaults.minuteMax=this._defaults.hourMax===c.getHours()===this.hour&&this._defaults.minuteMax>c.getMinutes()?c.getMinutes():59}if(void 0!==t&&t===!0){var u=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),m=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),d=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),h=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),p=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:u,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:m,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:d,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:h,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:p,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var e=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,t=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,i=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,s=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,a=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,n=this.timezone_select?this.timezone_select.val():!1,r=this._defaults,l=r.pickerTimeFormat||r.timeFormat,o=r.pickerTimeSuffix||r.timeSuffix;"object"==typeof e&&(e=!1),"object"==typeof t&&(t=!1),"object"==typeof i&&(i=!1),"object"==typeof s&&(s=!1),"object"==typeof a&&(a=!1),"object"==typeof n&&(n=!1),e!==!1&&(e=parseInt(e,10)),t!==!1&&(t=parseInt(t,10)),i!==!1&&(i=parseInt(i,10)),s!==!1&&(s=parseInt(s,10)),a!==!1&&(a=parseInt(a,10)),n!==!1&&(n=""+n);var c=r[12>e?"amNames":"pmNames"][0],u=e!==parseInt(this.hour,10)||t!==parseInt(this.minute,10)||i!==parseInt(this.second,10)||s!==parseInt(this.millisec,10)||a!==parseInt(this.microsec,10)||this.ampm.length>0&&12>e!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&n!==""+this.timezone;u&&(e!==!1&&(this.hour=e),t!==!1&&(this.minute=t),i!==!1&&(this.second=i),s!==!1&&(this.millisec=s),a!==!1&&(this.microsec=a),n!==!1&&(this.timezone=n),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=c),this.formattedTime=$.datepicker.formatTime(r.timeFormat,this,r),this.$timeObj&&(l===r.timeFormat?this.$timeObj.text(this.formattedTime+o):this.$timeObj.text($.datepicker.formatTime(l,this,r)+o)),this.timeDefined=!0,u&&this._updateDateTime()}},_onSelectHandler:function(){var e=this._defaults.onSelect||this.inst.settings.onSelect,t=this.$input?this.$input[0]:null;e&&t&&e.apply(t,[this.formattedDateTime,this])},_updateDateTime:function(e){e=this.inst||e;var t=e.currentYear>0?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(e.selectedYear,e.selectedMonth,e.selectedDay),i=$.datepicker._daylightSavingAdjust(t),s=$.datepicker._get(e,"dateFormat"),a=$.datepicker._getFormatConfig(e),n=null!==i&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(s,null===i?new Date:i,a);var r=this.formattedDate;if(""===e.lastVal&&(e.currentYear=e.selectedYear,e.currentMonth=e.selectedMonth,e.currentDay=e.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?r=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||n)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(r+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=r,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(r);var l="",o=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,c=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(l=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===i?new Date:i,a):this.formattedDate,l&&(l+=o)),l+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+c:this.formattedTime+c,this.$altInput.val(l)}else this.$input.val(r);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var e=$.datepicker._getInst(this.$input.get(0)),t=$.datepicker._get(e,"timepicker");if(t&&t._defaults.timeOnly&&e.input.val()!==e.lastVal)try{$.datepicker._updateDatepicker(e)}catch(i){$.timepicker.log(i)}}},_controls:{slider:{create:function(e,t,i,s,a,n,r){var l=e._defaults.isRTL;return t.prop("slide",null).slider({orientation:"horizontal",value:l?-1*s:s,min:l?-1*n:a,max:l?-1*a:n,step:r,slide:function(t,s){e.control.value(e,$(this),i,l?-1*s.value:s.value),e._onTimeChange()},stop:function(){e._onSelectHandler()}})},options:function(e,t,i,s,a){if(e._defaults.isRTL){if("string"==typeof s)return"min"===s||"max"===s?void 0!==a?t.slider(s,-1*a):Math.abs(t.slider(s)):t.slider(s);var n=s.min,r=s.max;return s.min=s.max=null,void 0!==n&&(s.max=-1*n),void 0!==r&&(s.min=-1*r),t.slider(s)}return"string"==typeof s&&void 0!==a?t.slider(s,a):t.slider(s)},value:function(e,t,i,s){return e._defaults.isRTL?void 0!==s?t.slider("value",-1*s):Math.abs(t.slider("value")):void 0!==s?t.slider("value",s):t.slider("value")}},select:{create:function(e,t,i,s,a,n,r){for(var l='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+i+'" data-min="'+a+'" data-max="'+n+'" data-step="'+r+'">',o=e._defaults.pickerTimeFormat||e._defaults.timeFormat,c=a;n>=c;c+=r)l+='<option value="'+c+'"'+(c===s?" selected":"")+">",l+="hour"===i?$.datepicker.formatTime($.trim(o.replace(/[^ht ]/gi,"")),{hour:c},e._defaults):"millisec"===i||"microsec"===i||c>=10?c:"0"+(""+c),l+="</option>";return l+="</select>",t.children("select").remove(),$(l).appendTo(t).change(function(){e._onTimeChange(),e._onSelectHandler()}),t},options:function(e,t,i,s,a){var n={},r=t.children("select");if("string"==typeof s){if(void 0===a)return r.data(s);n[s]=a}else n=s;return e.control.create(e,t,r.data("unit"),r.val(),n.min||r.data("min"),n.max||r.data("max"),n.step||r.data("step"))},value:function(e,t,i,s){var a=t.children("select");return void 0!==s?a.val(s):a.val()}}}}),$.fn.extend({timepicker:function(e){e=e||{};var t=Array.prototype.slice.call(arguments);return"object"==typeof e&&(t[0]=$.extend(e,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),t)})},datetimepicker:function(e){e=e||{};var t=arguments;return"string"==typeof e?"getDate"===e||"option"===e&&2===t.length&&"string"==typeof t[1]?$.fn.datepicker.apply($(this[0]),t):this.each(function(){var e=$(this);e.datepicker.apply(e,t)}):this.each(function(){var t=$(this);t.datepicker($.timepicker._newInst(t,e)._defaults)})}}),$.datepicker.parseDateTime=function(e,t,i,s,a){var n=parseDateTimeInternal(e,t,i,s,a);if(n.timeObj){var r=n.timeObj;n.date.setHours(r.hour,r.minute,r.second,r.millisec),n.date.setMicroseconds(r.microsec)}return n.date},$.datepicker.parseTime=function(e,t,i){var s=extendRemove(extendRemove({},$.timepicker._defaults),i||{});-1!==e.replace(/\'.*?\'/g,"").indexOf("Z");var a=function(e,t,i){var s,a=function(e,t){var i=[];return e&&$.merge(i,e),t&&$.merge(i,t),i=$.map(i,function(e){return e.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+i.join("|")+")?"},n=function(e){var t=e.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),i={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(t)for(var s=0;t.length>s;s++)-1===i[(""+t[s]).charAt(0)]&&(i[(""+t[s]).charAt(0)]=s+1);return i},r="^"+(""+e).replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){var t=e.length;switch(e.charAt(0).toLowerCase()){case"h":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"m":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"s":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return a(i.amNames,i.pmNames);default:return"("+e.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(e){return"\\"+e})+")?"}}).replace(/\s/g,"\\s?")+i.timeSuffix+"$",l=n(e),o="";s=t.match(RegExp(r,"i"));var c={hour:0,minute:0,second:0,millisec:0,microsec:0};return s?(-1!==l.t&&(void 0===s[l.t]||0===s[l.t].length?(o="",c.ampm=""):(o=-1!==$.inArray(s[l.t].toUpperCase(),i.amNames)?"AM":"PM",c.ampm=i["AM"===o?"amNames":"pmNames"][0])),-1!==l.h&&(c.hour="AM"===o&&"12"===s[l.h]?0:"PM"===o&&"12"!==s[l.h]?parseInt(s[l.h],10)+12:Number(s[l.h])),-1!==l.m&&(c.minute=Number(s[l.m])),-1!==l.s&&(c.second=Number(s[l.s])),-1!==l.l&&(c.millisec=Number(s[l.l])),-1!==l.c&&(c.microsec=Number(s[l.c])),-1!==l.z&&void 0!==s[l.z]&&(c.timezone=$.timepicker.timezoneOffsetNumber(s[l.z])),c):!1},n=function(e,t,i){try{var s=new Date("2012-01-01 "+t);if(isNaN(s.getTime())&&(s=new Date("2012-01-01T"+t),isNaN(s.getTime())&&(s=new Date("01/01/2012 "+t),isNaN(s.getTime()))))throw"Unable to parse time with native Date: "+t;return{hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),millisec:s.getMilliseconds(),microsec:s.getMicroseconds(),timezone:-1*s.getTimezoneOffset()}}catch(n){try{return a(e,t,i)}catch(r){$.timepicker.log("Unable to parse \ntimeString: "+t+"\ntimeFormat: "+e)}}return!1};return"function"==typeof s.parse?s.parse(e,t,s):"loose"===s.parse?n(e,t,s):a(e,t,s)},$.datepicker.formatTime=function(e,t,i){i=i||{},i=$.extend({},$.timepicker._defaults,i),t=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},t);var s=e,a=i.amNames[0],n=parseInt(t.hour,10);return n>11&&(a=i.pmNames[0]),s=s.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){switch(e){case"HH":return("0"+n).slice(-2);case"H":return n;case"hh":return("0"+convert24to12(n)).slice(-2);case"h":return convert24to12(n);case"mm":return("0"+t.minute).slice(-2);case"m":return t.minute;case"ss":return("0"+t.second).slice(-2);case"s":return t.second;case"l":return("00"+t.millisec).slice(-3);case"c":return("00"+t.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!0);case"T":return a.charAt(0).toUpperCase();case"TT":return a.toUpperCase();case"t":return a.charAt(0).toLowerCase();case"tt":return a.toLowerCase();default:return e.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(e,t){var i,s=this._getInst($(e)[0]),a=this._get(s,"timepicker");a&&s.settings.showTimepicker?(a._limitMinMaxDateTime(s,!0),i=s.inline,s.inline=s.stay_open=!0,this._base_selectDate(e,t),s.inline=i,s.stay_open=!1,this._notifyChange(s),this._updateDatepicker(s)):this._base_selectDate(e,t)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(e){var t=e.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==e&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==t||"boolean"==typeof e.stay_open&&e.stay_open!==!1)){this._base_updateDatepicker(e);var i=this._get(e,"timepicker");i&&i._addTimePicker(e)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&$.datepicker._get(t,"constrainInput")){var s=i.support.ampm,a=null!==i._defaults.showTimezone?i._defaults.showTimezone:i.support.timezone,n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=(""+i._defaults.timeFormat).replace(/[hms]/g,"").replace(/TT/g,s?"APM":"").replace(/Tt/g,s?"AaPpMm":"").replace(/tT/g,s?"AaPpMm":"").replace(/T/g,s?"AP":"").replace(/tt/g,s?"apm":"").replace(/t/g,s?"ap":"")+" "+i._defaults.separator+i._defaults.timeSuffix+(a?i._defaults.timezoneList.join(""):"")+i._defaults.amNames.join("")+i._defaults.pmNames.join("")+n,l=String.fromCharCode(void 0===e.charCode?e.keyCode:e.charCode);return e.ctrlKey||" ">l||!n||r.indexOf(l)>-1}return $.datepicker._base_doKeyPress(e)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(e){var t=this._get(e,"timepicker");if(t){var i=t._defaults.altField;if(i){var s=(t._defaults.altFormat||t._defaults.dateFormat,this._getDate(e)),a=$.datepicker._getFormatConfig(e),n="",r=t._defaults.altSeparator?t._defaults.altSeparator:t._defaults.separator,l=t._defaults.altTimeSuffix?t._defaults.altTimeSuffix:t._defaults.timeSuffix,o=null!==t._defaults.altTimeFormat?t._defaults.altTimeFormat:t._defaults.timeFormat;n+=$.datepicker.formatTime(o,t,t._defaults)+l,t._defaults.timeOnly||t._defaults.altFieldTimeOnly||null===s||(n=t._defaults.altFormat?$.datepicker.formatDate(t._defaults.altFormat,s,a)+r+n:t.formattedDate+r+n),$(i).val(e.input.val()?n:"")}}else $.datepicker._base_updateAlternate(e)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&i._defaults.timeOnly&&t.input.val()!==t.lastVal)try{$.datepicker._updateDatepicker(t)}catch(s){$.timepicker.log(s)}return $.datepicker._base_doKeyUp(e)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(e){var t=this._getInst($(e)[0]);t.dpDiv,this._base_gotoToday(e);var i=this._get(t,"timepicker");selectLocalTimezone(i);var s=new Date;this._setTime(t,s),this._setDate(t,s)},$.datepicker._disableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!1,i._defaults.showTimepicker=!1,i._updateDateTime(t))}},$.datepicker._enableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!0,i._defaults.showTimepicker=!0,i._addTimePicker(t),i._updateDateTime(t))}},$.datepicker._setTime=function(e,t){var i=this._get(e,"timepicker");if(i){var s=i._defaults;
+i.hour=t?t.getHours():s.hour,i.minute=t?t.getMinutes():s.minute,i.second=t?t.getSeconds():s.second,i.millisec=t?t.getMilliseconds():s.millisec,i.microsec=t?t.getMicroseconds():s.microsec,i._limitMinMaxDateTime(e,!0),i._onTimeChange(),i._updateDateTime(e)}},$.datepicker._setTimeDatepicker=function(e,t,i){var s=this._getInst(e);if(s){var a=this._get(s,"timepicker");if(a){this._setDateFromField(s);var n;t&&("string"==typeof t?(a._parseTime(t,i),n=new Date,n.setHours(a.hour,a.minute,a.second,a.millisec),n.setMicroseconds(a.microsec)):(n=new Date(t.getTime()),n.setMicroseconds(t.getMicroseconds())),"Invalid Date"==""+n&&(n=void 0),this._setTime(s,n))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(e,t){var i=this._getInst(e),s=t;if(i){"string"==typeof t&&(s=new Date(t),s.getTime()||(this._base_setDateDatepicker.apply(this,arguments),s=$(e).datepicker("getDate")));var a,n=this._get(i,"timepicker");s instanceof Date?(a=new Date(s.getTime()),a.setMicroseconds(s.getMicroseconds())):a=s,n&&a&&(n.support.timezone||null!==n._defaults.timezone||(n.timezone=-1*a.getTimezoneOffset()),s=$.timepicker.timezoneAdjust(s,n.timezone),a=$.timepicker.timezoneAdjust(a,n.timezone)),this._updateDatepicker(i),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(e,a,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(e,t){var i=this._getInst(e);if(i){var s=this._get(i,"timepicker");if(s){void 0===i.lastVal&&this._setDateFromField(i,t);var a=this._getDate(i);return a&&s._parseTime($(e).val(),s.timeOnly)&&(a.setHours(s.hour,s.minute,s.second,s.millisec),a.setMicroseconds(s.microsec),null!=s.timezone&&(s.support.timezone||null!==s._defaults.timezone||(s.timezone=-1*a.getTimezoneOffset()),a=$.timepicker.timezoneAdjust(a,s.timezone))),a}return this._base_getDateDatepicker(e,t)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(e,t,i){var s;try{s=this._base_parseDate(e,t,i)}catch(a){if(!(a.indexOf(":")>=0))throw a;s=this._base_parseDate(e,t.substring(0,t.length-(a.length-a.indexOf(":")-2)),i),$.timepicker.log("Error parsing the date string: "+a+"\ndate string = "+t+"\ndate format = "+e)}return s},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(e){var t=this._get(e,"timepicker");return t?(t._updateDateTime(e),t.$input.val()):this._base_formatDate(e)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(e,t,i){var s,a=this._getInst(e);if(!a)return null;var n=this._get(a,"timepicker");if(n){var r,l,o,c,u=null,m=null,d=null,h=n._defaults.evnts,p={};if("string"==typeof t){if("minDate"===t||"minDateTime"===t)u=i;else if("maxDate"===t||"maxDateTime"===t)m=i;else if("onSelect"===t)d=i;else if(h.hasOwnProperty(t)){if(i===void 0)return h[t];p[t]=i,s={}}}else if("object"==typeof t){t.minDate?u=t.minDate:t.minDateTime?u=t.minDateTime:t.maxDate?m=t.maxDate:t.maxDateTime&&(m=t.maxDateTime);for(r in h)h.hasOwnProperty(r)&&t[r]&&(p[r]=t[r])}for(r in p)p.hasOwnProperty(r)&&(h[r]=p[r],s||(s=$.extend({},t)),delete s[r]);if(s&&isEmptyObject(s))return;if(u?(u=0===u?new Date:new Date(u),n._defaults.minDate=u,n._defaults.minDateTime=u):m?(m=0===m?new Date:new Date(m),n._defaults.maxDate=m,n._defaults.maxDateTime=m):d&&(n._defaults.onSelect=d),u||m)return c=$(e),o=c.datetimepicker("getDate"),l=this._base_optionDatepicker.call($.datepicker,e,s||t,i),c.datetimepicker("setDate",o),l}return void 0===i?this._base_optionDatepicker.call($.datepicker,e,t):this._base_optionDatepicker.call($.datepicker,e,s||t,i)};var isEmptyObject=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0},extendRemove=function(e,t){$.extend(e,t);for(var i in t)(null===t[i]||void 0===t[i])&&(e[i]=t[i]);return e},detectSupport=function(e){var t=e.replace(/'.*?'/g,"").toLowerCase(),i=function(e,t){return-1!==e.indexOf(t)?!0:!1};return{hour:i(t,"h"),minute:i(t,"m"),second:i(t,"s"),millisec:i(t,"l"),microsec:i(t,"c"),timezone:i(t,"z"),ampm:i(t,"t")&&i(e,"h"),iso8601:i(e,"Z")}},convert24to12=function(e){return e%=12,0===e&&(e=12),e+""},computeEffectiveSetting=function(e,t){return e&&e[t]?e[t]:$.timepicker._defaults[t]},splitDateTime=function(e,t){var i=computeEffectiveSetting(t,"separator"),s=computeEffectiveSetting(t,"timeFormat"),a=s.split(i),n=a.length,r=e.split(i),l=r.length;return l>1?{dateString:r.splice(0,l-n).join(i),timeString:r.splice(0,n).join(i)}:{dateString:e,timeString:""}},parseDateTimeInternal=function(e,t,i,s,a){var n,r,l;if(r=splitDateTime(i,a),n=$.datepicker._base_parseDate(e,r.dateString,s),""===r.timeString)return{date:n};if(l=$.datepicker.parseTime(t,r.timeString,a),!l)throw"Wrong time format";return{date:n,timeObj:l}},selectLocalTimezone=function(e,t){if(e&&e.timezone_select){var i=t||new Date;e.timezone_select.val(-i.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(e,t){if(isNaN(e)||e>840||-720>e)return e;var i=e,s=i%60,a=(i-s)/60,n=t?":":"",r=(i>=0?"+":"-")+("0"+Math.abs(a)).slice(-2)+n+("0"+Math.abs(s)).slice(-2);return"+00:00"===r?"Z":r},$.timepicker.timezoneOffsetNumber=function(e){var t=(""+e).replace(":","");return"Z"===t.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(t)?("-"===t.substr(0,1)?-1:1)*(60*parseInt(t.substr(1,2),10)+parseInt(t.substr(3,2),10)):e},$.timepicker.timezoneAdjust=function(e,t){var i=$.timepicker.timezoneOffsetNumber(t);return isNaN(i)||e.setMinutes(e.getMinutes()+-e.getTimezoneOffset()-i),e},$.timepicker.timeRange=function(e,t,i){return $.timepicker.handleRange("timepicker",e,t,i)},$.timepicker.datetimeRange=function(e,t,i){$.timepicker.handleRange("datetimepicker",e,t,i)},$.timepicker.dateRange=function(e,t,i){$.timepicker.handleRange("datepicker",e,t,i)},$.timepicker.handleRange=function(e,t,i,s){function a(a,n){var r=t[e]("getDate"),l=i[e]("getDate"),o=a[e]("getDate");if(null!==r){var c=new Date(r.getTime()),u=new Date(r.getTime());c.setMilliseconds(c.getMilliseconds()+s.minInterval),u.setMilliseconds(u.getMilliseconds()+s.maxInterval),s.minInterval>0&&c>l?i[e]("setDate",c):s.maxInterval>0&&l>u?i[e]("setDate",u):r>l&&n[e]("setDate",o)}}function n(t,i,a){if(t.val()){var n=t[e].call(t,"getDate");null!==n&&s.minInterval>0&&("minDate"===a&&n.setMilliseconds(n.getMilliseconds()+s.minInterval),"maxDate"===a&&n.setMilliseconds(n.getMilliseconds()-s.minInterval)),n.getTime&&i[e].call(i,"option",a,n)}}s=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},s);var r=!1;return"timepicker"===e&&(r=!0,e="datetimepicker"),$.fn[e].call(t,$.extend({timeOnly:r,onClose:function(){a($(this),i)},onSelect:function(){n($(this),i,"minDate")}},s,s.start)),$.fn[e].call(i,$.extend({timeOnly:r,onClose:function(){a($(this),t)},onSelect:function(){n($(this),t,"maxDate")}},s,s.end)),a(t,i),n(t,i,"minDate"),n(i,t,"maxDate"),$([t.get(0),i.get(0)])},$.timepicker.log=function(){window.console&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(e){return this.setMilliseconds(this.getMilliseconds()+Math.floor(e/1e3)),this.microseconds=e%1e3,this}),$.timepicker.version="1.5.0"}})(jQuery); \ No newline at end of file
diff --git a/http/3rdParty/jquery-2.1.4.min.js b/http/3rdParty/jquery-2.1.4.min.js
new file mode 100644
index 0000000..49990d6
--- /dev/null
+++ b/http/3rdParty/jquery-2.1.4.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
+return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
+void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
diff --git a/http/3rdParty/jquery-2.2.3.min.js b/http/3rdParty/jquery-2.2.3.min.js
new file mode 100644
index 0000000..b8c4187
--- /dev/null
+++ b/http/3rdParty/jquery-2.2.3.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
+}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
+e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
diff --git a/http/3rdParty/jquery-scrollstop-master/LICENSE.md b/http/3rdParty/jquery-scrollstop-master/LICENSE.md
new file mode 100644
index 0000000..3bddfec
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/LICENSE.md
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>
diff --git a/http/3rdParty/jquery-scrollstop-master/README.md b/http/3rdParty/jquery-scrollstop-master/README.md
new file mode 100644
index 0000000..0a0f2b8
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/README.md
@@ -0,0 +1,66 @@
+jquery-scrollstop
+=================
+
+This plugin fires two events on `window` when scrolling starts and stops:
+`scrollstart` and `scrollstop`.
+
+## Example
+
+The example shows a small box in the upper left that says "SCROLLING" and
+colors the body different colors when scrolling: http://ssorallen.com/jquery-scrollstop/
+
+## Usage
+
+`scrollstart` fires after the first scroll event and won't fire again until
+after a `scrollstop` event is fired.
+
+`scrollstop` fires after no `scroll` events have fired for 250 milliseconds.
+
+```js
+$(window)
+ .on("scrollstart", function() {
+ // Paint the world yellow when scrolling starts.
+ $(document.body).css({background: "yellow"});
+ })
+ .on("scrollstop", function() {
+ // Paint it all green when scrolling stops.
+ $(document.body).css({background: "green"});
+ })
+```
+
+### Configuration
+
+#### latency
+
+`latency` is the minimum time between the last scroll event and when the
+`scrollstop` event fires. Set `$.event.special.scrollstop.latency` to the
+desired number of milliseconds (default: 250).
+
+```js
+// Configure time between final scroll event and
+// `scrollstop` event to 650ms (default is 250ms).
+$.event.special.scrollstop.latency = 650;
+```
+
+##### latency per element
+
+Latency can be configured per-element by passing options when the event listener
+is bound. If multiple event listeners are bound to the same element, only the
+data from the first event listener will set the configuration.
+
+```js
+// Configure latency to 650ms for #scrolling-div
+$("#scrolling-div").on("scrollstop", {latency: 650}, function() { ... });
+```
+
+### jQuery Version Support
+
+The plugin is tested in jQuery 1.2.3+ and jQuery 2.0.3+.
+
+### Attribution
+
+James Padolsey's jQuery scrollstop plugin that fires an event when scrolling
+stops for minimum amount of time.
+
+Originally code copied from
+http://james.padolsey.com/javascript/special-scroll-events-for-jquery/
diff --git a/http/3rdParty/jquery-scrollstop-master/index.html b/http/3rdParty/jquery-scrollstop-master/index.html
new file mode 100644
index 0000000..6c2c06f
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/index.html
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<!-- Originally written by James Padolsey at
+ http://james.padolsey.com/demos/scrollevents/ -->
+<html lang="en">
+ <head>
+ <title>ScrollStop &amp; ScrollStart special events for JQuery</title>
+ <style>
+ body {
+ font-family: sans-serif;
+ font-size: 1.2em;
+ color: #EEE;
+ background: #333;
+ margin: 0;
+ padding: 20px 0;
+ }
+
+ .message {
+ background: black;
+ border: 1px solid yellow;
+ color: yellow;
+ height: 30px;
+ right: 50%;
+ line-height: 30px;
+ opacity: 0;
+ padding: 0 10px;
+ position: fixed;
+ top: 20px;
+ }
+
+ .message-secondary {
+ border-color: blue;
+ color: blue;
+ top: 60px;
+ }
+
+ .message-tertiary {
+ border-color: red;
+ color: red;
+ top: 100px;
+ }
+
+ .col-6 {
+ float: left;
+ padding: 0 15px;
+ width: 50%;
+ }
+
+ *,
+ *:after,
+ *:before {
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+
+ .panel {
+ background: blue;
+ max-height: 300px;
+ overflow: auto;
+ padding: 0 15px;
+ position: relative;
+ }
+
+ .panel-secondary {
+ background: red;
+ }
+
+ .panel + .panel {
+ margin-top: 15px;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="col-6">
+ <p>SCROLL THIS PAGE (JavaScript required to see demo in action!)</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ </div>
+ <div class="col-6">
+ <div class="panel" id="panel-first">
+ <p>SCROLL THIS DIV (2000ms latency)</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ </div>
+ <div class="panel panel-secondary" id="panel-second">
+ <p>SCROLL THIS DIV (500ms latency)</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
+ </div>
+ </div>
+
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
+ <script src="jquery.scrollstop.js"></script>
+ <script>
+ (function($) {
+ var message =
+ $('<div class="message">SCROLLING PAGE</div>').hide().appendTo(document.body);
+ var panelMessageFirst =
+ $('<div class="message message-secondary">SCROLLING PANEL 1</div>').hide().appendTo("#panel-first");
+ var panelMessageSecond =
+ $('<div class="message message-tertiary">SCROLLING PANEL 2</div>').hide().appendTo("#panel-second");
+
+ $(window)
+ .on('scrollstart', function() {
+ $(document.body).css({color: '#F6FF96'});
+ message.show().css({opacity: 1});
+ })
+ .on('scrollstop', function() {
+ $(document.body).css({color: ''});
+ message.stop().show().animate({opacity: 0});
+ });
+
+ var panelFirstConfig = {latency: 2000};
+ $("#panel-first")
+ .on('scrollstart', panelFirstConfig, function() {
+ $(this).css({color: 'yellow'});
+ panelMessageFirst.show().css({opacity: 1});
+ })
+ .on('scrollstop', panelFirstConfig, function() {
+ $(this).css({color: ''});
+ panelMessageFirst.stop().show().animate({opacity: 0});
+ });
+
+ var panelSecondConfig = {latency: 650};
+ $("#panel-second")
+ .on('scrollstart', panelSecondConfig, function() {
+ $(this).css({color: '#F6FF96'});
+ panelMessageSecond.show().css({opacity: 1});
+ })
+ .on('scrollstop', panelSecondConfig, function() {
+ $(this).css({color: ''});
+ panelMessageSecond.stop().show().animate({opacity: 0});
+ });
+ })(jQuery);
+ </script>
+ </body>
+</html>
diff --git a/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.js b/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.js
new file mode 100644
index 0000000..68048b5
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.js
@@ -0,0 +1,78 @@
+/*!
+ * jQuery Scrollstop Plugin v1.1.0
+ * https://github.com/ssorallen/jquery-scrollstop
+ */
+(function($) {
+ // $.event.dispatch was undocumented and was deprecated in jQuery 1.7[1]. It
+ // was replaced by $.event.handle in jQuery 1.9.
+ //
+ // Use the first of the available functions to support jQuery <1.8.
+ //
+ // [1] https://github.com/jquery/jquery-migrate/blob/master/src/event.js#L25
+ var dispatch = $.event.dispatch || $.event.handle;
+
+ var special = $.event.special,
+ uid1 = 'D' + (+new Date()),
+ uid2 = 'D' + (+new Date() + 1);
+
+ special.scrollstart = {
+ setup: function(data) {
+ var _data = $.extend({
+ latency: special.scrollstop.latency
+ }, data);
+
+ var timer,
+ handler = function(evt) {
+ var _self = this,
+ _args = arguments;
+
+ if (timer) {
+ clearTimeout(timer);
+ } else {
+ evt.type = 'scrollstart';
+ dispatch.apply(_self, _args);
+ }
+
+ timer = setTimeout(function() {
+ timer = null;
+ }, _data.latency);
+ };
+
+ $(this).bind('scroll', handler).data(uid1, handler);
+ },
+ teardown: function() {
+ $(this).unbind('scroll', $(this).data(uid1));
+ }
+ };
+
+ special.scrollstop = {
+ latency: 250,
+ setup: function(data) {
+ var _data = $.extend({
+ latency: special.scrollstop.latency
+ }, data);
+
+ var timer,
+ handler = function(evt) {
+ var _self = this,
+ _args = arguments;
+
+ if (timer) {
+ clearTimeout(timer);
+ }
+
+ timer = setTimeout(function() {
+ timer = null;
+ evt.type = 'scrollstop';
+ dispatch.apply(_self, _args);
+ }, _data.latency);
+ };
+
+ $(this).bind('scroll', handler).data(uid2, handler);
+ },
+ teardown: function() {
+ $(this).unbind('scroll', $(this).data(uid2));
+ }
+ };
+
+})(jQuery);
diff --git a/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.min.js b/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.min.js
new file mode 100644
index 0000000..cbb9fe5
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/jquery.scrollstop.min.js
@@ -0,0 +1,5 @@
+/*!
+ * jQuery Scrollstop Plugin v1.1.0
+ * https://github.com/ssorallen/jquery-scrollstop
+ */
+(function(e){var b=e.event.dispatch||e.event.handle;var a=e.event.special,d="D"+(+new Date()),c="D"+(+new Date()+1);a.scrollstart={setup:function(h){var g=e.extend({latency:a.scrollstop.latency},h);var i,f=function(l){var j=this,k=arguments;if(i){clearTimeout(i)}else{l.type="scrollstart";b.apply(j,k)}i=setTimeout(function(){i=null},g.latency)};e(this).bind("scroll",f).data(d,f)},teardown:function(){e(this).unbind("scroll",e(this).data(d))}};a.scrollstop={latency:250,setup:function(h){var g=e.extend({latency:a.scrollstop.latency},h);var i,f=function(l){var j=this,k=arguments;if(i){clearTimeout(i)}i=setTimeout(function(){i=null;l.type="scrollstop";b.apply(j,k)},g.latency)};e(this).bind("scroll",f).data(c,f)},teardown:function(){e(this).unbind("scroll",e(this).data(c))}}})(jQuery); \ No newline at end of file
diff --git a/http/3rdParty/jquery-scrollstop-master/scrollstop.jquery.json b/http/3rdParty/jquery-scrollstop-master/scrollstop.jquery.json
new file mode 100644
index 0000000..218f541
--- /dev/null
+++ b/http/3rdParty/jquery-scrollstop-master/scrollstop.jquery.json
@@ -0,0 +1,19 @@
+{
+ "name": "scrollstop",
+ "version": "1.1.0",
+
+ "author": {
+ "name": "James Padolsey",
+ "url": "http://james.padolsey.com/javascript/special-scroll-events-for-jquery/"
+ },
+ "dependencies": {
+ "jquery": ">=1.2.3"
+ },
+ "description": "jQuery plugin that adds custom scroll start and scroll stop events.",
+ "homepage": "https://github.com/ssorallen/jquery-scrollstop",
+ "maintainer": {
+ "name": "Ross Allen",
+ "url": "https://github.com/ssorallen/"
+ },
+ "title": "jQuery Scrollstop"
+}
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/external/jquery/jquery.js b/http/3rdParty/jquery-ui-1.11.4.custom/external/jquery/jquery.js
new file mode 100644
index 0000000..c5c64825
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/external/jquery/jquery.js
@@ -0,0 +1,9789 @@
+/*!
+ * jQuery JavaScript Library v1.10.2
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03T13:48Z
+ */
+(function( window, undefined ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//"use strict";
+var
+ // The deferred used on DOM ready
+ readyList,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // Support: IE<10
+ // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
+ core_strundefined = typeof undefined,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ location = window.location,
+ document = window.document,
+ docElem = document.documentElement,
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // [[Class]] -> type pairs
+ class2type = {},
+
+ // List of deleted data cache ids, so we can reuse them
+ core_deletedIds = [],
+
+ core_version = "1.10.2",
+
+ // Save a reference to some core methods
+ core_concat = core_deletedIds.concat,
+ core_push = core_deletedIds.push,
+ core_slice = core_deletedIds.slice,
+ core_indexOf = core_deletedIds.indexOf,
+ core_toString = class2type.toString,
+ core_hasOwn = class2type.hasOwnProperty,
+ core_trim = core_version.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Used for matching numbers
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+ // Used for splitting on whitespace
+ core_rnotwhite = /\S+/g,
+
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
+ // The ready event handler
+ completed = function( event ) {
+
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+ },
+ // Clean-up method for dom ready events
+ detach = function() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: core_version,
+
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return core_slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+ },
+
+ slice: function() {
+ return this.pushStack( core_slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: core_push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return String( obj );
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ core_toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !core_hasOwn.call(obj, "constructor") &&
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( jQuery.support.ownLast ) {
+ for ( key in obj ) {
+ return core_hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || core_hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // keepScripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+ if ( scripts ) {
+ jQuery( scripts ).remove();
+ }
+ return jQuery.merge( [], parsed.childNodes );
+ },
+
+ parseJSON: function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ if ( data === null ) {
+ return data;
+ }
+
+ if ( typeof data === "string" ) {
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ if ( data ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+ }
+ }
+ }
+
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+ function( text ) {
+ return text == null ?
+ "" :
+ core_trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ core_push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( core_indexOf ) {
+ return core_indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var l = second.length,
+ i = first.length,
+ j = 0;
+
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return core_concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Multifunctional method to get and set values of a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
+ // Note: this method belongs to the css module but it's needed here for the support module.
+ // If support gets modularized, this method should be moved back to the css module.
+ swap: function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || type !== "function" &&
+ ( length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+/*!
+ * Sizzle CSS Selector Engine v1.10.2
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03
+ */
+(function( window, undefined ) {
+
+var i,
+ support,
+ cachedruns,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ sortInput,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ hasDuplicate = false,
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rsibling = new RegExp( whitespace + "*[+~]" ),
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent.attachEvent && parent !== parent.top ) {
+ parent.attachEvent( "onbeforeunload", function() {
+ setDocument();
+ });
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = assert(function( div ) {
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select><option selected=''></option></select>";
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Support: Opera 10-12/IE8
+ // ^= $= *= and empty values
+ // Should not select anything
+ // Support: Windows 8 Native Apps
+ // The type attribute is restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "t", "" );
+
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
+
+ if ( compare ) {
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ }
+
+ // Not directly comparable, sort on existence of method
+ return a.compareDocumentPosition ? -1 : 1;
+ } :
+ function( a, b ) {
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Parentless nodes are either documents or disconnected
+ } else if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val === undefined ?
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null :
+ val;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var data, cache, outerCache,
+ dirkey = dirruns + " " + doneName;
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+ if ( (data = cache[1]) === true || data === cachedruns ) {
+ return data === true;
+ }
+ } else {
+ cache = outerCache[ dir ] = [ dirkey ];
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
+ if ( cache[1] === true ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ // A counter to specify which element is currently being matched
+ var matcherCachedRuns = 0,
+ bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = matcherCachedRuns;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++matcherCachedRuns;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ elem[ name ] === true ? name.toLowerCase() : null;
+ }
+ });
+}
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})( window );
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+jQuery.support = (function( support ) {
+
+ var all, a, input, select, fragment, opt, eventName, isSupported, i,
+ div = document.createElement("div");
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+ // Finish early in limited (non-browser) environments
+ all = div.getElementsByTagName("*") || [];
+ a = div.getElementsByTagName("a")[ 0 ];
+ if ( !a || !a.style || !all.length ) {
+ return support;
+ }
+
+ // First batch of tests
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px;float:left;opacity:.5";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName("tbody").length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName("link").length;
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ support.opacity = /^0.5/.test( a.style.opacity );
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!a.style.cssFloat;
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
+
+ // Will be defined later
+ support.inlineBlockNeedsLayout = false;
+ support.shrinkWrapBlocks = false;
+ support.pixelPosition = false;
+ support.deleteExpando = true;
+ support.noCloneEvent = true;
+ support.reliableMarginRight = true;
+ support.boxSizingReliable = true;
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE<9
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ // Check if we can trust getAttribute("value")
+ input = document.createElement("input");
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "checked", "t" );
+ input.setAttribute( "name", "t" );
+
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( input );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ div.setAttribute( eventName = "on" + i, "t" );
+
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+ }
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Support: IE<9
+ // Iteration over object's inherited properties before its own.
+ for ( i in jQuery( support ) ) {
+ break;
+ }
+ support.ownLast = i !== "0";
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, marginDiv, tds,
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Support: IE8
+ // Check if empty table cells still have offsetWidth/Height
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Check box-sizing and margin behavior.
+ div.innerHTML = "";
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
+ // with some non-1 values of body zoom, ticket #13543
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
+ support.boxSizing = div.offsetWidth === 4;
+ });
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = div.appendChild( document.createElement("div") );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
+
+ if ( typeof div.style.zoom !== core_strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.innerHTML = "";
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ div.style.display = "block";
+ div.innerHTML = "<div></div>";
+ div.firstChild.style.width = "5px";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+ if ( support.inlineBlockNeedsLayout ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE
+ container = div = tds = marginDiv = null;
+ });
+
+ // Null elements to avoid leaks in IE
+ all = select = fragment = opt = a = input = null;
+
+ return support;
+})({});
+
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ){
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "applet": true,
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ // Do not set data on non-element because it will not be cleared (#8335).
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
+ return false;
+ }
+
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ // nodes accept data unless otherwise specified; rejection can be conditional
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var attrs, name,
+ data = null,
+ i = 0,
+ elem = this[0];
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attrs = elem.attributes;
+ for ( ; i < attrs.length; i++ ) {
+ name = attrs[i].name;
+
+ if ( name.indexOf("data-") === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var nodeHook, boolHook,
+ rclass = /[\t\r\n\f]/g,
+ rreturn = /\r/g,
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ getSetInput = jQuery.support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+ elem.className = jQuery.trim( cur );
+
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+ elem.className = value ? jQuery.trim( cur ) : "";
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( core_rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === core_strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var ret, hooks, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // Use proper attribute retrieval(#6932, #12072)
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+ if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
+ optionSet = true;
+ }
+ }
+
+ // force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === core_strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( core_rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
+
+ jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var fn = jQuery.expr.attrHandle[ name ],
+ ret = isXML ?
+ undefined :
+ /* jshint eqeqeq: false */
+ (jQuery.expr.attrHandle[ name ] = undefined) !=
+ getter( elem, name, isXML ) ?
+
+ name.toLowerCase() :
+ null;
+ jQuery.expr.attrHandle[ name ] = fn;
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ return isXML ?
+ undefined :
+ elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ return name === "value" || value === elem.getAttribute( name ) ?
+ value :
+ undefined;
+ }
+ };
+ jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
+ // Some attributes are constructed with empty-string values when not defined
+ function( elem, name, isXML ) {
+ var ret;
+ return isXML ?
+ undefined :
+ (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ };
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ return ret && ret.specified ?
+ ret.value :
+ undefined;
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !jQuery.support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !jQuery.support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = core_slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ /* jshint eqeqeq: false */
+ for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: IE<9
+ // Fix target property (#1925)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Support: Chrome 23+, Safari?
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Support: IE<9
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var body, eventDoc, doc,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ try {
+ this.focus();
+ return false;
+ } catch ( e ) {
+ // Support: IE<9
+ // If we error on focus to hidden element (#1486, #12518),
+ // let .trigger() run the handlers
+ }
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Even when returnValue equals to undefined Firefox will still show alert
+ if ( event.result !== undefined ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === core_strundefined ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+ if ( !e ) {
+ return;
+ }
+
+ // If preventDefault exists, run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // Support: IE
+ // Otherwise set the returnValue property of the original event to false
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+ if ( !e ) {
+ return;
+ }
+ // If stopPropagation exists, run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+
+ // Support: IE
+ // Set the cancelBubble property of the original event to true
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ jQuery._data( form, "submitBubbles", true );
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !jQuery.support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ }
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ jQuery._data( elem, "changeBubbles", true );
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var type, origFn;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+var isSimple = /^.[^:#\[\.,]*$/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ rneedsContext = jQuery.expr.match.needsContext,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ ret = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ cur = ret.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( jQuery.unique(all) );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ ret = jQuery.unique( ret );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
+ });
+}
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /^$|\/(?:java|ecma)script/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ area: [ 1, "<map>", "</map>" ],
+ param: [ 1, "<object>", "</object>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+ // unless wrapped in a div with non-breaking characters in front of it.
+ _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
+ },
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return jQuery.access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return jQuery.access( this, function( value ) {
+ var elem = this[0] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var
+ // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
+ args = jQuery.map( this, function( elem ) {
+ return [ elem.nextSibling, elem.parentNode ];
+ }),
+ i = 0;
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ var next = args[ i++ ],
+ parent = args[ i++ ];
+
+ if ( parent ) {
+ // Don't use the snapshot next if it has moved (#13810)
+ if ( next && next.parentNode !== parent ) {
+ next = this.nextSibling;
+ }
+ jQuery( this ).remove();
+ parent.insertBefore( elem, next );
+ }
+ // Allow new content to include elements from the context set
+ }, true );
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return i ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback, allowIntersection ) {
+
+ // Flatten any nested arrays
+ args = core_concat.apply( [], args );
+
+ var first, node, hasScripts,
+ scripts, doc, fragment,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[0],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[0] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback, allowIntersection );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[i], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Hope ajax is available...
+ jQuery._evalUrl( node.src );
+ } else {
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+ }
+ }
+
+ return this;
+ }
+});
+
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+ if ( match ) {
+ elem.type = match[1];
+ } else {
+ elem.removeAttribute("type");
+ }
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var elem,
+ i = 0;
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+ var nodeName, e, data;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
+ if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
+ data = jQuery._data( dest );
+
+ for ( e in data.events ) {
+ jQuery.removeEvent( dest, e, data.handle );
+ }
+
+ // Event data gets referenced instead of copied if the expando gets copied too
+ dest.removeAttribute( jQuery.expando );
+ }
+
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+ if ( nodeName === "script" && dest.text !== src.text ) {
+ disableScript( dest ).text = src.text;
+ restoreScript( dest );
+
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ } else if ( nodeName === "object" ) {
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.defaultSelected = dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone(true);
+ jQuery( insert[i] )[ original ]( elems );
+
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+ core_push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+function getAll( context, tag ) {
+ var elems, elem,
+ i = 0,
+ found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
+ undefined;
+
+ if ( !found ) {
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
+ found.push( elem );
+ } else {
+ jQuery.merge( found, getAll( elem, tag ) );
+ }
+ }
+ }
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], found ) :
+ found;
+}
+
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( manipulation_rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var destElements, node, clone, i, srcElements,
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ // Fix all IE cloning issues
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ fixCloneNodeIssues( node, destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+ cloneCopyEvent( node, destElements[i] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ destElements = srcElements = node = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var j, elem, contains,
+ tmp, tag, tbody, wrap,
+ l = elems.length,
+
+ // Ensure a safe fragment
+ safe = createSafeFragment( context ),
+
+ nodes = [],
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || safe.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
+
+ // Descend through wrappers to the right content
+ j = wrap[0];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Manually add leading whitespace removed by IE
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ elem = tag === "table" && !rtbody.test( elem ) ?
+ tmp.firstChild :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
+ tmp :
+ 0;
+
+ j = elem && elem.childNodes.length;
+ while ( j-- ) {
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+ elem.removeChild( tbody );
+ }
+ }
+ }
+
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Fix #12392 for WebKit and IE > 9
+ tmp.textContent = "";
+
+ // Fix #12392 for oldIE
+ while ( tmp.firstChild ) {
+ tmp.removeChild( tmp.firstChild );
+ }
+
+ // Remember the top-level container for proper cleanup
+ tmp = safe.lastChild;
+ }
+ }
+ }
+
+ // Fix #11356: Clear elements from fragment
+ if ( tmp ) {
+ safe.removeChild( tmp );
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !jQuery.support.appendChecked ) {
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+ }
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( safe.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ tmp = null;
+
+ return safe;
+ },
+
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var elem, type, id, data,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ deleteExpando = jQuery.support.deleteExpando,
+ special = jQuery.event.special;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( acceptData || jQuery.acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( typeof elem.removeAttribute !== core_strundefined ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
+
+ core_deletedIds.push( id );
+ }
+ }
+ }
+ }
+ },
+
+ _evalUrl: function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+ }
+});
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+var iframe, getStyles, curCSS,
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity\s*=\s*([^)]*)/,
+ rposition = /^(top|right|bottom|left)$/,
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rmargin = /^margin/,
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
+ elemdisplay = { BODY: "block" },
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: 0,
+ fontWeight: 400
+ },
+
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function isHidden( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+ }
+ } else {
+
+ if ( !values[ index ] ) {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+ }
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
+ var len, styles,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+ // but it would mean to define eight (for every problematic property) identical functions
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var num, val, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+// NOTE: we've included the "window" in window.getComputedStyle
+// because jsdom on node.js will break without it.
+if ( window.getComputedStyle ) {
+ getStyles = function( elem ) {
+ return window.getComputedStyle( elem, null );
+ };
+
+ curCSS = function( elem, name, _computed ) {
+ var width, minWidth, maxWidth,
+ computed = _computed || getStyles( elem ),
+
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
+ style = elem.style;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret;
+ };
+} else if ( document.documentElement.currentStyle ) {
+ getStyles = function( elem ) {
+ return elem.currentStyle;
+ };
+
+ curCSS = function( elem, name, _computed ) {
+ var left, rs, rsLeft,
+ computed = _computed || getStyles( elem ),
+ ret = computed ? computed[ name ] : undefined,
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rs = elem.runtimeStyle;
+ rsLeft = rs && rs.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ rs.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ rs.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+// Try to determine the default display value of an element
+function css_defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+ // Use the already-created iframe if possible
+ iframe = ( iframe ||
+ jQuery("<iframe frameborder='0' width='0' height='0'/>")
+ .css( "cssText", "display:block !important" )
+ ).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
+ doc.write("<!doctype html><html><body>");
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+// Called ONLY from within css_defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+ display = jQuery.css( elem[0], "display" );
+ elem.remove();
+ return display;
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ // if value === "", then remove inline opacity #12685
+ if ( ( value >= 1 || value === "" ) &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+// These hooks cannot be added until DOM ready because the support test
+// for it is not run until after DOM ready
+jQuery(function() {
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+ };
+ }
+
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+ // getComputedStyle returns percent when specified for top/left/bottom/right
+ // rather than make the css module depend on the offset module, we just check for it here
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ };
+ });
+ }
+
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+ (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function(){
+ var type = this.type;
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !manipulation_rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+//Serialize an array of form elements or a set of
+//key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+ ajax_nonce = jQuery.now(),
+
+ ajax_rquery = /\?/,
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat("*");
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType[0] === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var deep, key,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, response, type,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
+ jQuery.fn[ type ] = function( fn ){
+ return this.on( type, fn );
+ };
+});
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement("script");
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+var xhrCallbacks, xhrSupported,
+ xhrId = 0,
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
+ // Abort all pending requests
+ var key;
+ for ( key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ };
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+xhrSupported = jQuery.ajaxSettings.xhr();
+jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = jQuery.support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var handle, i,
+ xhr = s.xhr();
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( err ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, responseHeaders, statusText, responses;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occurred
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ });
+}
+var fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ }]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !jQuery.support.shrinkWrapBlocks ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+ continue;
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+ }
+}
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth? 1 : 0;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
+ }
+};
+
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ if ( timer() && jQuery.timers.push( timer ) ) {
+ jQuery.fx.start();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+};
+
+jQuery.offset = {
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || docElem;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+// Limit scope pollution from any deprecated API
+// (function() {
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+// })();
+if ( typeof module === "object" && module && typeof module.exports === "object" ) {
+ // Expose jQuery as module.exports in loaders that implement the Node
+ // module pattern (including browserify). Do not create the global, since
+ // the user will be storing it themselves locally, and globals are frowned
+ // upon in the Node module world.
+ module.exports = jQuery;
+} else {
+ // Otherwise expose jQuery to the global object as usual
+ window.jQuery = window.$ = jQuery;
+
+ // Register as a named AMD module, since jQuery can be concatenated with other
+ // files that may use define, but not via a proper concatenation script that
+ // understands anonymous AMD modules. A named AMD is safest and most robust
+ // way to register. Lowercase jquery is used because AMD module names are
+ // derived from file names, and jQuery is normally delivered in a lowercase
+ // file name. Do this after creating the global so that if an AMD module wants
+ // to call noConflict to hide this version of jQuery, it will work.
+ if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function () { return jQuery; } );
+ }
+}
+
+})( window );
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_100_f5f0e5_1x400.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_100_f5f0e5_1x400.png
new file mode 100644
index 0000000..4a0e99b
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_100_f5f0e5_1x400.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_25_cb842e_1x400.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_25_cb842e_1x400.png
new file mode 100644
index 0000000..2711858
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_25_cb842e_1x400.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_70_ede4d4_1x400.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_70_ede4d4_1x400.png
new file mode 100644
index 0000000..84f42ab
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_glass_70_ede4d4_1x400.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
new file mode 100644
index 0000000..e6c7f75
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_65_fee4bd_1x100.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
new file mode 100644
index 0000000..40d0406
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
new file mode 100644
index 0000000..436b187
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_inset-soft_100_f4f0ec_1x100.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
new file mode 100644
index 0000000..dbc380b
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_c47a23_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_c47a23_256x240.png
new file mode 100644
index 0000000..512a4e5
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_c47a23_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_cb672b_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_cb672b_256x240.png
new file mode 100644
index 0000000..31aecf7
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_cb672b_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f08000_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f08000_256x240.png
new file mode 100644
index 0000000..49adc79
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f08000_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f35f07_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f35f07_256x240.png
new file mode 100644
index 0000000..0b3322c
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_f35f07_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ff7519_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ff7519_256x240.png
new file mode 100644
index 0000000..986e82b
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ff7519_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ffffff_256x240.png b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 0000000..4d66f59
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/index.html b/http/3rdParty/jquery-ui-1.11.4.custom/index.html
new file mode 100644
index 0000000..54a12a7
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/index.html
@@ -0,0 +1,484 @@
+<!doctype html>
+<html lang="us">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Example Page</title>
+ <link href="jquery-ui.css" rel="stylesheet">
+ <style>
+ body{
+ font: 62.5% "Trebuchet MS", sans-serif;
+ margin: 50px;
+ }
+ .demoHeaders {
+ margin-top: 2em;
+ }
+ #dialog-link {
+ padding: .4em 1em .4em 20px;
+ text-decoration: none;
+ position: relative;
+ }
+ #dialog-link span.ui-icon {
+ margin: 0 5px 0 0;
+ position: absolute;
+ left: .2em;
+ top: 50%;
+ margin-top: -8px;
+ }
+ #icons {
+ margin: 0;
+ padding: 0;
+ }
+ #icons li {
+ margin: 2px;
+ position: relative;
+ padding: 4px 0;
+ cursor: pointer;
+ float: left;
+ list-style: none;
+ }
+ #icons span.ui-icon {
+ float: left;
+ margin: 0 4px;
+ }
+ .fakewindowcontain .ui-widget-overlay {
+ position: absolute;
+ }
+ select {
+ width: 200px;
+ }
+ </style>
+</head>
+<body>
+
+<h1>Welcome to jQuery UI!</h1>
+
+<div class="ui-widget">
+ <p>This page demonstrates the widgets and theme you selected in Download Builder. Please make sure you are using them with a compatible jQuery version.</p>
+</div>
+
+<h1>YOUR COMPONENTS:</h1>
+
+
+<!-- Accordion -->
+<h2 class="demoHeaders">Accordion</h2>
+<div id="accordion">
+ <h3>First</h3>
+ <div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
+ <h3>Second</h3>
+ <div>Phasellus mattis tincidunt nibh.</div>
+ <h3>Third</h3>
+ <div>Nam dui erat, auctor a, dignissim quis.</div>
+</div>
+
+
+
+<!-- Autocomplete -->
+<h2 class="demoHeaders">Autocomplete</h2>
+<div>
+ <input id="autocomplete" title="type &quot;a&quot;">
+</div>
+
+
+
+<!-- Button -->
+<h2 class="demoHeaders">Button</h2>
+<button id="button">A button element</button>
+<form style="margin-top: 1em;">
+ <div id="radioset">
+ <input type="radio" id="radio1" name="radio"><label for="radio1">Choice 1</label>
+ <input type="radio" id="radio2" name="radio" checked="checked"><label for="radio2">Choice 2</label>
+ <input type="radio" id="radio3" name="radio"><label for="radio3">Choice 3</label>
+ </div>
+</form>
+
+
+
+<!-- Tabs -->
+<h2 class="demoHeaders">Tabs</h2>
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">First</a></li>
+ <li><a href="#tabs-2">Second</a></li>
+ <li><a href="#tabs-3">Third</a></li>
+ </ul>
+ <div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
+ <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
+ <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
+</div>
+
+
+
+<!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->
+<h2 class="demoHeaders">Dialog</h2>
+<p><a href="#" id="dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p>
+
+<h2 class="demoHeaders">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>
+<div style="position: relative; width: 96%; height: 200px; padding:1% 2%; overflow:hidden;" class="fakewindowcontain">
+ <p>Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. </p><p>Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. </p><p>Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. </p><p>Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. </p>
+
+ <!-- ui-dialog -->
+ <div class="ui-overlay"><div class="ui-widget-overlay"></div><div class="ui-widget-shadow ui-corner-all" style="width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;"></div></div>
+ <div style="position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;" class="ui-widget ui-widget-content ui-corner-all">
+ <div class="ui-dialog-content ui-widget-content" style="background: none; border: 0;">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ </div>
+
+</div>
+
+<!-- ui-dialog -->
+<div id="dialog" title="Dialog Title">
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+</div>
+
+
+
+<h2 class="demoHeaders">Framework Icons (content color preview)</h2>
+<ul id="icons" class="ui-widget ui-helper-clearfix">
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-w"><span class="ui-icon ui-icon-carat-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-nw"><span class="ui-icon ui-icon-carat-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-n-s"><span class="ui-icon ui-icon-carat-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
+ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li>
+</ul>
+
+
+
+
+<!-- Datepicker -->
+<h2 class="demoHeaders">Datepicker</h2>
+<div id="datepicker"></div>
+
+
+
+
+
+
+
+<!-- Spinner -->
+<h2 class="demoHeaders">Spinner</h2>
+<input id="spinner">
+
+
+
+<!-- Menu -->
+<h2 class="demoHeaders">Menu</h2>
+<ul style="width:100px;" id="menu">
+ <li>Item 1</li>
+ <li>Item 2</li>
+ <li>Item 3
+ <ul>
+ <li>Item 3-1</li>
+ <li>Item 3-2</li>
+ <li>Item 3-3</li>
+ <li>Item 3-4</li>
+ <li>Item 3-5</li>
+ </ul>
+ </li>
+ <li>Item 4</li>
+ <li>Item 5</li>
+</ul>
+
+
+
+<!-- Tooltip -->
+<h2 class="demoHeaders">Tooltip</h2>
+<p id="tooltip">
+ <a href="#" title="That&apos;s what this widget is">Tooltips</a> can be attached to any element. When you hover
+the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
+</p>
+
+
+<!-- Highlight / Error -->
+<h2 class="demoHeaders">Highlight / Error</h2>
+<div class="ui-widget">
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
+ <strong>Hey!</strong> Sample ui-state-highlight style.</p>
+ </div>
+</div>
+<br>
+<div class="ui-widget">
+ <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
+ <strong>Alert:</strong> Sample ui-state-error style.</p>
+ </div>
+</div>
+
+<script src="external/jquery/jquery.js"></script>
+<script src="jquery-ui.js"></script>
+<script>
+
+$( "#accordion" ).accordion();
+
+
+
+var availableTags = [
+ "ActionScript",
+ "AppleScript",
+ "Asp",
+ "BASIC",
+ "C",
+ "C++",
+ "Clojure",
+ "COBOL",
+ "ColdFusion",
+ "Erlang",
+ "Fortran",
+ "Groovy",
+ "Haskell",
+ "Java",
+ "JavaScript",
+ "Lisp",
+ "Perl",
+ "PHP",
+ "Python",
+ "Ruby",
+ "Scala",
+ "Scheme"
+];
+$( "#autocomplete" ).autocomplete({
+ source: availableTags
+});
+
+
+
+$( "#button" ).button();
+$( "#radioset" ).buttonset();
+
+
+
+$( "#tabs" ).tabs();
+
+
+
+$( "#dialog" ).dialog({
+ autoOpen: false,
+ width: 400,
+ buttons: [
+ {
+ text: "Ok",
+ click: function() {
+ $( this ).dialog( "close" );
+ }
+ },
+ {
+ text: "Cancel",
+ click: function() {
+ $( this ).dialog( "close" );
+ }
+ }
+ ]
+});
+
+// Link to open the dialog
+$( "#dialog-link" ).click(function( event ) {
+ $( "#dialog" ).dialog( "open" );
+ event.preventDefault();
+});
+
+
+
+$( "#datepicker" ).datepicker({
+ inline: true
+});
+
+
+
+
+
+
+
+$( "#spinner" ).spinner();
+
+
+
+$( "#menu" ).menu();
+
+
+
+$( "#tooltip" ).tooltip();
+
+
+
+
+// Hover states on the static widgets
+$( "#dialog-link, #icons li" ).hover(
+ function() {
+ $( this ).addClass( "ui-state-hover" );
+ },
+ function() {
+ $( this ).removeClass( "ui-state-hover" );
+ }
+);
+</script>
+</body>
+</html>
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.css
new file mode 100644
index 0000000..daab1bf
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.css
@@ -0,0 +1,1093 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, spinner.css, tabs.css, tooltip.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=cb842e&bgTextureHeader=glass&bgImgOpacityHeader=25&borderColorHeader=d49768&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=f4f0ec&bgTextureContent=inset_soft&bgImgOpacityContent=100&borderColorContent=e0cfc2&fcContent=1e1b1d&iconColorContent=c47a23&bgColorDefault=ede4d4&bgTextureDefault=glass&bgImgOpacityDefault=70&borderColorDefault=cdc3b7&fcDefault=3f3731&iconColorDefault=f08000&bgColorHover=f5f0e5&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=f5ad66&fcHover=a46313&iconColorHover=f08000&bgColorActive=f4f0ec&bgTextureActive=highlight_hard&bgImgOpacityActive=100&borderColorActive=e0cfc2&fcActive=b85700&iconColorActive=f35f07&bgColorHighlight=f5f5b5&bgTextureHighlight=highlight_hard&bgImgOpacityHighlight=75&borderColorHighlight=d9bb73&fcHighlight=060200&iconColorHighlight=cb672b&bgColorError=fee4bd&bgTextureError=highlight_hard&bgImgOpacityError=65&borderColorError=f8893f&fcError=592003&iconColorError=ff7519&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=75&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+ display: none;
+}
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.ui-helper-reset {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ line-height: 1.3;
+ text-decoration: none;
+ font-size: 100%;
+ list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+.ui-helper-clearfix {
+ min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ position: absolute;
+ opacity: 0;
+ filter:Alpha(Opacity=0); /* support: IE8 */
+}
+
+.ui-front {
+ z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+ cursor: default !important;
+}
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ display: block;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-draggable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable {
+ position: relative;
+}
+.ui-resizable-handle {
+ position: absolute;
+ font-size: 0.1px;
+ display: block;
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable-disabled .ui-resizable-handle,
+.ui-resizable-autohide .ui-resizable-handle {
+ display: none;
+}
+.ui-resizable-n {
+ cursor: n-resize;
+ height: 7px;
+ width: 100%;
+ top: -5px;
+ left: 0;
+}
+.ui-resizable-s {
+ cursor: s-resize;
+ height: 7px;
+ width: 100%;
+ bottom: -5px;
+ left: 0;
+}
+.ui-resizable-e {
+ cursor: e-resize;
+ width: 7px;
+ right: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-w {
+ cursor: w-resize;
+ width: 7px;
+ left: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-se {
+ cursor: se-resize;
+ width: 12px;
+ height: 12px;
+ right: 1px;
+ bottom: 1px;
+}
+.ui-resizable-sw {
+ cursor: sw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ bottom: -5px;
+}
+.ui-resizable-nw {
+ cursor: nw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ top: -5px;
+}
+.ui-resizable-ne {
+ cursor: ne-resize;
+ width: 9px;
+ height: 9px;
+ right: -5px;
+ top: -5px;
+}
+.ui-selectable {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-selectable-helper {
+ position: absolute;
+ z-index: 100;
+ border: 1px dotted black;
+}
+.ui-sortable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-accordion .ui-accordion-header {
+ display: block;
+ cursor: pointer;
+ position: relative;
+ margin: 2px 0 0 0;
+ padding: .5em .5em .5em .7em;
+ min-height: 0; /* support: IE7 */
+ font-size: 100%;
+}
+.ui-accordion .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-icons .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
+ position: absolute;
+ left: .5em;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-accordion .ui-accordion-content {
+ padding: 1em 2.2em;
+ border-top: 0;
+ overflow: auto;
+}
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
+.ui-button {
+ display: inline-block;
+ position: relative;
+ padding: 0;
+ line-height: normal;
+ margin-right: .1em;
+ cursor: pointer;
+ vertical-align: middle;
+ text-align: center;
+ overflow: visible; /* removes extra width in IE */
+}
+.ui-button,
+.ui-button:link,
+.ui-button:visited,
+.ui-button:hover,
+.ui-button:active {
+ text-decoration: none;
+}
+/* to make room for the icon, a width needs to be set here */
+.ui-button-icon-only {
+ width: 2.2em;
+}
+/* button elements seem to need a little more width */
+button.ui-button-icon-only {
+ width: 2.4em;
+}
+.ui-button-icons-only {
+ width: 3.4em;
+}
+button.ui-button-icons-only {
+ width: 3.7em;
+}
+
+/* button text element */
+.ui-button .ui-button-text {
+ display: block;
+ line-height: normal;
+}
+.ui-button-text-only .ui-button-text {
+ padding: .4em 1em;
+}
+.ui-button-icon-only .ui-button-text,
+.ui-button-icons-only .ui-button-text {
+ padding: .4em;
+ text-indent: -9999999px;
+}
+.ui-button-text-icon-primary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 1em .4em 2.1em;
+}
+.ui-button-text-icon-secondary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 2.1em .4em 1em;
+}
+.ui-button-text-icons .ui-button-text {
+ padding-left: 2.1em;
+ padding-right: 2.1em;
+}
+/* no icon support for input elements, provide padding by default */
+input.ui-button {
+ padding: .4em 1em;
+}
+
+/* button icon element(s) */
+.ui-button-icon-only .ui-icon,
+.ui-button-text-icon-primary .ui-icon,
+.ui-button-text-icon-secondary .ui-icon,
+.ui-button-text-icons .ui-icon,
+.ui-button-icons-only .ui-icon {
+ position: absolute;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-button-icon-only .ui-icon {
+ left: 50%;
+ margin-left: -8px;
+}
+.ui-button-text-icon-primary .ui-button-icon-primary,
+.ui-button-text-icons .ui-button-icon-primary,
+.ui-button-icons-only .ui-button-icon-primary {
+ left: .5em;
+}
+.ui-button-text-icon-secondary .ui-button-icon-secondary,
+.ui-button-text-icons .ui-button-icon-secondary,
+.ui-button-icons-only .ui-button-icon-secondary {
+ right: .5em;
+}
+
+/* button sets */
+.ui-buttonset {
+ margin-right: 7px;
+}
+.ui-buttonset .ui-button {
+ margin-left: 0;
+ margin-right: -.3em;
+}
+
+/* workarounds */
+/* reset extra padding in Firefox, see h5bp.com/l */
+input.ui-button::-moz-focus-inner,
+button.ui-button::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+.ui-datepicker {
+ width: 17em;
+ padding: .2em .2em 0;
+ display: none;
+}
+.ui-datepicker .ui-datepicker-header {
+ position: relative;
+ padding: .2em 0;
+}
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+ position: absolute;
+ top: 2px;
+ width: 1.8em;
+ height: 1.8em;
+}
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+ top: 1px;
+}
+.ui-datepicker .ui-datepicker-prev {
+ left: 2px;
+}
+.ui-datepicker .ui-datepicker-next {
+ right: 2px;
+}
+.ui-datepicker .ui-datepicker-prev-hover {
+ left: 1px;
+}
+.ui-datepicker .ui-datepicker-next-hover {
+ right: 1px;
+}
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+ display: block;
+ position: absolute;
+ left: 50%;
+ margin-left: -8px;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-datepicker .ui-datepicker-title {
+ margin: 0 2.3em;
+ line-height: 1.8em;
+ text-align: center;
+}
+.ui-datepicker .ui-datepicker-title select {
+ font-size: 1em;
+ margin: 1px 0;
+}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+ width: 45%;
+}
+.ui-datepicker table {
+ width: 100%;
+ font-size: .9em;
+ border-collapse: collapse;
+ margin: 0 0 .4em;
+}
+.ui-datepicker th {
+ padding: .7em .3em;
+ text-align: center;
+ font-weight: bold;
+ border: 0;
+}
+.ui-datepicker td {
+ border: 0;
+ padding: 1px;
+}
+.ui-datepicker td span,
+.ui-datepicker td a {
+ display: block;
+ padding: .2em;
+ text-align: right;
+ text-decoration: none;
+}
+.ui-datepicker .ui-datepicker-buttonpane {
+ background-image: none;
+ margin: .7em 0 0 0;
+ padding: 0 .2em;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 0;
+}
+.ui-datepicker .ui-datepicker-buttonpane button {
+ float: right;
+ margin: .5em .2em .4em;
+ cursor: pointer;
+ padding: .2em .6em .3em .6em;
+ width: auto;
+ overflow: visible;
+}
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+ float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+ width: auto;
+}
+.ui-datepicker-multi .ui-datepicker-group {
+ float: left;
+}
+.ui-datepicker-multi .ui-datepicker-group table {
+ width: 95%;
+ margin: 0 auto .4em;
+}
+.ui-datepicker-multi-2 .ui-datepicker-group {
+ width: 50%;
+}
+.ui-datepicker-multi-3 .ui-datepicker-group {
+ width: 33.3%;
+}
+.ui-datepicker-multi-4 .ui-datepicker-group {
+ width: 25%;
+}
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+ border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+ clear: left;
+}
+.ui-datepicker-row-break {
+ clear: both;
+ width: 100%;
+ font-size: 0;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+ direction: rtl;
+}
+.ui-datepicker-rtl .ui-datepicker-prev {
+ right: 2px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next {
+ left: 2px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+ right: 1px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+ left: 1px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+ clear: right;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+ float: left;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
+.ui-datepicker-rtl .ui-datepicker-group {
+ float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+ border-right-width: 0;
+ border-left-width: 1px;
+}
+.ui-dialog {
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: .2em;
+ outline: 0;
+}
+.ui-dialog .ui-dialog-titlebar {
+ padding: .4em 1em;
+ position: relative;
+}
+.ui-dialog .ui-dialog-title {
+ float: left;
+ margin: .1em 0;
+ white-space: nowrap;
+ width: 90%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.ui-dialog .ui-dialog-titlebar-close {
+ position: absolute;
+ right: .3em;
+ top: 50%;
+ width: 20px;
+ margin: -10px 0 0 0;
+ padding: 1px;
+ height: 20px;
+}
+.ui-dialog .ui-dialog-content {
+ position: relative;
+ border: 0;
+ padding: .5em 1em;
+ background: none;
+ overflow: auto;
+}
+.ui-dialog .ui-dialog-buttonpane {
+ text-align: left;
+ border-width: 1px 0 0 0;
+ background-image: none;
+ margin-top: .5em;
+ padding: .3em 1em .5em .4em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+ float: right;
+}
+.ui-dialog .ui-dialog-buttonpane button {
+ margin: .5em .4em .5em 0;
+ cursor: pointer;
+}
+.ui-dialog .ui-resizable-se {
+ width: 12px;
+ height: 12px;
+ right: -5px;
+ bottom: -5px;
+ background-position: 16px 16px;
+}
+.ui-draggable .ui-dialog-titlebar {
+ cursor: move;
+}
+.ui-menu {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: block;
+ outline: none;
+}
+.ui-menu .ui-menu {
+ position: absolute;
+}
+.ui-menu .ui-menu-item {
+ position: relative;
+ margin: 0;
+ padding: 3px 1em 3px .4em;
+ cursor: pointer;
+ min-height: 0; /* support: IE7 */
+ /* support: IE10, see #8844 */
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+.ui-menu .ui-menu-divider {
+ margin: 5px 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ border-width: 1px 0 0 0;
+}
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
+ margin: -1px;
+}
+
+/* icon support */
+.ui-menu-icons {
+ position: relative;
+}
+.ui-menu-icons .ui-menu-item {
+ padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: .2em;
+ margin: auto 0;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+ left: auto;
+ right: 0;
+}
+.ui-spinner {
+ position: relative;
+ display: inline-block;
+ overflow: hidden;
+ padding: 0;
+ vertical-align: middle;
+}
+.ui-spinner-input {
+ border: none;
+ background: none;
+ color: inherit;
+ padding: 0;
+ margin: .2em 0;
+ vertical-align: middle;
+ margin-left: .4em;
+ margin-right: 22px;
+}
+.ui-spinner-button {
+ width: 16px;
+ height: 50%;
+ font-size: .5em;
+ padding: 0;
+ margin: 0;
+ text-align: center;
+ position: absolute;
+ cursor: default;
+ display: block;
+ overflow: hidden;
+ right: 0;
+}
+/* more specificity required here to override default borders */
+.ui-spinner a.ui-spinner-button {
+ border-top: none;
+ border-bottom: none;
+ border-right: none;
+}
+/* vertically center icon */
+.ui-spinner .ui-icon {
+ position: absolute;
+ margin-top: -8px;
+ top: 50%;
+ left: 0;
+}
+.ui-spinner-up {
+ top: 0;
+}
+.ui-spinner-down {
+ bottom: 0;
+}
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+ /* need to fix icons sprite */
+ background-position: -65px -16px;
+}
+.ui-tabs {
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+ padding: .2em;
+}
+.ui-tabs .ui-tabs-nav {
+ margin: 0;
+ padding: .2em .2em 0;
+}
+.ui-tabs .ui-tabs-nav li {
+ list-style: none;
+ float: left;
+ position: relative;
+ top: 0;
+ margin: 1px .2em 0 0;
+ border-bottom-width: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
+ float: left;
+ padding: .5em 1em;
+ text-decoration: none;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+ margin-bottom: -1px;
+ padding-bottom: 1px;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
+ cursor: text;
+}
+.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
+ cursor: pointer;
+}
+.ui-tabs .ui-tabs-panel {
+ display: block;
+ border-width: 0;
+ padding: 1em 1.4em;
+ background: none;
+}
+.ui-tooltip {
+ padding: 8px;
+ position: absolute;
+ z-index: 9999;
+ max-width: 300px;
+ -webkit-box-shadow: 0 0 5px #aaa;
+ box-shadow: 0 0 5px #aaa;
+}
+body .ui-tooltip {
+ border-width: 2px;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Helvetica,Arial,sans-serif;
+ font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Helvetica,Arial,sans-serif;
+ font-size: 1em;
+}
+.ui-widget-content {
+ border: 1px solid #e0cfc2;
+ background: #f4f0ec url("images/ui-bg_inset-soft_100_f4f0ec_1x100.png") 50% bottom repeat-x;
+ color: #1e1b1d;
+}
+.ui-widget-content a {
+ color: #1e1b1d;
+}
+.ui-widget-header {
+ border: 1px solid #d49768;
+ background: #cb842e url("images/ui-bg_glass_25_cb842e_1x400.png") 50% 50% repeat-x;
+ color: #ffffff;
+ font-weight: bold;
+}
+.ui-widget-header a {
+ color: #ffffff;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default {
+ border: 1px solid #cdc3b7;
+ background: #ede4d4 url("images/ui-bg_glass_70_ede4d4_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #3f3731;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited {
+ color: #3f3731;
+ text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus {
+ border: 1px solid #f5ad66;
+ background: #f5f0e5 url("images/ui-bg_glass_100_f5f0e5_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #a46313;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited {
+ color: #a46313;
+ text-decoration: none;
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active {
+ border: 1px solid #e0cfc2;
+ background: #f4f0ec url("images/ui-bg_highlight-hard_100_f4f0ec_1x100.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #b85700;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #b85700;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #d9bb73;
+ background: #f5f5b5 url("images/ui-bg_highlight-hard_75_f5f5b5_1x100.png") 50% top repeat-x;
+ color: #060200;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #060200;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #f8893f;
+ background: #fee4bd url("images/ui-bg_highlight-hard_65_fee4bd_1x100.png") 50% top repeat-x;
+ color: #592003;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #592003;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #592003;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: .7;
+ filter:Alpha(Opacity=70); /* support: IE8 */
+ font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: .35;
+ filter:Alpha(Opacity=35); /* support: IE8 */
+ background-image: none;
+}
+.ui-state-disabled .ui-icon {
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+ background-image: url("images/ui-icons_c47a23_256x240.png");
+}
+.ui-widget-header .ui-icon {
+ background-image: url("images/ui-icons_ffffff_256x240.png");
+}
+.ui-state-default .ui-icon {
+ background-image: url("images/ui-icons_f08000_256x240.png");
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon {
+ background-image: url("images/ui-icons_f08000_256x240.png");
+}
+.ui-state-active .ui-icon {
+ background-image: url("images/ui-icons_f35f07_256x240.png");
+}
+.ui-state-highlight .ui-icon {
+ background-image: url("images/ui-icons_cb672b_256x240.png");
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+ background-image: url("images/ui-icons_ff7519_256x240.png");
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 6px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #aaaaaa;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+}
+.ui-widget-shadow {
+ margin: -8px 0 0 -8px;
+ padding: 8px;
+ background: #aaaaaa;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+ border-radius: 8px;
+}
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.js b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.js
new file mode 100644
index 0000000..d0b8229
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.js
@@ -0,0 +1,12749 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, spinner.js, tabs.js, tooltip.js
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+(function( factory ) {
+ if ( typeof define === "function" && define.amd ) {
+
+ // AMD. Register as an anonymous module.
+ define([ "jquery" ], factory );
+ } else {
+
+ // Browser globals
+ factory( jQuery );
+ }
+}(function( $ ) {
+/*!
+ * jQuery UI Core 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/ui-core/
+ */
+
+
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
+$.ui = $.ui || {};
+
+$.extend( $.ui, {
+ version: "1.11.4",
+
+ keyCode: {
+ BACKSPACE: 8,
+ COMMA: 188,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ LEFT: 37,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+});
+
+// plugins
+$.fn.extend({
+ scrollParent: function( includeHidden ) {
+ var position = this.css( "position" ),
+ excludeStaticParent = position === "absolute",
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
+ scrollParent = this.parents().filter( function() {
+ var parent = $( this );
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+ return false;
+ }
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+ }).eq( 0 );
+
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
+ },
+
+ uniqueId: (function() {
+ var uuid = 0;
+
+ return function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + ( ++uuid );
+ }
+ });
+ };
+ })(),
+
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( /^ui-id-\d+$/.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
+ }
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+ var map, mapName, img,
+ nodeName = element.nodeName.toLowerCase();
+ if ( "area" === nodeName ) {
+ map = element.parentNode;
+ mapName = map.name;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
+ return !!img && visible( img );
+ }
+ return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
+ !element.disabled :
+ "a" === nodeName ?
+ element.href || isTabIndexNotNaN :
+ isTabIndexNotNaN) &&
+ // the element and all of its ancestors must be visible
+ visible( element );
+}
+
+function visible( element ) {
+ return $.expr.filters.visible( element ) &&
+ !$( element ).parents().addBack().filter(function() {
+ return $.css( this, "visibility" ) === "hidden";
+ }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo(function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ }) :
+ // support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
+
+ focusable: function( element ) {
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+ },
+
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ isTabIndexNaN = isNaN( tabIndex );
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+ }
+});
+
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
+}
+
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.fn.extend({
+ focus: (function( orig ) {
+ return function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.focus ),
+
+ disableSelection: (function() {
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
+ "selectstart" :
+ "mousedown";
+
+ return function() {
+ return this.bind( eventType + ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ };
+ })(),
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ },
+
+ zIndex: function( zIndex ) {
+ if ( zIndex !== undefined ) {
+ return this.css( "zIndex", zIndex );
+ }
+
+ if ( this.length ) {
+ var elem = $( this[ 0 ] ), position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+ }
+
+ return 0;
+ }
+});
+
+// $.ui.plugin is deprecated. Use $.widget() extensions instead.
+$.ui.plugin = {
+ add: function( module, option, set ) {
+ var i,
+ proto = $.ui[ module ].prototype;
+ for ( i in set ) {
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
+ }
+ },
+ call: function( instance, name, args, allowDisconnected ) {
+ var i,
+ set = instance.plugins[ name ];
+
+ if ( !set ) {
+ return;
+ }
+
+ if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
+ return;
+ }
+
+ for ( i = 0; i < set.length; i++ ) {
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
+ set[ i ][ 1 ].apply( instance.element, args );
+ }
+ }
+ }
+};
+
+
+/*!
+ * jQuery UI Widget 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/jQuery.widget/
+ */
+
+
+var widget_uuid = 0,
+ widget_slice = Array.prototype.slice;
+
+$.cleanData = (function( orig ) {
+ return function( elems ) {
+ var events, elem, i;
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
+ try {
+
+ // Only trigger remove when necessary to save time
+ events = $._data( elem, "events" );
+ if ( events && events.remove ) {
+ $( elem ).triggerHandler( "remove" );
+ }
+
+ // http://bugs.jquery.com/ticket/8235
+ } catch ( e ) {}
+ }
+ orig( elems );
+ };
+})( $.cleanData );
+
+$.widget = function( name, base, prototype ) {
+ var fullName, existingConstructor, constructor, basePrototype,
+ // proxiedPrototype allows the provided prototype to remain unmodified
+ // so that it can be used as a mixin for multiple widgets (#8876)
+ proxiedPrototype = {},
+ namespace = name.split( "." )[ 0 ];
+
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ // create selector for plugin
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
+
+ // allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+ // extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+ // copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+ // track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ });
+
+ basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( !$.isFunction( value ) ) {
+ proxiedPrototype[ prop ] = value;
+ return;
+ }
+ proxiedPrototype[ prop ] = (function() {
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
+ return function() {
+ var __super = this._super,
+ __superApply = this._superApply,
+ returnValue;
+
+ this._super = _super;
+ this._superApply = _superApply;
+
+ returnValue = value.apply( this, arguments );
+
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ })();
+ });
+ constructor.prototype = $.widget.extend( basePrototype, {
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
+ }, proxiedPrototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ widgetFullName: fullName
+ });
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+ });
+ // remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+
+ return constructor;
+};
+
+$.widget.extend = function( target ) {
+ var input = widget_slice.call( arguments, 1 ),
+ inputIndex = 0,
+ inputLength = input.length,
+ key,
+ value;
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ // Clone objects
+ if ( $.isPlainObject( value ) ) {
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
+ $.widget.extend( {}, target[ key ], value ) :
+ // Don't extend strings, arrays, etc. with objects
+ $.widget.extend( {}, value );
+ // Copy everything else by reference
+ } else {
+ target[ key ] = value;
+ }
+ }
+ }
+ }
+ return target;
+};
+
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName || name;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = widget_slice.call( arguments, 1 ),
+ returnValue = this;
+
+ if ( isMethodCall ) {
+ this.each(function() {
+ var methodValue,
+ instance = $.data( this, fullName );
+ if ( options === "instance" ) {
+ returnValue = instance;
+ return false;
+ }
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+ }
+ methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ });
+ } else {
+
+ // Allow multiple hashes to be passed on init
+ if ( args.length ) {
+ options = $.widget.extend.apply( null, [ options ].concat(args) );
+ }
+
+ this.each(function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} );
+ if ( instance._init ) {
+ instance._init();
+ }
+ } else {
+ $.data( this, fullName, new object( options, this ) );
+ }
+ });
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( /* options, element */ ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+ options: {
+ disabled: false,
+
+ // callbacks
+ create: null
+ },
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = widget_uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
+
+ if ( element !== this ) {
+ $.data( element, this.widgetFullName, this );
+ this._on( true, this.element, {
+ remove: function( event ) {
+ if ( event.target === element ) {
+ this.destroy();
+ }
+ }
+ });
+ this.document = $( element.style ?
+ // element within the document
+ element.ownerDocument :
+ // element is window or document
+ element.document || element );
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+ }
+
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ this._create();
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+ _getCreateOptions: $.noop,
+ _getCreateEventData: $.noop,
+ _create: $.noop,
+ _init: $.noop,
+
+ destroy: function() {
+ this._destroy();
+ // we can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .unbind( this.eventNamespace )
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
+ this.widget()
+ .unbind( this.eventNamespace )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetFullName + "-disabled " +
+ "ui-state-disabled" );
+
+ // clean up events and states
+ this.bindings.unbind( this.eventNamespace );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ },
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key,
+ parts,
+ curOption,
+ i;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( arguments.length === 1 ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( arguments.length === 1 ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
+ }
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var key;
+
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
+
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this.widget()
+ .toggleClass( this.widgetFullName + "-disabled", !!value );
+
+ // If the widget is becoming disabled, then nothing is interactive
+ if ( value ) {
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
+ }
+
+ return this;
+ },
+
+ enable: function() {
+ return this._setOptions({ disabled: false });
+ },
+ disable: function() {
+ return this._setOptions({ disabled: true });
+ },
+
+ _on: function( suppressDisabledCheck, element, handlers ) {
+ var delegateElement,
+ instance = this;
+
+ // no suppressDisabledCheck flag, shuffle arguments
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
+ handlers = element;
+ element = suppressDisabledCheck;
+ suppressDisabledCheck = false;
+ }
+
+ // no element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ delegateElement = this.widget();
+ } else {
+ element = delegateElement = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+ // allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( !suppressDisabledCheck &&
+ ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
+ return;
+ }
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+
+ // copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
+ eventName = match[1] + instance.eventNamespace,
+ selector = match[2];
+ if ( selector ) {
+ delegateElement.delegate( selector, eventName, handlerProxy );
+ } else {
+ element.bind( eventName, handlerProxy );
+ }
+ });
+ },
+
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
+ this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+
+ // Clear the stack to avoid memory leaks (#10056)
+ this.bindings = $( this.bindings.not( element ).get() );
+ this.focusable = $( this.focusable.not( element ).get() );
+ this.hoverable = $( this.hoverable.not( element ).get() );
+ },
+
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
+ }
+ });
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
+ }
+ });
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig,
+ callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ // the original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+ var hasOptions,
+ effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue(function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ });
+ }
+ };
+});
+
+var widget = $.widget;
+
+
+/*!
+ * jQuery UI Mouse 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/mouse/
+ */
+
+
+var mouseHandled = false;
+$( document ).mouseup( function() {
+ mouseHandled = false;
+});
+
+var mouse = $.widget("ui.mouse", {
+ version: "1.11.4",
+ options: {
+ cancel: "input,textarea,button,select,option",
+ distance: 1,
+ delay: 0
+ },
+ _mouseInit: function() {
+ var that = this;
+
+ this.element
+ .bind("mousedown." + this.widgetName, function(event) {
+ return that._mouseDown(event);
+ })
+ .bind("click." + this.widgetName, function(event) {
+ if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, that.widgetName + ".preventClickEvent");
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind("." + this.widgetName);
+ if ( this._mouseMoveDelegate ) {
+ this.document
+ .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
+ .unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
+ }
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ if ( mouseHandled ) {
+ return;
+ }
+
+ this._mouseMoved = false;
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var that = this,
+ btnIsLeft = (event.which === 1),
+ // event.target.nodeName works around a bug in IE 8 with
+ // disabled inputs (#7620)
+ elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ that.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // Click event may never have fired (Gecko & Opera)
+ if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, this.widgetName + ".preventClickEvent");
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return that._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return that._mouseUp(event);
+ };
+
+ this.document
+ .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ event.preventDefault();
+
+ mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // Only check for mouseups outside the document if you've moved inside the document
+ // at least once. This prevents the firing of mouseup in the case of IE<9, which will
+ // fire a mousemove event if content is placed under the cursor. See #7778
+ // Support: IE <9
+ if ( this._mouseMoved ) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
+ return this._mouseUp(event);
+
+ // Iframe mouseup check - mouseup occurred in another document
+ } else if ( !event.which ) {
+ return this._mouseUp( event );
+ }
+ }
+
+ if ( event.which || event.button ) {
+ this._mouseMoved = true;
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ this.document
+ .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+
+ if (event.target === this._mouseDownEvent.target) {
+ $.data(event.target, this.widgetName + ".preventClickEvent", true);
+ }
+
+ this._mouseStop(event);
+ }
+
+ mouseHandled = false;
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(/* event */) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(/* event */) {},
+ _mouseDrag: function(/* event */) {},
+ _mouseStop: function(/* event */) {},
+ _mouseCapture: function(/* event */) { return true; }
+});
+
+
+/*!
+ * jQuery UI Position 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/position/
+ */
+
+(function() {
+
+$.ui = $.ui || {};
+
+var cachedScrollbarWidth, supportsOffsetFractions,
+ max = Math.max,
+ abs = Math.abs,
+ round = Math.round,
+ rhorizontal = /left|center|right/,
+ rvertical = /top|center|bottom/,
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
+ rposition = /^\w+/,
+ rpercent = /%$/,
+ _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+ return [
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+ ];
+}
+
+function parseCss( element, property ) {
+ return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+ var raw = elem[0];
+ if ( raw.nodeType === 9 ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: 0, left: 0 }
+ };
+ }
+ if ( $.isWindow( raw ) ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+ };
+ }
+ if ( raw.preventDefault ) {
+ return {
+ width: 0,
+ height: 0,
+ offset: { top: raw.pageY, left: raw.pageX }
+ };
+ }
+ return {
+ width: elem.outerWidth(),
+ height: elem.outerHeight(),
+ offset: elem.offset()
+ };
+}
+
+$.position = {
+ scrollbarWidth: function() {
+ if ( cachedScrollbarWidth !== undefined ) {
+ return cachedScrollbarWidth;
+ }
+ var w1, w2,
+ div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
+ innerDiv = div.children()[0];
+
+ $( "body" ).append( div );
+ w1 = innerDiv.offsetWidth;
+ div.css( "overflow", "scroll" );
+
+ w2 = innerDiv.offsetWidth;
+
+ if ( w1 === w2 ) {
+ w2 = div[0].clientWidth;
+ }
+
+ div.remove();
+
+ return (cachedScrollbarWidth = w1 - w2);
+ },
+ getScrollInfo: function( within ) {
+ var overflowX = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-x" ),
+ overflowY = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-y" ),
+ hasOverflowX = overflowX === "scroll" ||
+ ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
+ hasOverflowY = overflowY === "scroll" ||
+ ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
+ return {
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
+ };
+ },
+ getWithinInfo: function( element ) {
+ var withinElement = $( element || window ),
+ isWindow = $.isWindow( withinElement[0] ),
+ isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
+ return {
+ element: withinElement,
+ isWindow: isWindow,
+ isDocument: isDocument,
+ offset: withinElement.offset() || { left: 0, top: 0 },
+ scrollLeft: withinElement.scrollLeft(),
+ scrollTop: withinElement.scrollTop(),
+
+ // support: jQuery 1.6.x
+ // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
+ width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
+ height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
+ };
+ }
+};
+
+$.fn.position = function( options ) {
+ if ( !options || !options.of ) {
+ return _position.apply( this, arguments );
+ }
+
+ // make a copy, we don't want to modify arguments
+ options = $.extend( {}, options );
+
+ var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+ target = $( options.of ),
+ within = $.position.getWithinInfo( options.within ),
+ scrollInfo = $.position.getScrollInfo( within ),
+ collision = ( options.collision || "flip" ).split( " " ),
+ offsets = {};
+
+ dimensions = getDimensions( target );
+ if ( target[0].preventDefault ) {
+ // force left top to allow flipping
+ options.at = "left top";
+ }
+ targetWidth = dimensions.width;
+ targetHeight = dimensions.height;
+ targetOffset = dimensions.offset;
+ // clone to reuse original targetOffset later
+ basePosition = $.extend( {}, targetOffset );
+
+ // force my and at to have valid horizontal and vertical positions
+ // if a value is missing or invalid, it will be converted to center
+ $.each( [ "my", "at" ], function() {
+ var pos = ( options[ this ] || "" ).split( " " ),
+ horizontalOffset,
+ verticalOffset;
+
+ if ( pos.length === 1) {
+ pos = rhorizontal.test( pos[ 0 ] ) ?
+ pos.concat( [ "center" ] ) :
+ rvertical.test( pos[ 0 ] ) ?
+ [ "center" ].concat( pos ) :
+ [ "center", "center" ];
+ }
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+ // calculate offsets
+ horizontalOffset = roffset.exec( pos[ 0 ] );
+ verticalOffset = roffset.exec( pos[ 1 ] );
+ offsets[ this ] = [
+ horizontalOffset ? horizontalOffset[ 0 ] : 0,
+ verticalOffset ? verticalOffset[ 0 ] : 0
+ ];
+
+ // reduce to just the positions without the offsets
+ options[ this ] = [
+ rposition.exec( pos[ 0 ] )[ 0 ],
+ rposition.exec( pos[ 1 ] )[ 0 ]
+ ];
+ });
+
+ // normalize collision option
+ if ( collision.length === 1 ) {
+ collision[ 1 ] = collision[ 0 ];
+ }
+
+ if ( options.at[ 0 ] === "right" ) {
+ basePosition.left += targetWidth;
+ } else if ( options.at[ 0 ] === "center" ) {
+ basePosition.left += targetWidth / 2;
+ }
+
+ if ( options.at[ 1 ] === "bottom" ) {
+ basePosition.top += targetHeight;
+ } else if ( options.at[ 1 ] === "center" ) {
+ basePosition.top += targetHeight / 2;
+ }
+
+ atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+ basePosition.left += atOffset[ 0 ];
+ basePosition.top += atOffset[ 1 ];
+
+ return this.each(function() {
+ var collisionPosition, using,
+ elem = $( this ),
+ elemWidth = elem.outerWidth(),
+ elemHeight = elem.outerHeight(),
+ marginLeft = parseCss( this, "marginLeft" ),
+ marginTop = parseCss( this, "marginTop" ),
+ collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
+ collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
+ position = $.extend( {}, basePosition ),
+ myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+ if ( options.my[ 0 ] === "right" ) {
+ position.left -= elemWidth;
+ } else if ( options.my[ 0 ] === "center" ) {
+ position.left -= elemWidth / 2;
+ }
+
+ if ( options.my[ 1 ] === "bottom" ) {
+ position.top -= elemHeight;
+ } else if ( options.my[ 1 ] === "center" ) {
+ position.top -= elemHeight / 2;
+ }
+
+ position.left += myOffset[ 0 ];
+ position.top += myOffset[ 1 ];
+
+ // if the browser doesn't support fractions, then round for consistent results
+ if ( !supportsOffsetFractions ) {
+ position.left = round( position.left );
+ position.top = round( position.top );
+ }
+
+ collisionPosition = {
+ marginLeft: marginLeft,
+ marginTop: marginTop
+ };
+
+ $.each( [ "left", "top" ], function( i, dir ) {
+ if ( $.ui.position[ collision[ i ] ] ) {
+ $.ui.position[ collision[ i ] ][ dir ]( position, {
+ targetWidth: targetWidth,
+ targetHeight: targetHeight,
+ elemWidth: elemWidth,
+ elemHeight: elemHeight,
+ collisionPosition: collisionPosition,
+ collisionWidth: collisionWidth,
+ collisionHeight: collisionHeight,
+ offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+ my: options.my,
+ at: options.at,
+ within: within,
+ elem: elem
+ });
+ }
+ });
+
+ if ( options.using ) {
+ // adds feedback as second argument to using callback, if present
+ using = function( props ) {
+ var left = targetOffset.left - position.left,
+ right = left + targetWidth - elemWidth,
+ top = targetOffset.top - position.top,
+ bottom = top + targetHeight - elemHeight,
+ feedback = {
+ target: {
+ element: target,
+ left: targetOffset.left,
+ top: targetOffset.top,
+ width: targetWidth,
+ height: targetHeight
+ },
+ element: {
+ element: elem,
+ left: position.left,
+ top: position.top,
+ width: elemWidth,
+ height: elemHeight
+ },
+ horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+ vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+ };
+ if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+ feedback.horizontal = "center";
+ }
+ if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+ feedback.vertical = "middle";
+ }
+ if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+ feedback.important = "horizontal";
+ } else {
+ feedback.important = "vertical";
+ }
+ options.using.call( this, props, feedback );
+ };
+ }
+
+ elem.offset( $.extend( position, { using: using } ) );
+ });
+};
+
+$.ui.position = {
+ fit: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+ outerWidth = within.width,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = withinOffset - collisionPosLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+ newOverRight;
+
+ // element is wider than within
+ if ( data.collisionWidth > outerWidth ) {
+ // element is initially over the left side of within
+ if ( overLeft > 0 && overRight <= 0 ) {
+ newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
+ position.left += overLeft - newOverRight;
+ // element is initially over right side of within
+ } else if ( overRight > 0 && overLeft <= 0 ) {
+ position.left = withinOffset;
+ // element is initially over both left and right sides of within
+ } else {
+ if ( overLeft > overRight ) {
+ position.left = withinOffset + outerWidth - data.collisionWidth;
+ } else {
+ position.left = withinOffset;
+ }
+ }
+ // too far left -> align with left edge
+ } else if ( overLeft > 0 ) {
+ position.left += overLeft;
+ // too far right -> align with right edge
+ } else if ( overRight > 0 ) {
+ position.left -= overRight;
+ // adjust based on position and margin
+ } else {
+ position.left = max( position.left - collisionPosLeft, position.left );
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+ outerHeight = data.within.height,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = withinOffset - collisionPosTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+ newOverBottom;
+
+ // element is taller than within
+ if ( data.collisionHeight > outerHeight ) {
+ // element is initially over the top of within
+ if ( overTop > 0 && overBottom <= 0 ) {
+ newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
+ position.top += overTop - newOverBottom;
+ // element is initially over bottom of within
+ } else if ( overBottom > 0 && overTop <= 0 ) {
+ position.top = withinOffset;
+ // element is initially over both top and bottom of within
+ } else {
+ if ( overTop > overBottom ) {
+ position.top = withinOffset + outerHeight - data.collisionHeight;
+ } else {
+ position.top = withinOffset;
+ }
+ }
+ // too far up -> align with top
+ } else if ( overTop > 0 ) {
+ position.top += overTop;
+ // too far down -> align with bottom edge
+ } else if ( overBottom > 0 ) {
+ position.top -= overBottom;
+ // adjust based on position and margin
+ } else {
+ position.top = max( position.top - collisionPosTop, position.top );
+ }
+ }
+ },
+ flip: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.left + within.scrollLeft,
+ outerWidth = within.width,
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = collisionPosLeft - offsetLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+ myOffset = data.my[ 0 ] === "left" ?
+ -data.elemWidth :
+ data.my[ 0 ] === "right" ?
+ data.elemWidth :
+ 0,
+ atOffset = data.at[ 0 ] === "left" ?
+ data.targetWidth :
+ data.at[ 0 ] === "right" ?
+ -data.targetWidth :
+ 0,
+ offset = -2 * data.offset[ 0 ],
+ newOverRight,
+ newOverLeft;
+
+ if ( overLeft < 0 ) {
+ newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
+ if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ } else if ( overRight > 0 ) {
+ newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
+ if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.top + within.scrollTop,
+ outerHeight = within.height,
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = collisionPosTop - offsetTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+ top = data.my[ 1 ] === "top",
+ myOffset = top ?
+ -data.elemHeight :
+ data.my[ 1 ] === "bottom" ?
+ data.elemHeight :
+ 0,
+ atOffset = data.at[ 1 ] === "top" ?
+ data.targetHeight :
+ data.at[ 1 ] === "bottom" ?
+ -data.targetHeight :
+ 0,
+ offset = -2 * data.offset[ 1 ],
+ newOverTop,
+ newOverBottom;
+ if ( overTop < 0 ) {
+ newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
+ if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ } else if ( overBottom > 0 ) {
+ newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
+ if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ }
+ }
+ },
+ flipfit: {
+ left: function() {
+ $.ui.position.flip.left.apply( this, arguments );
+ $.ui.position.fit.left.apply( this, arguments );
+ },
+ top: function() {
+ $.ui.position.flip.top.apply( this, arguments );
+ $.ui.position.fit.top.apply( this, arguments );
+ }
+ }
+};
+
+// fraction support test
+(function() {
+ var testElement, testElementParent, testElementStyle, offsetLeft, i,
+ body = document.getElementsByTagName( "body" )[ 0 ],
+ div = document.createElement( "div" );
+
+ //Create a "fake body" for testing based on method used in jQuery.support
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ $.extend( testElementStyle, {
+ position: "absolute",
+ left: "-1000px",
+ top: "-1000px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || document.documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ div.style.cssText = "position: absolute; left: 10.7432222px;";
+
+ offsetLeft = $( div ).offset().left;
+ supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
+
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+})();
+
+})();
+
+var position = $.ui.position;
+
+
+/*!
+ * jQuery UI Draggable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/draggable/
+ */
+
+
+$.widget("ui.draggable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "drag",
+ options: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false,
+
+ // callbacks
+ drag: null,
+ start: null,
+ stop: null
+ },
+ _create: function() {
+
+ if ( this.options.helper === "original" ) {
+ this._setPositionRelative();
+ }
+ if (this.options.addClasses){
+ this.element.addClass("ui-draggable");
+ }
+ if (this.options.disabled){
+ this.element.addClass("ui-draggable-disabled");
+ }
+ this._setHandleClassName();
+
+ this._mouseInit();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "handle" ) {
+ this._removeHandleClassName();
+ this._setHandleClassName();
+ }
+ },
+
+ _destroy: function() {
+ if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
+ this.destroyOnClear = true;
+ return;
+ }
+ this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
+ this._removeHandleClassName();
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+ var o = this.options;
+
+ this._blurActiveElement( event );
+
+ // among others, prevent a drag on a resizable-handle
+ if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
+ return false;
+ }
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle) {
+ return false;
+ }
+
+ this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
+
+ return true;
+
+ },
+
+ _blockFrames: function( selector ) {
+ this.iframeBlocks = this.document.find( selector ).map(function() {
+ var iframe = $( this );
+
+ return $( "<div>" )
+ .css( "position", "absolute" )
+ .appendTo( iframe.parent() )
+ .outerWidth( iframe.outerWidth() )
+ .outerHeight( iframe.outerHeight() )
+ .offset( iframe.offset() )[ 0 ];
+ });
+ },
+
+ _unblockFrames: function() {
+ if ( this.iframeBlocks ) {
+ this.iframeBlocks.remove();
+ delete this.iframeBlocks;
+ }
+ },
+
+ _blurActiveElement: function( event ) {
+ var document = this.document[ 0 ];
+
+ // Only need to blur if the event occurred on the draggable itself, see #10527
+ if ( !this.handleElement.is( event.target ) ) {
+ return;
+ }
+
+ // support: IE9
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+
+ // Support: IE9, IE10
+ // If the <body> is blurred, IE will switch windows, see #9520
+ if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
+
+ // Blur any element that currently has focus, see #4261
+ $( document.activeElement ).blur();
+ }
+ } catch ( error ) {}
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ this.helper.addClass("ui-draggable-dragging");
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if ($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css( "position" );
+ this.scrollParent = this.helper.scrollParent( true );
+ this.offsetParent = this.helper.offsetParent();
+ this.hasFixedAncestor = this.helper.parents().filter(function() {
+ return $( this ).css( "position" ) === "fixed";
+ }).length > 0;
+
+ //The element's absolute position on the page minus margins
+ this.positionAbs = this.element.offset();
+ this._refreshOffsets( event );
+
+ //Generate the original position
+ this.originalPosition = this.position = this._generatePosition( event, false );
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Set a containment if given in the options
+ this._setContainment();
+
+ //Trigger event + callbacks
+ if (this._trigger("start", event) === false) {
+ this._clear();
+ return false;
+ }
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+ // Reset helper's right/bottom css if they're set and set explicit width/height instead
+ // as this prevents resizing of elements with right/bottom set (see #7772)
+ this._normalizeRightBottom();
+
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStart(this, event);
+ }
+
+ return true;
+ },
+
+ _refreshOffsets: function( event ) {
+ this.offset = {
+ top: this.positionAbs.top - this.margins.top,
+ left: this.positionAbs.left - this.margins.left,
+ scroll: false,
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset()
+ };
+
+ this.offset.click = {
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ };
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+ // reset any necessary cached properties (see #5009)
+ if ( this.hasFixedAncestor ) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ //Compute the helpers position
+ this.position = this._generatePosition( event, true );
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ if (this._trigger("drag", event, ui) === false) {
+ this._mouseUp({});
+ return false;
+ }
+ this.position = ui.position;
+ }
+
+ this.helper[ 0 ].style.left = this.position.left + "px";
+ this.helper[ 0 ].style.top = this.position.top + "px";
+
+ if ($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var that = this,
+ dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ dropped = $.ui.ddmanager.drop(this, event);
+ }
+
+ //if a drop comes from outside (a sortable)
+ if (this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ if (that._trigger("stop", event) !== false) {
+ that._clear();
+ }
+ });
+ } else {
+ if (this._trigger("stop", event) !== false) {
+ this._clear();
+ }
+ }
+
+ return false;
+ },
+
+ _mouseUp: function( event ) {
+ this._unblockFrames();
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStop(this, event);
+ }
+
+ // Only need to focus if the event occurred on the draggable itself, see #10527
+ if ( this.handleElement.is( event.target ) ) {
+ // The interaction is over; whether or not the click resulted in a drag, focus the element
+ this.element.focus();
+ }
+
+ return $.ui.mouse.prototype._mouseUp.call(this, event);
+ },
+
+ cancel: function() {
+
+ if (this.helper.is(".ui-draggable-dragging")) {
+ this._mouseUp({});
+ } else {
+ this._clear();
+ }
+
+ return this;
+
+ },
+
+ _getHandle: function(event) {
+ return this.options.handle ?
+ !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
+ true;
+ },
+
+ _setHandleClassName: function() {
+ this.handleElement = this.options.handle ?
+ this.element.find( this.options.handle ) : this.element;
+ this.handleElement.addClass( "ui-draggable-handle" );
+ },
+
+ _removeHandleClassName: function() {
+ this.handleElement.removeClass( "ui-draggable-handle" );
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helperIsFunction = $.isFunction( o.helper ),
+ helper = helperIsFunction ?
+ $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
+ ( o.helper === "clone" ?
+ this.element.clone().removeAttr( "id" ) :
+ this.element );
+
+ if (!helper.parents("body").length) {
+ helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
+ }
+
+ // http://bugs.jqueryui.com/ticket/9446
+ // a helper function can return the original element
+ // which wouldn't have been set to relative in _create
+ if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
+ this._setPositionRelative();
+ }
+
+ if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
+ helper.css("position", "absolute");
+ }
+
+ return helper;
+
+ },
+
+ _setPositionRelative: function() {
+ if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
+ this.element[ 0 ].style.position = "relative";
+ }
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = { left: +obj[0], top: +obj[1] || 0 };
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _isRootNode: function( element ) {
+ return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ var po = this.offsetParent.offset(),
+ document = this.document[ 0 ];
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+ if ( this.cssPosition !== "relative" ) {
+ return { top: 0, left: 0 };
+ }
+
+ var p = this.element.position(),
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
+
+ return {
+ top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
+ left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
+ };
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"), 10) || 0),
+ top: (parseInt(this.element.css("marginTop"), 10) || 0),
+ right: (parseInt(this.element.css("marginRight"), 10) || 0),
+ bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var isUserScrollable, c, ce,
+ o = this.options,
+ document = this.document[ 0 ];
+
+ this.relativeContainer = null;
+
+ if ( !o.containment ) {
+ this.containment = null;
+ return;
+ }
+
+ if ( o.containment === "window" ) {
+ this.containment = [
+ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+ $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
+ $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
+ $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment === "document") {
+ this.containment = [
+ 0,
+ 0,
+ $( document ).width() - this.helperProportions.width - this.margins.left,
+ ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment.constructor === Array ) {
+ this.containment = o.containment;
+ return;
+ }
+
+ if ( o.containment === "parent" ) {
+ o.containment = this.helper[ 0 ].parentNode;
+ }
+
+ c = $( o.containment );
+ ce = c[ 0 ];
+
+ if ( !ce ) {
+ return;
+ }
+
+ isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
+
+ this.containment = [
+ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
+ ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
+ ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
+ ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
+ ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
+ this.helperProportions.width -
+ this.margins.left -
+ this.margins.right,
+ ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
+ ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
+ ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
+ this.helperProportions.height -
+ this.margins.top -
+ this.margins.bottom
+ ];
+ this.relativeContainer = c;
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if (!pos) {
+ pos = this.position;
+ }
+
+ var mod = d === "absolute" ? 1 : -1,
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function( event, constrainPosition ) {
+
+ var containment, co, top, left,
+ o = this.options,
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
+ pageX = event.pageX,
+ pageY = event.pageY;
+
+ // Cache the scroll
+ if ( !scrollIsRootNode || !this.offset.scroll ) {
+ this.offset.scroll = {
+ top: this.scrollParent.scrollTop(),
+ left: this.scrollParent.scrollLeft()
+ };
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ // If we are not dragging yet, we won't check for options
+ if ( constrainPosition ) {
+ if ( this.containment ) {
+ if ( this.relativeContainer ){
+ co = this.relativeContainer.offset();
+ containment = [
+ this.containment[ 0 ] + co.left,
+ this.containment[ 1 ] + co.top,
+ this.containment[ 2 ] + co.left,
+ this.containment[ 3 ] + co.top
+ ];
+ } else {
+ containment = this.containment;
+ }
+
+ if (event.pageX - this.offset.click.left < containment[0]) {
+ pageX = containment[0] + this.offset.click.left;
+ }
+ if (event.pageY - this.offset.click.top < containment[1]) {
+ pageY = containment[1] + this.offset.click.top;
+ }
+ if (event.pageX - this.offset.click.left > containment[2]) {
+ pageX = containment[2] + this.offset.click.left;
+ }
+ if (event.pageY - this.offset.click.top > containment[3]) {
+ pageY = containment[3] + this.offset.click.top;
+ }
+ }
+
+ if (o.grid) {
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+ top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
+ pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
+ pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ if ( o.axis === "y" ) {
+ pageX = this.originalPageX;
+ }
+
+ if ( o.axis === "x" ) {
+ pageY = this.originalPageY;
+ }
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ if ( this.destroyOnClear ) {
+ this.destroy();
+ }
+ },
+
+ _normalizeRightBottom: function() {
+ if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
+ this.helper.width( this.helper.width() );
+ this.helper.css( "right", "auto" );
+ }
+ if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
+ this.helper.height( this.helper.height() );
+ this.helper.css( "bottom", "auto" );
+ }
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function( type, event, ui ) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call( this, type, [ event, ui, this ], true );
+
+ // Absolute position and offset (see #6884 ) have to be recalculated after plugins
+ if ( /^(drag|start|stop)/.test( type ) ) {
+ this.positionAbs = this._convertPositionTo( "absolute" );
+ ui.offset = this.positionAbs;
+ }
+ return $.Widget.prototype._trigger.call( this, type, event, ui );
+ },
+
+ plugins: {},
+
+ _uiHash: function() {
+ return {
+ helper: this.helper,
+ position: this.position,
+ originalPosition: this.originalPosition,
+ offset: this.positionAbs
+ };
+ }
+
+});
+
+$.ui.plugin.add( "draggable", "connectToSortable", {
+ start: function( event, ui, draggable ) {
+ var uiSortable = $.extend( {}, ui, {
+ item: draggable.element
+ });
+
+ draggable.sortables = [];
+ $( draggable.options.connectToSortable ).each(function() {
+ var sortable = $( this ).sortable( "instance" );
+
+ if ( sortable && !sortable.options.disabled ) {
+ draggable.sortables.push( sortable );
+
+ // refreshPositions is called at drag start to refresh the containerCache
+ // which is used in drag. This ensures it's initialized and synchronized
+ // with any changes that might have happened on the page since initialization.
+ sortable.refreshPositions();
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+ },
+ stop: function( event, ui, draggable ) {
+ var uiSortable = $.extend( {}, ui, {
+ item: draggable.element
+ });
+
+ draggable.cancelHelperRemoval = false;
+
+ $.each( draggable.sortables, function() {
+ var sortable = this;
+
+ if ( sortable.isOver ) {
+ sortable.isOver = 0;
+
+ // Allow this sortable to handle removing the helper
+ draggable.cancelHelperRemoval = true;
+ sortable.cancelHelperRemoval = false;
+
+ // Use _storedCSS To restore properties in the sortable,
+ // as this also handles revert (#9675) since the draggable
+ // may have modified them in unexpected ways (#8809)
+ sortable._storedCSS = {
+ position: sortable.placeholder.css( "position" ),
+ top: sortable.placeholder.css( "top" ),
+ left: sortable.placeholder.css( "left" )
+ };
+
+ sortable._mouseStop(event);
+
+ // Once drag has ended, the sortable should return to using
+ // its original helper, not the shared helper from draggable
+ sortable.options.helper = sortable.options._helper;
+ } else {
+ // Prevent this Sortable from removing the helper.
+ // However, don't set the draggable to remove the helper
+ // either as another connected Sortable may yet handle the removal.
+ sortable.cancelHelperRemoval = true;
+
+ sortable._trigger( "deactivate", event, uiSortable );
+ }
+ });
+ },
+ drag: function( event, ui, draggable ) {
+ $.each( draggable.sortables, function() {
+ var innermostIntersecting = false,
+ sortable = this;
+
+ // Copy over variables that sortable's _intersectsWith uses
+ sortable.positionAbs = draggable.positionAbs;
+ sortable.helperProportions = draggable.helperProportions;
+ sortable.offset.click = draggable.offset.click;
+
+ if ( sortable._intersectsWith( sortable.containerCache ) ) {
+ innermostIntersecting = true;
+
+ $.each( draggable.sortables, function() {
+ // Copy over variables that sortable's _intersectsWith uses
+ this.positionAbs = draggable.positionAbs;
+ this.helperProportions = draggable.helperProportions;
+ this.offset.click = draggable.offset.click;
+
+ if ( this !== sortable &&
+ this._intersectsWith( this.containerCache ) &&
+ $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
+ innermostIntersecting = false;
+ }
+
+ return innermostIntersecting;
+ });
+ }
+
+ if ( innermostIntersecting ) {
+ // If it intersects, we use a little isOver variable and set it once,
+ // so that the move-in stuff gets fired only once.
+ if ( !sortable.isOver ) {
+ sortable.isOver = 1;
+
+ // Store draggable's parent in case we need to reappend to it later.
+ draggable._parent = ui.helper.parent();
+
+ sortable.currentItem = ui.helper
+ .appendTo( sortable.element )
+ .data( "ui-sortable-item", true );
+
+ // Store helper option to later restore it
+ sortable.options._helper = sortable.options.helper;
+
+ sortable.options.helper = function() {
+ return ui.helper[ 0 ];
+ };
+
+ // Fire the start events of the sortable with our passed browser event,
+ // and our own helper (so it doesn't create a new one)
+ event.target = sortable.currentItem[ 0 ];
+ sortable._mouseCapture( event, true );
+ sortable._mouseStart( event, true, true );
+
+ // Because the browser event is way off the new appended portlet,
+ // modify necessary variables to reflect the changes
+ sortable.offset.click.top = draggable.offset.click.top;
+ sortable.offset.click.left = draggable.offset.click.left;
+ sortable.offset.parent.left -= draggable.offset.parent.left -
+ sortable.offset.parent.left;
+ sortable.offset.parent.top -= draggable.offset.parent.top -
+ sortable.offset.parent.top;
+
+ draggable._trigger( "toSortable", event );
+
+ // Inform draggable that the helper is in a valid drop zone,
+ // used solely in the revert option to handle "valid/invalid".
+ draggable.dropped = sortable.element;
+
+ // Need to refreshPositions of all sortables in the case that
+ // adding to one sortable changes the location of the other sortables (#9675)
+ $.each( draggable.sortables, function() {
+ this.refreshPositions();
+ });
+
+ // hack so receive/update callbacks work (mostly)
+ draggable.currentItem = draggable.element;
+ sortable.fromOutside = draggable;
+ }
+
+ if ( sortable.currentItem ) {
+ sortable._mouseDrag( event );
+ // Copy the sortable's position because the draggable's can potentially reflect
+ // a relative position, while sortable is always absolute, which the dragged
+ // element has now become. (#8809)
+ ui.position = sortable.position;
+ }
+ } else {
+ // If it doesn't intersect with the sortable, and it intersected before,
+ // we fake the drag stop of the sortable, but make sure it doesn't remove
+ // the helper by using cancelHelperRemoval.
+ if ( sortable.isOver ) {
+
+ sortable.isOver = 0;
+ sortable.cancelHelperRemoval = true;
+
+ // Calling sortable's mouseStop would trigger a revert,
+ // so revert must be temporarily false until after mouseStop is called.
+ sortable.options._revert = sortable.options.revert;
+ sortable.options.revert = false;
+
+ sortable._trigger( "out", event, sortable._uiHash( sortable ) );
+ sortable._mouseStop( event, true );
+
+ // restore sortable behaviors that were modfied
+ // when the draggable entered the sortable area (#9481)
+ sortable.options.revert = sortable.options._revert;
+ sortable.options.helper = sortable.options._helper;
+
+ if ( sortable.placeholder ) {
+ sortable.placeholder.remove();
+ }
+
+ // Restore and recalculate the draggable's offset considering the sortable
+ // may have modified them in unexpected ways. (#8809, #10669)
+ ui.helper.appendTo( draggable._parent );
+ draggable._refreshOffsets( event );
+ ui.position = draggable._generatePosition( event, true );
+
+ draggable._trigger( "fromSortable", event );
+
+ // Inform draggable that the helper is no longer in a valid drop zone
+ draggable.dropped = false;
+
+ // Need to refreshPositions of all sortables just in case removing
+ // from one sortable changes the location of other sortables (#9675)
+ $.each( draggable.sortables, function() {
+ this.refreshPositions();
+ });
+ }
+ }
+ });
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function( event, ui, instance ) {
+ var t = $( "body" ),
+ o = instance.options;
+
+ if (t.css("cursor")) {
+ o._cursor = t.css("cursor");
+ }
+ t.css("cursor", o.cursor);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+ if (o._cursor) {
+ $("body").css("cursor", o._cursor);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function( event, ui, instance ) {
+ var t = $( ui.helper ),
+ o = instance.options;
+ if (t.css("opacity")) {
+ o._opacity = t.css("opacity");
+ }
+ t.css("opacity", o.opacity);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+ if (o._opacity) {
+ $(ui.helper).css("opacity", o._opacity);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function( event, ui, i ) {
+ if ( !i.scrollParentNotHidden ) {
+ i.scrollParentNotHidden = i.helper.scrollParent( false );
+ }
+
+ if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
+ i.overflowOffset = i.scrollParentNotHidden.offset();
+ }
+ },
+ drag: function( event, ui, i ) {
+
+ var o = i.options,
+ scrolled = false,
+ scrollParent = i.scrollParentNotHidden[ 0 ],
+ document = i.document[ 0 ];
+
+ if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
+ if ( !o.axis || o.axis !== "x" ) {
+ if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
+ } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
+ }
+ }
+
+ if ( !o.axis || o.axis !== "y" ) {
+ if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
+ } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
+ }
+ }
+
+ } else {
+
+ if (!o.axis || o.axis !== "x") {
+ if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+ }
+
+ if (!o.axis || o.axis !== "y") {
+ if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+ }
+
+ }
+
+ if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(i, event);
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function( event, ui, i ) {
+
+ var o = i.options;
+
+ i.snapElements = [];
+
+ $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
+ var $t = $(this),
+ $o = $t.offset();
+ if (this !== i.element[0]) {
+ i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ }
+ });
+
+ },
+ drag: function( event, ui, inst ) {
+
+ var ts, bs, ls, rs, l, r, t, b, i, first,
+ o = inst.options,
+ d = o.snapTolerance,
+ x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (i = inst.snapElements.length - 1; i >= 0; i--){
+
+ l = inst.snapElements[i].left - inst.margins.left;
+ r = l + inst.snapElements[i].width;
+ t = inst.snapElements[i].top - inst.margins.top;
+ b = t + inst.snapElements[i].height;
+
+ if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
+ if (inst.snapElements[i].snapping) {
+ (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if (o.snapMode !== "inner") {
+ ts = Math.abs(t - y2) <= d;
+ bs = Math.abs(b - y1) <= d;
+ ls = Math.abs(l - x2) <= d;
+ rs = Math.abs(r - x1) <= d;
+ if (ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
+ }
+ if (bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
+ }
+ if (ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
+ }
+ if (rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
+ }
+ }
+
+ first = (ts || bs || ls || rs);
+
+ if (o.snapMode !== "outer") {
+ ts = Math.abs(t - y1) <= d;
+ bs = Math.abs(b - y2) <= d;
+ ls = Math.abs(l - x1) <= d;
+ rs = Math.abs(r - x2) <= d;
+ if (ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
+ }
+ if (bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
+ }
+ if (ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
+ }
+ if (rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
+ }
+ }
+
+ if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function( event, ui, instance ) {
+ var min,
+ o = instance.options,
+ group = $.makeArray($(o.stack)).sort(function(a, b) {
+ return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
+ });
+
+ if (!group.length) { return; }
+
+ min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+ $(group).each(function(i) {
+ $(this).css("zIndex", min + i);
+ });
+ this.css("zIndex", (min + group.length));
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function( event, ui, instance ) {
+ var t = $( ui.helper ),
+ o = instance.options;
+
+ if (t.css("zIndex")) {
+ o._zIndex = t.css("zIndex");
+ }
+ t.css("zIndex", o.zIndex);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+
+ if (o._zIndex) {
+ $(ui.helper).css("zIndex", o._zIndex);
+ }
+ }
+});
+
+var draggable = $.ui.draggable;
+
+
+/*!
+ * jQuery UI Droppable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/droppable/
+ */
+
+
+$.widget( "ui.droppable", {
+ version: "1.11.4",
+ widgetEventPrefix: "drop",
+ options: {
+ accept: "*",
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: "default",
+ tolerance: "intersect",
+
+ // callbacks
+ activate: null,
+ deactivate: null,
+ drop: null,
+ out: null,
+ over: null
+ },
+ _create: function() {
+
+ var proportions,
+ o = this.options,
+ accept = o.accept;
+
+ this.isover = false;
+ this.isout = true;
+
+ this.accept = $.isFunction( accept ) ? accept : function( d ) {
+ return d.is( accept );
+ };
+
+ this.proportions = function( /* valueToWrite */ ) {
+ if ( arguments.length ) {
+ // Store the droppable's proportions
+ proportions = arguments[ 0 ];
+ } else {
+ // Retrieve or derive the droppable's proportions
+ return proportions ?
+ proportions :
+ proportions = {
+ width: this.element[ 0 ].offsetWidth,
+ height: this.element[ 0 ].offsetHeight
+ };
+ }
+ };
+
+ this._addToManager( o.scope );
+
+ o.addClasses && this.element.addClass( "ui-droppable" );
+
+ },
+
+ _addToManager: function( scope ) {
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
+ $.ui.ddmanager.droppables[ scope ].push( this );
+ },
+
+ _splice: function( drop ) {
+ var i = 0;
+ for ( ; i < drop.length; i++ ) {
+ if ( drop[ i ] === this ) {
+ drop.splice( i, 1 );
+ }
+ }
+ },
+
+ _destroy: function() {
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
+
+ this._splice( drop );
+
+ this.element.removeClass( "ui-droppable ui-droppable-disabled" );
+ },
+
+ _setOption: function( key, value ) {
+
+ if ( key === "accept" ) {
+ this.accept = $.isFunction( value ) ? value : function( d ) {
+ return d.is( value );
+ };
+ } else if ( key === "scope" ) {
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
+
+ this._splice( drop );
+ this._addToManager( value );
+ }
+
+ this._super( key, value );
+ },
+
+ _activate: function( event ) {
+ var draggable = $.ui.ddmanager.current;
+ if ( this.options.activeClass ) {
+ this.element.addClass( this.options.activeClass );
+ }
+ if ( draggable ){
+ this._trigger( "activate", event, this.ui( draggable ) );
+ }
+ },
+
+ _deactivate: function( event ) {
+ var draggable = $.ui.ddmanager.current;
+ if ( this.options.activeClass ) {
+ this.element.removeClass( this.options.activeClass );
+ }
+ if ( draggable ){
+ this._trigger( "deactivate", event, this.ui( draggable ) );
+ }
+ },
+
+ _over: function( event ) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.hoverClass ) {
+ this.element.addClass( this.options.hoverClass );
+ }
+ this._trigger( "over", event, this.ui( draggable ) );
+ }
+
+ },
+
+ _out: function( event ) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.hoverClass ) {
+ this.element.removeClass( this.options.hoverClass );
+ }
+ this._trigger( "out", event, this.ui( draggable ) );
+ }
+
+ },
+
+ _drop: function( event, custom ) {
+
+ var draggable = custom || $.ui.ddmanager.current,
+ childrenIntersection = false;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return false;
+ }
+
+ this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
+ var inst = $( this ).droppable( "instance" );
+ if (
+ inst.options.greedy &&
+ !inst.options.disabled &&
+ inst.options.scope === draggable.options.scope &&
+ inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
+ $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
+ ) { childrenIntersection = true; return false; }
+ });
+ if ( childrenIntersection ) {
+ return false;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.activeClass ) {
+ this.element.removeClass( this.options.activeClass );
+ }
+ if ( this.options.hoverClass ) {
+ this.element.removeClass( this.options.hoverClass );
+ }
+ this._trigger( "drop", event, this.ui( draggable ) );
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function( c ) {
+ return {
+ draggable: ( c.currentItem || c.element ),
+ helper: c.helper,
+ position: c.position,
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.ui.intersect = (function() {
+ function isOverAxis( x, reference, size ) {
+ return ( x >= reference ) && ( x < ( reference + size ) );
+ }
+
+ return function( draggable, droppable, toleranceMode, event ) {
+
+ if ( !droppable.offset ) {
+ return false;
+ }
+
+ var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
+ y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
+ x2 = x1 + draggable.helperProportions.width,
+ y2 = y1 + draggable.helperProportions.height,
+ l = droppable.offset.left,
+ t = droppable.offset.top,
+ r = l + droppable.proportions().width,
+ b = t + droppable.proportions().height;
+
+ switch ( toleranceMode ) {
+ case "fit":
+ return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
+ case "intersect":
+ return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
+ x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
+ t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
+ y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
+ case "pointer":
+ return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
+ case "touch":
+ return (
+ ( y1 >= t && y1 <= b ) || // Top edge touching
+ ( y2 >= t && y2 <= b ) || // Bottom edge touching
+ ( y1 < t && y2 > b ) // Surrounded vertically
+ ) && (
+ ( x1 >= l && x1 <= r ) || // Left edge touching
+ ( x2 >= l && x2 <= r ) || // Right edge touching
+ ( x1 < l && x2 > r ) // Surrounded horizontally
+ );
+ default:
+ return false;
+ }
+ };
+})();
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { "default": [] },
+ prepareOffsets: function( t, event ) {
+
+ var i, j,
+ m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
+ type = event ? event.type : null, // workaround for #2317
+ list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
+
+ droppablesLoop: for ( i = 0; i < m.length; i++ ) {
+
+ // No disabled and non-accepted
+ if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
+ continue;
+ }
+
+ // Filter out elements in the current dragged item
+ for ( j = 0; j < list.length; j++ ) {
+ if ( list[ j ] === m[ i ].element[ 0 ] ) {
+ m[ i ].proportions().height = 0;
+ continue droppablesLoop;
+ }
+ }
+
+ m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
+ if ( !m[ i ].visible ) {
+ continue;
+ }
+
+ // Activate the droppable if used directly from draggables
+ if ( type === "mousedown" ) {
+ m[ i ]._activate.call( m[ i ], event );
+ }
+
+ m[ i ].offset = m[ i ].element.offset();
+ m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
+
+ }
+
+ },
+ drop: function( draggable, event ) {
+
+ var dropped = false;
+ // Create a copy of the droppables in case the list changes during the drop (#9116)
+ $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
+
+ if ( !this.options ) {
+ return;
+ }
+ if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
+ dropped = this._drop.call( this, event ) || dropped;
+ }
+
+ if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ this.isout = true;
+ this.isover = false;
+ this._deactivate.call( this, event );
+ }
+
+ });
+ return dropped;
+
+ },
+ dragStart: function( draggable, event ) {
+ // Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
+ draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
+ if ( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ });
+ },
+ drag: function( draggable, event ) {
+
+ // If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if ( draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+
+ // Run through all droppables and check their positions based on specific tolerance options
+ $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
+
+ if ( this.options.disabled || this.greedyChild || !this.visible ) {
+ return;
+ }
+
+ var parentInstance, scope, parent,
+ intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
+ c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
+ if ( !c ) {
+ return;
+ }
+
+ if ( this.options.greedy ) {
+ // find droppable parents with same scope
+ scope = this.options.scope;
+ parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
+ return $( this ).droppable( "instance" ).options.scope === scope;
+ });
+
+ if ( parent.length ) {
+ parentInstance = $( parent[ 0 ] ).droppable( "instance" );
+ parentInstance.greedyChild = ( c === "isover" );
+ }
+ }
+
+ // we just moved into a greedy child
+ if ( parentInstance && c === "isover" ) {
+ parentInstance.isover = false;
+ parentInstance.isout = true;
+ parentInstance._out.call( parentInstance, event );
+ }
+
+ this[ c ] = true;
+ this[c === "isout" ? "isover" : "isout"] = false;
+ this[c === "isover" ? "_over" : "_out"].call( this, event );
+
+ // we just moved out of a greedy child
+ if ( parentInstance && c === "isout" ) {
+ parentInstance.isout = false;
+ parentInstance.isover = true;
+ parentInstance._over.call( parentInstance, event );
+ }
+ });
+
+ },
+ dragStop: function( draggable, event ) {
+ draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
+ // Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
+ if ( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ }
+};
+
+var droppable = $.ui.droppable;
+
+
+/*!
+ * jQuery UI Resizable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/resizable/
+ */
+
+
+$.widget("ui.resizable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "resize",
+ options: {
+ alsoResize: false,
+ animate: false,
+ animateDuration: "slow",
+ animateEasing: "swing",
+ aspectRatio: false,
+ autoHide: false,
+ containment: false,
+ ghost: false,
+ grid: false,
+ handles: "e,s,se",
+ helper: false,
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 10,
+ minWidth: 10,
+ // See #7960
+ zIndex: 90,
+
+ // callbacks
+ resize: null,
+ start: null,
+ stop: null
+ },
+
+ _num: function( value ) {
+ return parseInt( value, 10 ) || 0;
+ },
+
+ _isNumber: function( value ) {
+ return !isNaN( parseInt( value, 10 ) );
+ },
+
+ _hasScroll: function( el, a ) {
+
+ if ( $( el ).css( "overflow" ) === "hidden") {
+ return false;
+ }
+
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+ has = false;
+
+ if ( el[ scroll ] > 0 ) {
+ return true;
+ }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[ scroll ] = 1;
+ has = ( el[ scroll ] > 0 );
+ el[ scroll ] = 0;
+ return has;
+ },
+
+ _create: function() {
+
+ var n, i, handle, axis, hname,
+ that = this,
+ o = this.options;
+ this.element.addClass("ui-resizable");
+
+ $.extend(this, {
+ _aspectRatio: !!(o.aspectRatio),
+ aspectRatio: o.aspectRatio,
+ originalElement: this.element,
+ _proportionallyResizeElements: [],
+ _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
+ });
+
+ // Wrap the element if it cannot hold child nodes
+ if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
+
+ this.element.wrap(
+ $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
+ position: this.element.css("position"),
+ width: this.element.outerWidth(),
+ height: this.element.outerHeight(),
+ top: this.element.css("top"),
+ left: this.element.css("left")
+ })
+ );
+
+ this.element = this.element.parent().data(
+ "ui-resizable", this.element.resizable( "instance" )
+ );
+
+ this.elementIsWrapper = true;
+
+ this.element.css({
+ marginLeft: this.originalElement.css("marginLeft"),
+ marginTop: this.originalElement.css("marginTop"),
+ marginRight: this.originalElement.css("marginRight"),
+ marginBottom: this.originalElement.css("marginBottom")
+ });
+ this.originalElement.css({
+ marginLeft: 0,
+ marginTop: 0,
+ marginRight: 0,
+ marginBottom: 0
+ });
+ // support: Safari
+ // Prevent Safari textarea resize
+ this.originalResizeStyle = this.originalElement.css("resize");
+ this.originalElement.css("resize", "none");
+
+ this._proportionallyResizeElements.push( this.originalElement.css({
+ position: "static",
+ zoom: 1,
+ display: "block"
+ }) );
+
+ // support: IE9
+ // avoid IE jump (hard set the margin)
+ this.originalElement.css({ margin: this.originalElement.css("margin") });
+
+ this._proportionallyResize();
+ }
+
+ this.handles = o.handles ||
+ ( !$(".ui-resizable-handle", this.element).length ?
+ "e,s,se" : {
+ n: ".ui-resizable-n",
+ e: ".ui-resizable-e",
+ s: ".ui-resizable-s",
+ w: ".ui-resizable-w",
+ se: ".ui-resizable-se",
+ sw: ".ui-resizable-sw",
+ ne: ".ui-resizable-ne",
+ nw: ".ui-resizable-nw"
+ } );
+
+ this._handles = $();
+ if ( this.handles.constructor === String ) {
+
+ if ( this.handles === "all") {
+ this.handles = "n,e,s,w,se,sw,ne,nw";
+ }
+
+ n = this.handles.split(",");
+ this.handles = {};
+
+ for (i = 0; i < n.length; i++) {
+
+ handle = $.trim(n[i]);
+ hname = "ui-resizable-" + handle;
+ axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
+
+ axis.css({ zIndex: o.zIndex });
+
+ // TODO : What's going on here?
+ if ("se" === handle) {
+ axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
+ }
+
+ this.handles[handle] = ".ui-resizable-" + handle;
+ this.element.append(axis);
+ }
+
+ }
+
+ this._renderAxis = function(target) {
+
+ var i, axis, padPos, padWrapper;
+
+ target = target || this.element;
+
+ for (i in this.handles) {
+
+ if (this.handles[i].constructor === String) {
+ this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
+ } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
+ this.handles[ i ] = $( this.handles[ i ] );
+ this._on( this.handles[ i ], { "mousedown": that._mouseDown });
+ }
+
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
+
+ axis = $(this.handles[i], this.element);
+
+ padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
+
+ padPos = [ "padding",
+ /ne|nw|n/.test(i) ? "Top" :
+ /se|sw|s/.test(i) ? "Bottom" :
+ /^e$/.test(i) ? "Right" : "Left" ].join("");
+
+ target.css(padPos, padWrapper);
+
+ this._proportionallyResize();
+ }
+
+ this._handles = this._handles.add( this.handles[ i ] );
+ }
+ };
+
+ // TODO: make renderAxis a prototype function
+ this._renderAxis(this.element);
+
+ this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
+ this._handles.disableSelection();
+
+ this._handles.mouseover(function() {
+ if (!that.resizing) {
+ if (this.className) {
+ axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
+ }
+ that.axis = axis && axis[1] ? axis[1] : "se";
+ }
+ });
+
+ if (o.autoHide) {
+ this._handles.hide();
+ $(this.element)
+ .addClass("ui-resizable-autohide")
+ .mouseenter(function() {
+ if (o.disabled) {
+ return;
+ }
+ $(this).removeClass("ui-resizable-autohide");
+ that._handles.show();
+ })
+ .mouseleave(function() {
+ if (o.disabled) {
+ return;
+ }
+ if (!that.resizing) {
+ $(this).addClass("ui-resizable-autohide");
+ that._handles.hide();
+ }
+ });
+ }
+
+ this._mouseInit();
+ },
+
+ _destroy: function() {
+
+ this._mouseDestroy();
+
+ var wrapper,
+ _destroy = function(exp) {
+ $(exp)
+ .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
+ .removeData("resizable")
+ .removeData("ui-resizable")
+ .unbind(".resizable")
+ .find(".ui-resizable-handle")
+ .remove();
+ };
+
+ // TODO: Unwrap at same DOM position
+ if (this.elementIsWrapper) {
+ _destroy(this.element);
+ wrapper = this.element;
+ this.originalElement.css({
+ position: wrapper.css("position"),
+ width: wrapper.outerWidth(),
+ height: wrapper.outerHeight(),
+ top: wrapper.css("top"),
+ left: wrapper.css("left")
+ }).insertAfter( wrapper );
+ wrapper.remove();
+ }
+
+ this.originalElement.css("resize", this.originalResizeStyle);
+ _destroy(this.originalElement);
+
+ return this;
+ },
+
+ _mouseCapture: function(event) {
+ var i, handle,
+ capture = false;
+
+ for (i in this.handles) {
+ handle = $(this.handles[i])[0];
+ if (handle === event.target || $.contains(handle, event.target)) {
+ capture = true;
+ }
+ }
+
+ return !this.options.disabled && capture;
+ },
+
+ _mouseStart: function(event) {
+
+ var curleft, curtop, cursor,
+ o = this.options,
+ el = this.element;
+
+ this.resizing = true;
+
+ this._renderProxy();
+
+ curleft = this._num(this.helper.css("left"));
+ curtop = this._num(this.helper.css("top"));
+
+ if (o.containment) {
+ curleft += $(o.containment).scrollLeft() || 0;
+ curtop += $(o.containment).scrollTop() || 0;
+ }
+
+ this.offset = this.helper.offset();
+ this.position = { left: curleft, top: curtop };
+
+ this.size = this._helper ? {
+ width: this.helper.width(),
+ height: this.helper.height()
+ } : {
+ width: el.width(),
+ height: el.height()
+ };
+
+ this.originalSize = this._helper ? {
+ width: el.outerWidth(),
+ height: el.outerHeight()
+ } : {
+ width: el.width(),
+ height: el.height()
+ };
+
+ this.sizeDiff = {
+ width: el.outerWidth() - el.width(),
+ height: el.outerHeight() - el.height()
+ };
+
+ this.originalPosition = { left: curleft, top: curtop };
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
+
+ this.aspectRatio = (typeof o.aspectRatio === "number") ?
+ o.aspectRatio :
+ ((this.originalSize.width / this.originalSize.height) || 1);
+
+ cursor = $(".ui-resizable-" + this.axis).css("cursor");
+ $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
+
+ el.addClass("ui-resizable-resizing");
+ this._propagate("start", event);
+ return true;
+ },
+
+ _mouseDrag: function(event) {
+
+ var data, props,
+ smp = this.originalMousePosition,
+ a = this.axis,
+ dx = (event.pageX - smp.left) || 0,
+ dy = (event.pageY - smp.top) || 0,
+ trigger = this._change[a];
+
+ this._updatePrevProperties();
+
+ if (!trigger) {
+ return false;
+ }
+
+ data = trigger.apply(this, [ event, dx, dy ]);
+
+ this._updateVirtualBoundaries(event.shiftKey);
+ if (this._aspectRatio || event.shiftKey) {
+ data = this._updateRatio(data, event);
+ }
+
+ data = this._respectSize(data, event);
+
+ this._updateCache(data);
+
+ this._propagate("resize", event);
+
+ props = this._applyChanges();
+
+ if ( !this._helper && this._proportionallyResizeElements.length ) {
+ this._proportionallyResize();
+ }
+
+ if ( !$.isEmptyObject( props ) ) {
+ this._updatePrevProperties();
+ this._trigger( "resize", event, this.ui() );
+ this._applyChanges();
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ this.resizing = false;
+ var pr, ista, soffseth, soffsetw, s, left, top,
+ o = this.options, that = this;
+
+ if (this._helper) {
+
+ pr = this._proportionallyResizeElements;
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName);
+ soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
+ soffsetw = ista ? 0 : that.sizeDiff.width;
+
+ s = {
+ width: (that.helper.width() - soffsetw),
+ height: (that.helper.height() - soffseth)
+ };
+ left = (parseInt(that.element.css("left"), 10) +
+ (that.position.left - that.originalPosition.left)) || null;
+ top = (parseInt(that.element.css("top"), 10) +
+ (that.position.top - that.originalPosition.top)) || null;
+
+ if (!o.animate) {
+ this.element.css($.extend(s, { top: top, left: left }));
+ }
+
+ that.helper.height(that.size.height);
+ that.helper.width(that.size.width);
+
+ if (this._helper && !o.animate) {
+ this._proportionallyResize();
+ }
+ }
+
+ $("body").css("cursor", "auto");
+
+ this.element.removeClass("ui-resizable-resizing");
+
+ this._propagate("stop", event);
+
+ if (this._helper) {
+ this.helper.remove();
+ }
+
+ return false;
+
+ },
+
+ _updatePrevProperties: function() {
+ this.prevPosition = {
+ top: this.position.top,
+ left: this.position.left
+ };
+ this.prevSize = {
+ width: this.size.width,
+ height: this.size.height
+ };
+ },
+
+ _applyChanges: function() {
+ var props = {};
+
+ if ( this.position.top !== this.prevPosition.top ) {
+ props.top = this.position.top + "px";
+ }
+ if ( this.position.left !== this.prevPosition.left ) {
+ props.left = this.position.left + "px";
+ }
+ if ( this.size.width !== this.prevSize.width ) {
+ props.width = this.size.width + "px";
+ }
+ if ( this.size.height !== this.prevSize.height ) {
+ props.height = this.size.height + "px";
+ }
+
+ this.helper.css( props );
+
+ return props;
+ },
+
+ _updateVirtualBoundaries: function(forceAspectRatio) {
+ var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
+ o = this.options;
+
+ b = {
+ minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
+ maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
+ minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
+ maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
+ };
+
+ if (this._aspectRatio || forceAspectRatio) {
+ pMinWidth = b.minHeight * this.aspectRatio;
+ pMinHeight = b.minWidth / this.aspectRatio;
+ pMaxWidth = b.maxHeight * this.aspectRatio;
+ pMaxHeight = b.maxWidth / this.aspectRatio;
+
+ if (pMinWidth > b.minWidth) {
+ b.minWidth = pMinWidth;
+ }
+ if (pMinHeight > b.minHeight) {
+ b.minHeight = pMinHeight;
+ }
+ if (pMaxWidth < b.maxWidth) {
+ b.maxWidth = pMaxWidth;
+ }
+ if (pMaxHeight < b.maxHeight) {
+ b.maxHeight = pMaxHeight;
+ }
+ }
+ this._vBoundaries = b;
+ },
+
+ _updateCache: function(data) {
+ this.offset = this.helper.offset();
+ if (this._isNumber(data.left)) {
+ this.position.left = data.left;
+ }
+ if (this._isNumber(data.top)) {
+ this.position.top = data.top;
+ }
+ if (this._isNumber(data.height)) {
+ this.size.height = data.height;
+ }
+ if (this._isNumber(data.width)) {
+ this.size.width = data.width;
+ }
+ },
+
+ _updateRatio: function( data ) {
+
+ var cpos = this.position,
+ csize = this.size,
+ a = this.axis;
+
+ if (this._isNumber(data.height)) {
+ data.width = (data.height * this.aspectRatio);
+ } else if (this._isNumber(data.width)) {
+ data.height = (data.width / this.aspectRatio);
+ }
+
+ if (a === "sw") {
+ data.left = cpos.left + (csize.width - data.width);
+ data.top = null;
+ }
+ if (a === "nw") {
+ data.top = cpos.top + (csize.height - data.height);
+ data.left = cpos.left + (csize.width - data.width);
+ }
+
+ return data;
+ },
+
+ _respectSize: function( data ) {
+
+ var o = this._vBoundaries,
+ a = this.axis,
+ ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
+ ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
+ isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
+ isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
+ dw = this.originalPosition.left + this.originalSize.width,
+ dh = this.position.top + this.size.height,
+ cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
+ if (isminw) {
+ data.width = o.minWidth;
+ }
+ if (isminh) {
+ data.height = o.minHeight;
+ }
+ if (ismaxw) {
+ data.width = o.maxWidth;
+ }
+ if (ismaxh) {
+ data.height = o.maxHeight;
+ }
+
+ if (isminw && cw) {
+ data.left = dw - o.minWidth;
+ }
+ if (ismaxw && cw) {
+ data.left = dw - o.maxWidth;
+ }
+ if (isminh && ch) {
+ data.top = dh - o.minHeight;
+ }
+ if (ismaxh && ch) {
+ data.top = dh - o.maxHeight;
+ }
+
+ // Fixing jump error on top/left - bug #2330
+ if (!data.width && !data.height && !data.left && data.top) {
+ data.top = null;
+ } else if (!data.width && !data.height && !data.top && data.left) {
+ data.left = null;
+ }
+
+ return data;
+ },
+
+ _getPaddingPlusBorderDimensions: function( element ) {
+ var i = 0,
+ widths = [],
+ borders = [
+ element.css( "borderTopWidth" ),
+ element.css( "borderRightWidth" ),
+ element.css( "borderBottomWidth" ),
+ element.css( "borderLeftWidth" )
+ ],
+ paddings = [
+ element.css( "paddingTop" ),
+ element.css( "paddingRight" ),
+ element.css( "paddingBottom" ),
+ element.css( "paddingLeft" )
+ ];
+
+ for ( ; i < 4; i++ ) {
+ widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
+ widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
+ }
+
+ return {
+ height: widths[ 0 ] + widths[ 2 ],
+ width: widths[ 1 ] + widths[ 3 ]
+ };
+ },
+
+ _proportionallyResize: function() {
+
+ if (!this._proportionallyResizeElements.length) {
+ return;
+ }
+
+ var prel,
+ i = 0,
+ element = this.helper || this.element;
+
+ for ( ; i < this._proportionallyResizeElements.length; i++) {
+
+ prel = this._proportionallyResizeElements[i];
+
+ // TODO: Seems like a bug to cache this.outerDimensions
+ // considering that we are in a loop.
+ if (!this.outerDimensions) {
+ this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
+ }
+
+ prel.css({
+ height: (element.height() - this.outerDimensions.height) || 0,
+ width: (element.width() - this.outerDimensions.width) || 0
+ });
+
+ }
+
+ },
+
+ _renderProxy: function() {
+
+ var el = this.element, o = this.options;
+ this.elementOffset = el.offset();
+
+ if (this._helper) {
+
+ this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
+
+ this.helper.addClass(this._helper).css({
+ width: this.element.outerWidth() - 1,
+ height: this.element.outerHeight() - 1,
+ position: "absolute",
+ left: this.elementOffset.left + "px",
+ top: this.elementOffset.top + "px",
+ zIndex: ++o.zIndex //TODO: Don't modify option
+ });
+
+ this.helper
+ .appendTo("body")
+ .disableSelection();
+
+ } else {
+ this.helper = this.element;
+ }
+
+ },
+
+ _change: {
+ e: function(event, dx) {
+ return { width: this.originalSize.width + dx };
+ },
+ w: function(event, dx) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { left: sp.left + dx, width: cs.width - dx };
+ },
+ n: function(event, dx, dy) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { top: sp.top + dy, height: cs.height - dy };
+ },
+ s: function(event, dx, dy) {
+ return { height: this.originalSize.height + dy };
+ },
+ se: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments),
+ this._change.e.apply(this, [ event, dx, dy ]));
+ },
+ sw: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments),
+ this._change.w.apply(this, [ event, dx, dy ]));
+ },
+ ne: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments),
+ this._change.e.apply(this, [ event, dx, dy ]));
+ },
+ nw: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments),
+ this._change.w.apply(this, [ event, dx, dy ]));
+ }
+ },
+
+ _propagate: function(n, event) {
+ $.ui.plugin.call(this, n, [ event, this.ui() ]);
+ (n !== "resize" && this._trigger(n, event, this.ui()));
+ },
+
+ plugins: {},
+
+ ui: function() {
+ return {
+ originalElement: this.originalElement,
+ element: this.element,
+ helper: this.helper,
+ position: this.position,
+ size: this.size,
+ originalSize: this.originalSize,
+ originalPosition: this.originalPosition
+ };
+ }
+
+});
+
+/*
+ * Resizable Extensions
+ */
+
+$.ui.plugin.add("resizable", "animate", {
+
+ stop: function( event ) {
+ var that = $(this).resizable( "instance" ),
+ o = that.options,
+ pr = that._proportionallyResizeElements,
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName),
+ soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
+ soffsetw = ista ? 0 : that.sizeDiff.width,
+ style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
+ left = (parseInt(that.element.css("left"), 10) +
+ (that.position.left - that.originalPosition.left)) || null,
+ top = (parseInt(that.element.css("top"), 10) +
+ (that.position.top - that.originalPosition.top)) || null;
+
+ that.element.animate(
+ $.extend(style, top && left ? { top: top, left: left } : {}), {
+ duration: o.animateDuration,
+ easing: o.animateEasing,
+ step: function() {
+
+ var data = {
+ width: parseInt(that.element.css("width"), 10),
+ height: parseInt(that.element.css("height"), 10),
+ top: parseInt(that.element.css("top"), 10),
+ left: parseInt(that.element.css("left"), 10)
+ };
+
+ if (pr && pr.length) {
+ $(pr[0]).css({ width: data.width, height: data.height });
+ }
+
+ // propagating resize, and updating values for each animation step
+ that._updateCache(data);
+ that._propagate("resize", event);
+
+ }
+ }
+ );
+ }
+
+});
+
+$.ui.plugin.add( "resizable", "containment", {
+
+ start: function() {
+ var element, p, co, ch, cw, width, height,
+ that = $( this ).resizable( "instance" ),
+ o = that.options,
+ el = that.element,
+ oc = o.containment,
+ ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
+
+ if ( !ce ) {
+ return;
+ }
+
+ that.containerElement = $( ce );
+
+ if ( /document/.test( oc ) || oc === document ) {
+ that.containerOffset = {
+ left: 0,
+ top: 0
+ };
+ that.containerPosition = {
+ left: 0,
+ top: 0
+ };
+
+ that.parentData = {
+ element: $( document ),
+ left: 0,
+ top: 0,
+ width: $( document ).width(),
+ height: $( document ).height() || document.body.parentNode.scrollHeight
+ };
+ } else {
+ element = $( ce );
+ p = [];
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
+ p[ i ] = that._num( element.css( "padding" + name ) );
+ });
+
+ that.containerOffset = element.offset();
+ that.containerPosition = element.position();
+ that.containerSize = {
+ height: ( element.innerHeight() - p[ 3 ] ),
+ width: ( element.innerWidth() - p[ 1 ] )
+ };
+
+ co = that.containerOffset;
+ ch = that.containerSize.height;
+ cw = that.containerSize.width;
+ width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
+ height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
+
+ that.parentData = {
+ element: ce,
+ left: co.left,
+ top: co.top,
+ width: width,
+ height: height
+ };
+ }
+ },
+
+ resize: function( event ) {
+ var woset, hoset, isParent, isOffsetRelative,
+ that = $( this ).resizable( "instance" ),
+ o = that.options,
+ co = that.containerOffset,
+ cp = that.position,
+ pRatio = that._aspectRatio || event.shiftKey,
+ cop = {
+ top: 0,
+ left: 0
+ },
+ ce = that.containerElement,
+ continueResize = true;
+
+ if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
+ cop = co;
+ }
+
+ if ( cp.left < ( that._helper ? co.left : 0 ) ) {
+ that.size.width = that.size.width +
+ ( that._helper ?
+ ( that.position.left - co.left ) :
+ ( that.position.left - cop.left ) );
+
+ if ( pRatio ) {
+ that.size.height = that.size.width / that.aspectRatio;
+ continueResize = false;
+ }
+ that.position.left = o.helper ? co.left : 0;
+ }
+
+ if ( cp.top < ( that._helper ? co.top : 0 ) ) {
+ that.size.height = that.size.height +
+ ( that._helper ?
+ ( that.position.top - co.top ) :
+ that.position.top );
+
+ if ( pRatio ) {
+ that.size.width = that.size.height * that.aspectRatio;
+ continueResize = false;
+ }
+ that.position.top = that._helper ? co.top : 0;
+ }
+
+ isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
+ isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
+
+ if ( isParent && isOffsetRelative ) {
+ that.offset.left = that.parentData.left + that.position.left;
+ that.offset.top = that.parentData.top + that.position.top;
+ } else {
+ that.offset.left = that.element.offset().left;
+ that.offset.top = that.element.offset().top;
+ }
+
+ woset = Math.abs( that.sizeDiff.width +
+ (that._helper ?
+ that.offset.left - cop.left :
+ (that.offset.left - co.left)) );
+
+ hoset = Math.abs( that.sizeDiff.height +
+ (that._helper ?
+ that.offset.top - cop.top :
+ (that.offset.top - co.top)) );
+
+ if ( woset + that.size.width >= that.parentData.width ) {
+ that.size.width = that.parentData.width - woset;
+ if ( pRatio ) {
+ that.size.height = that.size.width / that.aspectRatio;
+ continueResize = false;
+ }
+ }
+
+ if ( hoset + that.size.height >= that.parentData.height ) {
+ that.size.height = that.parentData.height - hoset;
+ if ( pRatio ) {
+ that.size.width = that.size.height * that.aspectRatio;
+ continueResize = false;
+ }
+ }
+
+ if ( !continueResize ) {
+ that.position.left = that.prevPosition.left;
+ that.position.top = that.prevPosition.top;
+ that.size.width = that.prevSize.width;
+ that.size.height = that.prevSize.height;
+ }
+ },
+
+ stop: function() {
+ var that = $( this ).resizable( "instance" ),
+ o = that.options,
+ co = that.containerOffset,
+ cop = that.containerPosition,
+ ce = that.containerElement,
+ helper = $( that.helper ),
+ ho = helper.offset(),
+ w = helper.outerWidth() - that.sizeDiff.width,
+ h = helper.outerHeight() - that.sizeDiff.height;
+
+ if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
+ $( this ).css({
+ left: ho.left - cop.left - co.left,
+ width: w,
+ height: h
+ });
+ }
+
+ if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
+ $( this ).css({
+ left: ho.left - cop.left - co.left,
+ width: w,
+ height: h
+ });
+ }
+ }
+});
+
+$.ui.plugin.add("resizable", "alsoResize", {
+
+ start: function() {
+ var that = $(this).resizable( "instance" ),
+ o = that.options;
+
+ $(o.alsoResize).each(function() {
+ var el = $(this);
+ el.data("ui-resizable-alsoresize", {
+ width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
+ left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
+ });
+ });
+ },
+
+ resize: function(event, ui) {
+ var that = $(this).resizable( "instance" ),
+ o = that.options,
+ os = that.originalSize,
+ op = that.originalPosition,
+ delta = {
+ height: (that.size.height - os.height) || 0,
+ width: (that.size.width - os.width) || 0,
+ top: (that.position.top - op.top) || 0,
+ left: (that.position.left - op.left) || 0
+ };
+
+ $(o.alsoResize).each(function() {
+ var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
+ css = el.parents(ui.originalElement[0]).length ?
+ [ "width", "height" ] :
+ [ "width", "height", "top", "left" ];
+
+ $.each(css, function(i, prop) {
+ var sum = (start[prop] || 0) + (delta[prop] || 0);
+ if (sum && sum >= 0) {
+ style[prop] = sum || null;
+ }
+ });
+
+ el.css(style);
+ });
+ },
+
+ stop: function() {
+ $(this).removeData("resizable-alsoresize");
+ }
+});
+
+$.ui.plugin.add("resizable", "ghost", {
+
+ start: function() {
+
+ var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
+
+ that.ghost = that.originalElement.clone();
+ that.ghost
+ .css({
+ opacity: 0.25,
+ display: "block",
+ position: "relative",
+ height: cs.height,
+ width: cs.width,
+ margin: 0,
+ left: 0,
+ top: 0
+ })
+ .addClass("ui-resizable-ghost")
+ .addClass(typeof o.ghost === "string" ? o.ghost : "");
+
+ that.ghost.appendTo(that.helper);
+
+ },
+
+ resize: function() {
+ var that = $(this).resizable( "instance" );
+ if (that.ghost) {
+ that.ghost.css({
+ position: "relative",
+ height: that.size.height,
+ width: that.size.width
+ });
+ }
+ },
+
+ stop: function() {
+ var that = $(this).resizable( "instance" );
+ if (that.ghost && that.helper) {
+ that.helper.get(0).removeChild(that.ghost.get(0));
+ }
+ }
+
+});
+
+$.ui.plugin.add("resizable", "grid", {
+
+ resize: function() {
+ var outerDimensions,
+ that = $(this).resizable( "instance" ),
+ o = that.options,
+ cs = that.size,
+ os = that.originalSize,
+ op = that.originalPosition,
+ a = that.axis,
+ grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
+ gridX = (grid[0] || 1),
+ gridY = (grid[1] || 1),
+ ox = Math.round((cs.width - os.width) / gridX) * gridX,
+ oy = Math.round((cs.height - os.height) / gridY) * gridY,
+ newWidth = os.width + ox,
+ newHeight = os.height + oy,
+ isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
+ isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
+ isMinWidth = o.minWidth && (o.minWidth > newWidth),
+ isMinHeight = o.minHeight && (o.minHeight > newHeight);
+
+ o.grid = grid;
+
+ if (isMinWidth) {
+ newWidth += gridX;
+ }
+ if (isMinHeight) {
+ newHeight += gridY;
+ }
+ if (isMaxWidth) {
+ newWidth -= gridX;
+ }
+ if (isMaxHeight) {
+ newHeight -= gridY;
+ }
+
+ if (/^(se|s|e)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ } else if (/^(ne)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else if (/^(sw)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.left = op.left - ox;
+ } else {
+ if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
+ outerDimensions = that._getPaddingPlusBorderDimensions( this );
+ }
+
+ if ( newHeight - gridY > 0 ) {
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else {
+ newHeight = gridY - outerDimensions.height;
+ that.size.height = newHeight;
+ that.position.top = op.top + os.height - newHeight;
+ }
+ if ( newWidth - gridX > 0 ) {
+ that.size.width = newWidth;
+ that.position.left = op.left - ox;
+ } else {
+ newWidth = gridX - outerDimensions.width;
+ that.size.width = newWidth;
+ that.position.left = op.left + os.width - newWidth;
+ }
+ }
+ }
+
+});
+
+var resizable = $.ui.resizable;
+
+
+/*!
+ * jQuery UI Selectable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/selectable/
+ */
+
+
+var selectable = $.widget("ui.selectable", $.ui.mouse, {
+ version: "1.11.4",
+ options: {
+ appendTo: "body",
+ autoRefresh: true,
+ distance: 0,
+ filter: "*",
+ tolerance: "touch",
+
+ // callbacks
+ selected: null,
+ selecting: null,
+ start: null,
+ stop: null,
+ unselected: null,
+ unselecting: null
+ },
+ _create: function() {
+ var selectees,
+ that = this;
+
+ this.element.addClass("ui-selectable");
+
+ this.dragged = false;
+
+ // cache selectee children based on filter
+ this.refresh = function() {
+ selectees = $(that.options.filter, that.element[0]);
+ selectees.addClass("ui-selectee");
+ selectees.each(function() {
+ var $this = $(this),
+ pos = $this.offset();
+ $.data(this, "selectable-item", {
+ element: this,
+ $element: $this,
+ left: pos.left,
+ top: pos.top,
+ right: pos.left + $this.outerWidth(),
+ bottom: pos.top + $this.outerHeight(),
+ startselected: false,
+ selected: $this.hasClass("ui-selected"),
+ selecting: $this.hasClass("ui-selecting"),
+ unselecting: $this.hasClass("ui-unselecting")
+ });
+ });
+ };
+ this.refresh();
+
+ this.selectees = selectees.addClass("ui-selectee");
+
+ this._mouseInit();
+
+ this.helper = $("<div class='ui-selectable-helper'></div>");
+ },
+
+ _destroy: function() {
+ this.selectees
+ .removeClass("ui-selectee")
+ .removeData("selectable-item");
+ this.element
+ .removeClass("ui-selectable ui-selectable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseStart: function(event) {
+ var that = this,
+ options = this.options;
+
+ this.opos = [ event.pageX, event.pageY ];
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ this.selectees = $(options.filter, this.element[0]);
+
+ this._trigger("start", event);
+
+ $(options.appendTo).append(this.helper);
+ // position helper (lasso)
+ this.helper.css({
+ "left": event.pageX,
+ "top": event.pageY,
+ "width": 0,
+ "height": 0
+ });
+
+ if (options.autoRefresh) {
+ this.refresh();
+ }
+
+ this.selectees.filter(".ui-selected").each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.startselected = true;
+ if (!event.metaKey && !event.ctrlKey) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ });
+
+ $(event.target).parents().addBack().each(function() {
+ var doSelect,
+ selectee = $.data(this, "selectable-item");
+ if (selectee) {
+ doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
+ selectee.$element
+ .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
+ .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
+ selectee.unselecting = !doSelect;
+ selectee.selecting = doSelect;
+ selectee.selected = doSelect;
+ // selectable (UN)SELECTING callback
+ if (doSelect) {
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ } else {
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ return false;
+ }
+ });
+
+ },
+
+ _mouseDrag: function(event) {
+
+ this.dragged = true;
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ var tmp,
+ that = this,
+ options = this.options,
+ x1 = this.opos[0],
+ y1 = this.opos[1],
+ x2 = event.pageX,
+ y2 = event.pageY;
+
+ if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
+ if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
+ this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
+
+ this.selectees.each(function() {
+ var selectee = $.data(this, "selectable-item"),
+ hit = false;
+
+ //prevent helper from being selected if appendTo: selectable
+ if (!selectee || selectee.element === that.element[0]) {
+ return;
+ }
+
+ if (options.tolerance === "touch") {
+ hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
+ } else if (options.tolerance === "fit") {
+ hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
+ }
+
+ if (hit) {
+ // SELECT
+ if (selectee.selected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ }
+ if (selectee.unselecting) {
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ }
+ if (!selectee.selecting) {
+ selectee.$element.addClass("ui-selecting");
+ selectee.selecting = true;
+ // selectable SELECTING callback
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ }
+ } else {
+ // UNSELECT
+ if (selectee.selecting) {
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ selectee.$element.addClass("ui-selected");
+ selectee.selected = true;
+ } else {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ if (selectee.startselected) {
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ }
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ if (selectee.selected) {
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ }
+ });
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+ var that = this;
+
+ this.dragged = false;
+
+ $(".ui-unselecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ selectee.startselected = false;
+ that._trigger("unselected", event, {
+ unselected: selectee.element
+ });
+ });
+ $(".ui-selecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
+ selectee.selecting = false;
+ selectee.selected = true;
+ selectee.startselected = true;
+ that._trigger("selected", event, {
+ selected: selectee.element
+ });
+ });
+ this._trigger("stop", event);
+
+ this.helper.remove();
+
+ return false;
+ }
+
+});
+
+
+/*!
+ * jQuery UI Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/sortable/
+ */
+
+
+var sortable = $.widget("ui.sortable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "sort",
+ ready: false,
+ options: {
+ appendTo: "parent",
+ axis: false,
+ connectWith: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ dropOnEmpty: true,
+ forcePlaceholderSize: false,
+ forceHelperSize: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ items: "> *",
+ opacity: false,
+ placeholder: false,
+ revert: false,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ tolerance: "intersect",
+ zIndex: 1000,
+
+ // callbacks
+ activate: null,
+ beforeStop: null,
+ change: null,
+ deactivate: null,
+ out: null,
+ over: null,
+ receive: null,
+ remove: null,
+ sort: null,
+ start: null,
+ stop: null,
+ update: null
+ },
+
+ _isOverAxis: function( x, reference, size ) {
+ return ( x >= reference ) && ( x < ( reference + size ) );
+ },
+
+ _isFloating: function( item ) {
+ return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
+ },
+
+ _create: function() {
+ this.containerCache = {};
+ this.element.addClass("ui-sortable");
+
+ //Get the items
+ this.refresh();
+
+ //Let's determine the parent's offset
+ this.offset = this.element.offset();
+
+ //Initialize mouse events for interaction
+ this._mouseInit();
+
+ this._setHandleClassName();
+
+ //We're ready to go
+ this.ready = true;
+
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+
+ if ( key === "handle" ) {
+ this._setHandleClassName();
+ }
+ },
+
+ _setHandleClassName: function() {
+ this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
+ $.each( this.items, function() {
+ ( this.instance.options.handle ?
+ this.item.find( this.instance.options.handle ) : this.item )
+ .addClass( "ui-sortable-handle" );
+ });
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-sortable ui-sortable-disabled" )
+ .find( ".ui-sortable-handle" )
+ .removeClass( "ui-sortable-handle" );
+ this._mouseDestroy();
+
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
+ this.items[i].item.removeData(this.widgetName + "-item");
+ }
+
+ return this;
+ },
+
+ _mouseCapture: function(event, overrideHandle) {
+ var currentItem = null,
+ validHandle = false,
+ that = this;
+
+ if (this.reverting) {
+ return false;
+ }
+
+ if(this.options.disabled || this.options.type === "static") {
+ return false;
+ }
+
+ //We have to refresh the items data once first
+ this._refreshItems(event);
+
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
+ $(event.target).parents().each(function() {
+ if($.data(this, that.widgetName + "-item") === that) {
+ currentItem = $(this);
+ return false;
+ }
+ });
+ if($.data(event.target, that.widgetName + "-item") === that) {
+ currentItem = $(event.target);
+ }
+
+ if(!currentItem) {
+ return false;
+ }
+ if(this.options.handle && !overrideHandle) {
+ $(this.options.handle, currentItem).find("*").addBack().each(function() {
+ if(this === event.target) {
+ validHandle = true;
+ }
+ });
+ if(!validHandle) {
+ return false;
+ }
+ }
+
+ this.currentItem = currentItem;
+ this._removeCurrentsFromItems();
+ return true;
+
+ },
+
+ _mouseStart: function(event, overrideHandle, noActivation) {
+
+ var i, body,
+ o = this.options;
+
+ this.currentContainer = this;
+
+ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
+ this.refreshPositions();
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Get the next scrolling parent
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.currentItem.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ // Only after we got the offset, we can change the helper's position to absolute
+ // TODO: Still need to figure out a way to make relative sorting possible
+ this.helper.css("position", "absolute");
+ this.cssPosition = this.helper.css("position");
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Cache the former DOM position
+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
+
+ //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
+ if(this.helper[0] !== this.currentItem[0]) {
+ this.currentItem.hide();
+ }
+
+ //Create the placeholder
+ this._createPlaceholder();
+
+ //Set a containment if given in the options
+ if(o.containment) {
+ this._setContainment();
+ }
+
+ if( o.cursor && o.cursor !== "auto" ) { // cursor option
+ body = this.document.find( "body" );
+
+ // support: IE
+ this.storedCursor = body.css( "cursor" );
+ body.css( "cursor", o.cursor );
+
+ this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
+ }
+
+ if(o.opacity) { // opacity option
+ if (this.helper.css("opacity")) {
+ this._storedOpacity = this.helper.css("opacity");
+ }
+ this.helper.css("opacity", o.opacity);
+ }
+
+ if(o.zIndex) { // zIndex option
+ if (this.helper.css("zIndex")) {
+ this._storedZIndex = this.helper.css("zIndex");
+ }
+ this.helper.css("zIndex", o.zIndex);
+ }
+
+ //Prepare scrolling
+ if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
+ this.overflowOffset = this.scrollParent.offset();
+ }
+
+ //Call callbacks
+ this._trigger("start", event, this._uiHash());
+
+ //Recache the helper size
+ if(!this._preserveHelperProportions) {
+ this._cacheHelperProportions();
+ }
+
+
+ //Post "activate" events to possible containers
+ if( !noActivation ) {
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
+ }
+ }
+
+ //Prepare possible droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+ this.dragging = true;
+
+ this.helper.addClass("ui-sortable-helper");
+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+
+ },
+
+ _mouseDrag: function(event) {
+ var i, item, itemElement, intersection,
+ o = this.options,
+ scrolled = false;
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ if (!this.lastPositionAbs) {
+ this.lastPositionAbs = this.positionAbs;
+ }
+
+ //Do scrolling
+ if(this.options.scroll) {
+ if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
+
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
+ } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
+ } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
+ scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
+ } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
+ scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
+ }
+
+ if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
+ scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
+ } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
+ scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+ }
+
+ //Regenerate the absolute position used for position checks
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Set the helper position
+ if(!this.options.axis || this.options.axis !== "y") {
+ this.helper[0].style.left = this.position.left+"px";
+ }
+ if(!this.options.axis || this.options.axis !== "x") {
+ this.helper[0].style.top = this.position.top+"px";
+ }
+
+ //Rearrange
+ for (i = this.items.length - 1; i >= 0; i--) {
+
+ //Cache variables and intersection, continue if no intersection
+ item = this.items[i];
+ itemElement = item.item[0];
+ intersection = this._intersectsWithPointer(item);
+ if (!intersection) {
+ continue;
+ }
+
+ // Only put the placeholder inside the current Container, skip all
+ // items from other containers. This works because when moving
+ // an item from one container to another the
+ // currentContainer is switched before the placeholder is moved.
+ //
+ // Without this, moving items in "sub-sortables" can cause
+ // the placeholder to jitter between the outer and inner container.
+ if (item.instance !== this.currentContainer) {
+ continue;
+ }
+
+ // cannot intersect with itself
+ // no useless actions that have been done before
+ // no action if the item moved is the parent of the item checked
+ if (itemElement !== this.currentItem[0] &&
+ this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
+ !$.contains(this.placeholder[0], itemElement) &&
+ (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
+ ) {
+
+ this.direction = intersection === 1 ? "down" : "up";
+
+ if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
+ this._rearrange(event, item);
+ } else {
+ break;
+ }
+
+ this._trigger("change", event, this._uiHash());
+ break;
+ }
+ }
+
+ //Post events to containers
+ this._contactContainers(event);
+
+ //Interconnect with droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ //Call callbacks
+ this._trigger("sort", event, this._uiHash());
+
+ this.lastPositionAbs = this.positionAbs;
+ return false;
+
+ },
+
+ _mouseStop: function(event, noPropagation) {
+
+ if(!event) {
+ return;
+ }
+
+ //If we are using droppables, inform the manager about the drop
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ $.ui.ddmanager.drop(this, event);
+ }
+
+ if(this.options.revert) {
+ var that = this,
+ cur = this.placeholder.offset(),
+ axis = this.options.axis,
+ animation = {};
+
+ if ( !axis || axis === "x" ) {
+ animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
+ }
+ if ( !axis || axis === "y" ) {
+ animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
+ }
+ this.reverting = true;
+ $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
+ that._clear(event);
+ });
+ } else {
+ this._clear(event, noPropagation);
+ }
+
+ return false;
+
+ },
+
+ cancel: function() {
+
+ if(this.dragging) {
+
+ this._mouseUp({ target: null });
+
+ if(this.options.helper === "original") {
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ //Post deactivating events to containers
+ for (var i = this.containers.length - 1; i >= 0; i--){
+ this.containers[i]._trigger("deactivate", null, this._uiHash(this));
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", null, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ if (this.placeholder) {
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ if(this.placeholder[0].parentNode) {
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+ }
+ if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
+ this.helper.remove();
+ }
+
+ $.extend(this, {
+ helper: null,
+ dragging: false,
+ reverting: false,
+ _noFinalSort: null
+ });
+
+ if(this.domPosition.prev) {
+ $(this.domPosition.prev).after(this.currentItem);
+ } else {
+ $(this.domPosition.parent).prepend(this.currentItem);
+ }
+ }
+
+ return this;
+
+ },
+
+ serialize: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ str = [];
+ o = o || {};
+
+ $(items).each(function() {
+ var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
+ if (res) {
+ str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
+ }
+ });
+
+ if(!str.length && o.key) {
+ str.push(o.key + "=");
+ }
+
+ return str.join("&");
+
+ },
+
+ toArray: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ ret = [];
+
+ o = o || {};
+
+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
+ return ret;
+
+ },
+
+ /* Be careful with the following core functions */
+ _intersectsWith: function(item) {
+
+ var x1 = this.positionAbs.left,
+ x2 = x1 + this.helperProportions.width,
+ y1 = this.positionAbs.top,
+ y2 = y1 + this.helperProportions.height,
+ l = item.left,
+ r = l + item.width,
+ t = item.top,
+ b = t + item.height,
+ dyClick = this.offset.click.top,
+ dxClick = this.offset.click.left,
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
+
+ if ( this.options.tolerance === "pointer" ||
+ this.options.forcePointerForContainers ||
+ (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
+ ) {
+ return isOverElement;
+ } else {
+
+ return (l < x1 + (this.helperProportions.width / 2) && // Right Half
+ x2 - (this.helperProportions.width / 2) < r && // Left Half
+ t < y1 + (this.helperProportions.height / 2) && // Bottom Half
+ y2 - (this.helperProportions.height / 2) < b ); // Top Half
+
+ }
+ },
+
+ _intersectsWithPointer: function(item) {
+
+ var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+ isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+ isOverElement = isOverElementHeight && isOverElementWidth,
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (!isOverElement) {
+ return false;
+ }
+
+ return this.floating ?
+ ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
+ : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
+
+ },
+
+ _intersectsWithSides: function(item) {
+
+ var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+ isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (this.floating && horizontalDirection) {
+ return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
+ } else {
+ return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
+ }
+
+ },
+
+ _getDragVerticalDirection: function() {
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
+ return delta !== 0 && (delta > 0 ? "down" : "up");
+ },
+
+ _getDragHorizontalDirection: function() {
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
+ return delta !== 0 && (delta > 0 ? "right" : "left");
+ },
+
+ refresh: function(event) {
+ this._refreshItems(event);
+ this._setHandleClassName();
+ this.refreshPositions();
+ return this;
+ },
+
+ _connectWith: function() {
+ var options = this.options;
+ return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
+ },
+
+ _getItemsAsjQuery: function(connected) {
+
+ var i, j, cur, inst,
+ items = [],
+ queries = [],
+ connectWith = this._connectWith();
+
+ if(connectWith && connected) {
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i], this.document[0]);
+ for ( j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
+ }
+ }
+ }
+ }
+
+ queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
+
+ function addItems() {
+ items.push( this );
+ }
+ for (i = queries.length - 1; i >= 0; i--){
+ queries[i][0].each( addItems );
+ }
+
+ return $(items);
+
+ },
+
+ _removeCurrentsFromItems: function() {
+
+ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
+
+ this.items = $.grep(this.items, function (item) {
+ for (var j=0; j < list.length; j++) {
+ if(list[j] === item.item[0]) {
+ return false;
+ }
+ }
+ return true;
+ });
+
+ },
+
+ _refreshItems: function(event) {
+
+ this.items = [];
+ this.containers = [this];
+
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
+ items = this.items,
+ queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
+ connectWith = this._connectWith();
+
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i], this.document[0]);
+ for (j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
+ this.containers.push(inst);
+ }
+ }
+ }
+ }
+
+ for (i = queries.length - 1; i >= 0; i--) {
+ targetData = queries[i][1];
+ _queries = queries[i][0];
+
+ for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
+ item = $(_queries[j]);
+
+ item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
+
+ items.push({
+ item: item,
+ instance: targetData,
+ width: 0, height: 0,
+ left: 0, top: 0
+ });
+ }
+ }
+
+ },
+
+ refreshPositions: function(fast) {
+
+ // Determine whether items are being displayed horizontally
+ this.floating = this.items.length ?
+ this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
+ false;
+
+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
+ if(this.offsetParent && this.helper) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ var i, item, t, p;
+
+ for (i = this.items.length - 1; i >= 0; i--){
+ item = this.items[i];
+
+ //We ignore calculating positions of all connected containers when we're not over them
+ if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
+ continue;
+ }
+
+ t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
+
+ if (!fast) {
+ item.width = t.outerWidth();
+ item.height = t.outerHeight();
+ }
+
+ p = t.offset();
+ item.left = p.left;
+ item.top = p.top;
+ }
+
+ if(this.options.custom && this.options.custom.refreshContainers) {
+ this.options.custom.refreshContainers.call(this);
+ } else {
+ for (i = this.containers.length - 1; i >= 0; i--){
+ p = this.containers[i].element.offset();
+ this.containers[i].containerCache.left = p.left;
+ this.containers[i].containerCache.top = p.top;
+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
+ }
+ }
+
+ return this;
+ },
+
+ _createPlaceholder: function(that) {
+ that = that || this;
+ var className,
+ o = that.options;
+
+ if(!o.placeholder || o.placeholder.constructor === String) {
+ className = o.placeholder;
+ o.placeholder = {
+ element: function() {
+
+ var nodeName = that.currentItem[0].nodeName.toLowerCase(),
+ element = $( "<" + nodeName + ">", that.document[0] )
+ .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
+ .removeClass("ui-sortable-helper");
+
+ if ( nodeName === "tbody" ) {
+ that._createTrPlaceholder(
+ that.currentItem.find( "tr" ).eq( 0 ),
+ $( "<tr>", that.document[ 0 ] ).appendTo( element )
+ );
+ } else if ( nodeName === "tr" ) {
+ that._createTrPlaceholder( that.currentItem, element );
+ } else if ( nodeName === "img" ) {
+ element.attr( "src", that.currentItem.attr( "src" ) );
+ }
+
+ if ( !className ) {
+ element.css( "visibility", "hidden" );
+ }
+
+ return element;
+ },
+ update: function(container, p) {
+
+ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
+ if(className && !o.forcePlaceholderSize) {
+ return;
+ }
+
+ //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
+ if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
+ if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
+ }
+ };
+ }
+
+ //Create the placeholder
+ that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
+
+ //Append it after the actual current item
+ that.currentItem.after(that.placeholder);
+
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
+ o.placeholder.update(that, that.placeholder);
+
+ },
+
+ _createTrPlaceholder: function( sourceTr, targetTr ) {
+ var that = this;
+
+ sourceTr.children().each(function() {
+ $( "<td>&#160;</td>", that.document[ 0 ] )
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+ .appendTo( targetTr );
+ });
+ },
+
+ _contactContainers: function(event) {
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
+ innermostContainer = null,
+ innermostIndex = null;
+
+ // get innermost container that intersects with item
+ for (i = this.containers.length - 1; i >= 0; i--) {
+
+ // never consider a container that's located within the item itself
+ if($.contains(this.currentItem[0], this.containers[i].element[0])) {
+ continue;
+ }
+
+ if(this._intersectsWith(this.containers[i].containerCache)) {
+
+ // if we've already found a container and it's more "inner" than this, then continue
+ if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
+ continue;
+ }
+
+ innermostContainer = this.containers[i];
+ innermostIndex = i;
+
+ } else {
+ // container doesn't intersect. trigger "out" event if necessary
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", event, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ // if no intersecting containers found, return
+ if(!innermostContainer) {
+ return;
+ }
+
+ // move the item into the container if it's not there already
+ if(this.containers.length === 1) {
+ if (!this.containers[innermostIndex].containerCache.over) {
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+ } else {
+
+ //When entering a new container, we will find the item with the least distance and append our item near it
+ dist = 10000;
+ itemWithLeastDistance = null;
+ floating = innermostContainer.floating || this._isFloating(this.currentItem);
+ posProperty = floating ? "left" : "top";
+ sizeProperty = floating ? "width" : "height";
+ axis = floating ? "clientX" : "clientY";
+
+ for (j = this.items.length - 1; j >= 0; j--) {
+ if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
+ continue;
+ }
+ if(this.items[j].item[0] === this.currentItem[0]) {
+ continue;
+ }
+
+ cur = this.items[j].item.offset()[posProperty];
+ nearBottom = false;
+ if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
+ nearBottom = true;
+ }
+
+ if ( Math.abs( event[ axis ] - cur ) < dist ) {
+ dist = Math.abs( event[ axis ] - cur );
+ itemWithLeastDistance = this.items[ j ];
+ this.direction = nearBottom ? "up": "down";
+ }
+ }
+
+ //Check if dropOnEmpty is enabled
+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
+ return;
+ }
+
+ if(this.currentContainer === this.containers[innermostIndex]) {
+ if ( !this.currentContainer.containerCache.over ) {
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
+ this.currentContainer.containerCache.over = 1;
+ }
+ return;
+ }
+
+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
+ this._trigger("change", event, this._uiHash());
+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
+ this.currentContainer = this.containers[innermostIndex];
+
+ //Update the placeholder
+ this.options.placeholder.update(this.currentContainer, this.placeholder);
+
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
+
+ //Add the helper to the DOM if that didn't happen already
+ if(!helper.parents("body").length) {
+ $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
+ }
+
+ if(helper[0] === this.currentItem[0]) {
+ this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
+ }
+
+ if(!helper[0].style.width || o.forceHelperSize) {
+ helper.width(this.currentItem.width());
+ }
+ if(!helper[0].style.height || o.forceHelperSize) {
+ helper.height(this.currentItem.height());
+ }
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = {left: +obj[0], top: +obj[1] || 0};
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ // This needs to be actually done for all browsers, since pageX/pageY includes this information
+ // with an ugly IE fix
+ if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition === "relative") {
+ var p = this.currentItem.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var ce, co, over,
+ o = this.options;
+ if(o.containment === "parent") {
+ o.containment = this.helper[0].parentNode;
+ }
+ if(o.containment === "document" || o.containment === "window") {
+ this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
+ (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ if(!(/^(document|window|parent)$/).test(o.containment)) {
+ ce = $(o.containment)[0];
+ co = $(o.containment).offset();
+ over = ($(ce).css("overflow") !== "hidden");
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) {
+ pos = this.position;
+ }
+ var mod = d === "absolute" ? 1 : -1,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
+ scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var top, left,
+ o = this.options,
+ pageX = event.pageX,
+ pageY = event.pageY,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) {
+ pageX = this.containment[0] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top < this.containment[1]) {
+ pageY = this.containment[1] + this.offset.click.top;
+ }
+ if(event.pageX - this.offset.click.left > this.containment[2]) {
+ pageX = this.containment[2] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top > this.containment[3]) {
+ pageY = this.containment[3] + this.offset.click.top;
+ }
+ }
+
+ if(o.grid) {
+ top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _rearrange: function(event, i, a, hardRefresh) {
+
+ a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
+
+ //Various things done here to improve the performance:
+ // 1. we create a setTimeout, that calls refreshPositions
+ // 2. on the instance, we have a counter variable, that get's higher after every append
+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
+ // 4. this lets only the last addition to the timeout stack through
+ this.counter = this.counter ? ++this.counter : 1;
+ var counter = this.counter;
+
+ this._delay(function() {
+ if(counter === this.counter) {
+ this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
+ }
+ });
+
+ },
+
+ _clear: function(event, noPropagation) {
+
+ this.reverting = false;
+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and
+ // everything else normalized again
+ var i,
+ delayedTriggers = [];
+
+ // We first have to update the dom position of the actual currentItem
+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
+ if(!this._noFinalSort && this.currentItem.parent().length) {
+ this.placeholder.before(this.currentItem);
+ }
+ this._noFinalSort = null;
+
+ if(this.helper[0] === this.currentItem[0]) {
+ for(i in this._storedCSS) {
+ if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
+ this._storedCSS[i] = "";
+ }
+ }
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ if(this.fromOutside && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
+ }
+ if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
+ }
+
+ // Check if the items Container has Changed and trigger appropriate
+ // events.
+ if (this !== this.currentContainer) {
+ if(!noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ }
+ }
+
+
+ //Post events to containers
+ function delayEvent( type, instance, container ) {
+ return function( event ) {
+ container._trigger( type, event, instance._uiHash( instance ) );
+ };
+ }
+ for (i = this.containers.length - 1; i >= 0; i--){
+ if (!noPropagation) {
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
+ }
+ if(this.containers[i].containerCache.over) {
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ //Do what was originally in plugins
+ if ( this.storedCursor ) {
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
+ this.storedStylesheet.remove();
+ }
+ if(this._storedOpacity) {
+ this.helper.css("opacity", this._storedOpacity);
+ }
+ if(this._storedZIndex) {
+ this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
+ }
+
+ this.dragging = false;
+
+ if(!noPropagation) {
+ this._trigger("beforeStop", event, this._uiHash());
+ }
+
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+
+ if ( !this.cancelHelperRemoval ) {
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ }
+
+ if(!noPropagation) {
+ for (i=0; i < delayedTriggers.length; i++) {
+ delayedTriggers[i].call(this, event);
+ } //Trigger all delayed events
+ this._trigger("stop", event, this._uiHash());
+ }
+
+ this.fromOutside = false;
+ return !this.cancelHelperRemoval;
+
+ },
+
+ _trigger: function() {
+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
+ this.cancel();
+ }
+ },
+
+ _uiHash: function(_inst) {
+ var inst = _inst || this;
+ return {
+ helper: inst.helper,
+ placeholder: inst.placeholder || $([]),
+ position: inst.position,
+ originalPosition: inst.originalPosition,
+ offset: inst.positionAbs,
+ item: inst.currentItem,
+ sender: _inst ? _inst.element : null
+ };
+ }
+
+});
+
+
+/*!
+ * jQuery UI Accordion 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/accordion/
+ */
+
+
+var accordion = $.widget( "ui.accordion", {
+ version: "1.11.4",
+ options: {
+ active: 0,
+ animate: {},
+ collapsible: false,
+ event: "click",
+ header: "> li > :first-child,> :not(li):even",
+ heightStyle: "auto",
+ icons: {
+ activeHeader: "ui-icon-triangle-1-s",
+ header: "ui-icon-triangle-1-e"
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null
+ },
+
+ hideProps: {
+ borderTopWidth: "hide",
+ borderBottomWidth: "hide",
+ paddingTop: "hide",
+ paddingBottom: "hide",
+ height: "hide"
+ },
+
+ showProps: {
+ borderTopWidth: "show",
+ borderBottomWidth: "show",
+ paddingTop: "show",
+ paddingBottom: "show",
+ height: "show"
+ },
+
+ _create: function() {
+ var options = this.options;
+ this.prevShow = this.prevHide = $();
+ this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
+ // ARIA
+ .attr( "role", "tablist" );
+
+ // don't allow collapsible: false and active: false / null
+ if ( !options.collapsible && (options.active === false || options.active == null) ) {
+ options.active = 0;
+ }
+
+ this._processPanels();
+ // handle negative values
+ if ( options.active < 0 ) {
+ options.active += this.headers.length;
+ }
+ this._refresh();
+ },
+
+ _getCreateEventData: function() {
+ return {
+ header: this.active,
+ panel: !this.active.length ? $() : this.active.next()
+ };
+ },
+
+ _createIcons: function() {
+ var icons = this.options.icons;
+ if ( icons ) {
+ $( "<span>" )
+ .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
+ .prependTo( this.headers );
+ this.active.children( ".ui-accordion-header-icon" )
+ .removeClass( icons.header )
+ .addClass( icons.activeHeader );
+ this.headers.addClass( "ui-accordion-icons" );
+ }
+ },
+
+ _destroyIcons: function() {
+ this.headers
+ .removeClass( "ui-accordion-icons" )
+ .children( ".ui-accordion-header-icon" )
+ .remove();
+ },
+
+ _destroy: function() {
+ var contents;
+
+ // clean up main element
+ this.element
+ .removeClass( "ui-accordion ui-widget ui-helper-reset" )
+ .removeAttr( "role" );
+
+ // clean up headers
+ this.headers
+ .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
+ "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-controls" )
+ .removeAttr( "tabIndex" )
+ .removeUniqueId();
+
+ this._destroyIcons();
+
+ // clean up content panels
+ contents = this.headers.next()
+ .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
+ "ui-accordion-content ui-accordion-content-active ui-state-disabled" )
+ .css( "display", "" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-labelledby" )
+ .removeUniqueId();
+
+ if ( this.options.heightStyle !== "content" ) {
+ contents.css( "height", "" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "event" ) {
+ if ( this.options.event ) {
+ this._off( this.headers, this.options.event );
+ }
+ this._setupEvents( value );
+ }
+
+ this._super( key, value );
+
+ // setting collapsible: false while collapsed; open first panel
+ if ( key === "collapsible" && !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+
+ if ( key === "icons" ) {
+ this._destroyIcons();
+ if ( value ) {
+ this._createIcons();
+ }
+ }
+
+ // #5332 - opacity doesn't cascade to positioned elements in IE
+ // so we need to add the disabled class to the headers and panels
+ if ( key === "disabled" ) {
+ this.element
+ .toggleClass( "ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ this.headers.add( this.headers.next() )
+ .toggleClass( "ui-state-disabled", !!value );
+ }
+ },
+
+ _keydown: function( event ) {
+ if ( event.altKey || event.ctrlKey ) {
+ return;
+ }
+
+ var keyCode = $.ui.keyCode,
+ length = this.headers.length,
+ currentIndex = this.headers.index( event.target ),
+ toFocus = false;
+
+ switch ( event.keyCode ) {
+ case keyCode.RIGHT:
+ case keyCode.DOWN:
+ toFocus = this.headers[ ( currentIndex + 1 ) % length ];
+ break;
+ case keyCode.LEFT:
+ case keyCode.UP:
+ toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
+ break;
+ case keyCode.SPACE:
+ case keyCode.ENTER:
+ this._eventHandler( event );
+ break;
+ case keyCode.HOME:
+ toFocus = this.headers[ 0 ];
+ break;
+ case keyCode.END:
+ toFocus = this.headers[ length - 1 ];
+ break;
+ }
+
+ if ( toFocus ) {
+ $( event.target ).attr( "tabIndex", -1 );
+ $( toFocus ).attr( "tabIndex", 0 );
+ toFocus.focus();
+ event.preventDefault();
+ }
+ },
+
+ _panelKeyDown: function( event ) {
+ if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
+ $( event.currentTarget ).prev().focus();
+ }
+ },
+
+ refresh: function() {
+ var options = this.options;
+ this._processPanels();
+
+ // was collapsed or no panel
+ if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
+ options.active = false;
+ this.active = $();
+ // active false only when collapsible is true
+ } else if ( options.active === false ) {
+ this._activate( 0 );
+ // was active, but active panel is gone
+ } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining panel are disabled
+ if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous panel
+ } else {
+ this._activate( Math.max( 0, options.active - 1 ) );
+ }
+ // was active, active panel still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.headers.index( this.active );
+ }
+
+ this._destroyIcons();
+
+ this._refresh();
+ },
+
+ _processPanels: function() {
+ var prevHeaders = this.headers,
+ prevPanels = this.panels;
+
+ this.headers = this.element.find( this.options.header )
+ .addClass( "ui-accordion-header ui-state-default ui-corner-all" );
+
+ this.panels = this.headers.next()
+ .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
+ .filter( ":not(.ui-accordion-content-active)" )
+ .hide();
+
+ // Avoid memory leaks (#10056)
+ if ( prevPanels ) {
+ this._off( prevHeaders.not( this.headers ) );
+ this._off( prevPanels.not( this.panels ) );
+ }
+ },
+
+ _refresh: function() {
+ var maxHeight,
+ options = this.options,
+ heightStyle = options.heightStyle,
+ parent = this.element.parent();
+
+ this.active = this._findActive( options.active )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
+ .removeClass( "ui-corner-all" );
+ this.active.next()
+ .addClass( "ui-accordion-content-active" )
+ .show();
+
+ this.headers
+ .attr( "role", "tab" )
+ .each(function() {
+ var header = $( this ),
+ headerId = header.uniqueId().attr( "id" ),
+ panel = header.next(),
+ panelId = panel.uniqueId().attr( "id" );
+ header.attr( "aria-controls", panelId );
+ panel.attr( "aria-labelledby", headerId );
+ })
+ .next()
+ .attr( "role", "tabpanel" );
+
+ this.headers
+ .not( this.active )
+ .attr({
+ "aria-selected": "false",
+ "aria-expanded": "false",
+ tabIndex: -1
+ })
+ .next()
+ .attr({
+ "aria-hidden": "true"
+ })
+ .hide();
+
+ // make sure at least one header is in the tab order
+ if ( !this.active.length ) {
+ this.headers.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active.attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ })
+ .next()
+ .attr({
+ "aria-hidden": "false"
+ });
+ }
+
+ this._createIcons();
+
+ this._setupEvents( options.event );
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.headers.each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.headers.next()
+ .each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.headers.next()
+ .each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
+ })
+ .height( maxHeight );
+ }
+ },
+
+ _activate: function( index ) {
+ var active = this._findActive( index )[ 0 ];
+
+ // trying to activate the already active panel
+ if ( active === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the currently active header
+ active = active || this.active[ 0 ];
+
+ this._eventHandler({
+ target: active,
+ currentTarget: active,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( selector ) {
+ return typeof selector === "number" ? this.headers.eq( selector ) : $();
+ },
+
+ _setupEvents: function( event ) {
+ var events = {
+ keydown: "_keydown"
+ };
+ if ( event ) {
+ $.each( event.split( " " ), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.headers.add( this.headers.next() ) );
+ this._on( this.headers, events );
+ this._on( this.headers.next(), { keydown: "_panelKeyDown" });
+ this._hoverable( this.headers );
+ this._focusable( this.headers );
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ clicked = $( event.currentTarget ),
+ clickedIsActive = clicked[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : clicked.next(),
+ toHide = active.next(),
+ eventData = {
+ oldHeader: active,
+ oldPanel: toHide,
+ newHeader: collapsing ? $() : clicked,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if (
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.headers.index( clicked );
+
+ // when the call to ._toggle() comes after the class changes
+ // it causes a very odd bug in IE 8 (see #6720)
+ this.active = clickedIsActive ? $() : clicked;
+ this._toggle( eventData );
+
+ // switch classes
+ // corner classes on the previously active header stay after the animation
+ active.removeClass( "ui-accordion-header-active ui-state-active" );
+ if ( options.icons ) {
+ active.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.activeHeader )
+ .addClass( options.icons.header );
+ }
+
+ if ( !clickedIsActive ) {
+ clicked
+ .removeClass( "ui-corner-all" )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
+ if ( options.icons ) {
+ clicked.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.header )
+ .addClass( options.icons.activeHeader );
+ }
+
+ clicked
+ .next()
+ .addClass( "ui-accordion-content-active" );
+ }
+ },
+
+ _toggle: function( data ) {
+ var toShow = data.newPanel,
+ toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
+
+ // handle activating a panel during the animation for another activation
+ this.prevShow.add( this.prevHide ).stop( true, true );
+ this.prevShow = toShow;
+ this.prevHide = toHide;
+
+ if ( this.options.animate ) {
+ this._animate( toShow, toHide, data );
+ } else {
+ toHide.hide();
+ toShow.show();
+ this._toggleComplete( data );
+ }
+
+ toHide.attr({
+ "aria-hidden": "true"
+ });
+ toHide.prev().attr({
+ "aria-selected": "false",
+ "aria-expanded": "false"
+ });
+ // if we're switching panels, remove the old header from the tab order
+ // if we're opening from collapsed state, remove the previous header from the tab order
+ // if we're collapsing, then keep the collapsing header in the tab order
+ if ( toShow.length && toHide.length ) {
+ toHide.prev().attr({
+ "tabIndex": -1,
+ "aria-expanded": "false"
+ });
+ } else if ( toShow.length ) {
+ this.headers.filter(function() {
+ return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow
+ .attr( "aria-hidden", "false" )
+ .prev()
+ .attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ },
+
+ _animate: function( toShow, toHide, data ) {
+ var total, easing, duration,
+ that = this,
+ adjust = 0,
+ boxSizing = toShow.css( "box-sizing" ),
+ down = toShow.length &&
+ ( !toHide.length || ( toShow.index() < toHide.index() ) ),
+ animate = this.options.animate || {},
+ options = down && animate.down || animate,
+ complete = function() {
+ that._toggleComplete( data );
+ };
+
+ if ( typeof options === "number" ) {
+ duration = options;
+ }
+ if ( typeof options === "string" ) {
+ easing = options;
+ }
+ // fall back from options to animation in case of partial down settings
+ easing = easing || options.easing || animate.easing;
+ duration = duration || options.duration || animate.duration;
+
+ if ( !toHide.length ) {
+ return toShow.animate( this.showProps, duration, easing, complete );
+ }
+ if ( !toShow.length ) {
+ return toHide.animate( this.hideProps, duration, easing, complete );
+ }
+
+ total = toShow.show().outerHeight();
+ toHide.animate( this.hideProps, {
+ duration: duration,
+ easing: easing,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ }
+ });
+ toShow
+ .hide()
+ .animate( this.showProps, {
+ duration: duration,
+ easing: easing,
+ complete: complete,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ if ( fx.prop !== "height" ) {
+ if ( boxSizing === "content-box" ) {
+ adjust += fx.now;
+ }
+ } else if ( that.options.heightStyle !== "content" ) {
+ fx.now = Math.round( total - toHide.outerHeight() - adjust );
+ adjust = 0;
+ }
+ }
+ });
+ },
+
+ _toggleComplete: function( data ) {
+ var toHide = data.oldPanel;
+
+ toHide
+ .removeClass( "ui-accordion-content-active" )
+ .prev()
+ .removeClass( "ui-corner-top" )
+ .addClass( "ui-corner-all" );
+
+ // Work around for rendering bug in IE (#5421)
+ if ( toHide.length ) {
+ toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
+ }
+ this._trigger( "activate", null, data );
+ }
+});
+
+
+/*!
+ * jQuery UI Menu 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/menu/
+ */
+
+
+var menu = $.widget( "ui.menu", {
+ version: "1.11.4",
+ defaultElement: "<ul>",
+ delay: 300,
+ options: {
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ },
+ items: "> *",
+ menus: "ul",
+ position: {
+ my: "left-1 top",
+ at: "right top"
+ },
+ role: "menu",
+
+ // callbacks
+ blur: null,
+ focus: null,
+ select: null
+ },
+
+ _create: function() {
+ this.activeMenu = this.element;
+
+ // Flag used to prevent firing of the click handler
+ // as the event bubbles up through nested menus
+ this.mouseHandled = false;
+ this.element
+ .uniqueId()
+ .addClass( "ui-menu ui-widget ui-widget-content" )
+ .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
+ .attr({
+ role: this.options.role,
+ tabIndex: 0
+ });
+
+ if ( this.options.disabled ) {
+ this.element
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ }
+
+ this._on({
+ // Prevent focus from sticking to links inside menu after clicking
+ // them (focus should always stay on UL during navigation).
+ "mousedown .ui-menu-item": function( event ) {
+ event.preventDefault();
+ },
+ "click .ui-menu-item": function( event ) {
+ var target = $( event.target );
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+ this.select( event );
+
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
+ if ( !event.isPropagationStopped() ) {
+ this.mouseHandled = true;
+ }
+
+ // Open submenu on click
+ if ( target.has( ".ui-menu" ).length ) {
+ this.expand( event );
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
+ // Redirect focus to the menu
+ this.element.trigger( "focus", [ true ] );
+
+ // If the active item is on the top level, let it stay active.
+ // Otherwise, blur the active item since it is no longer visible.
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+ clearTimeout( this.timer );
+ }
+ }
+ }
+ },
+ "mouseenter .ui-menu-item": function( event ) {
+ // Ignore mouse events while typeahead is active, see #10458.
+ // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
+ // is over an item in the menu
+ if ( this.previousFilter ) {
+ return;
+ }
+ var target = $( event.currentTarget );
+ // Remove ui-state-active class from siblings of the newly focused menu item
+ // to avoid a jump caused by adjacent elements both having a class with a border
+ target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
+ this.focus( event, target );
+ },
+ mouseleave: "collapseAll",
+ "mouseleave .ui-menu": "collapseAll",
+ focus: function( event, keepActiveItem ) {
+ // If there's already an active item, keep it active
+ // If not, activate the first item
+ var item = this.active || this.element.find( this.options.items ).eq( 0 );
+
+ if ( !keepActiveItem ) {
+ this.focus( event, item );
+ }
+ },
+ blur: function( event ) {
+ this._delay(function() {
+ if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
+ this.collapseAll( event );
+ }
+ });
+ },
+ keydown: "_keydown"
+ });
+
+ this.refresh();
+
+ // Clicks outside of a menu collapse any open menus
+ this._on( this.document, {
+ click: function( event ) {
+ if ( this._closeOnDocumentClick( event ) ) {
+ this.collapseAll( event );
+ }
+
+ // Reset the mouseHandled flag
+ this.mouseHandled = false;
+ }
+ });
+ },
+
+ _destroy: function() {
+ // Destroy (sub)menus
+ this.element
+ .removeAttr( "aria-activedescendant" )
+ .find( ".ui-menu" ).addBack()
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-disabled" )
+ .removeUniqueId()
+ .show();
+
+ // Destroy menu items
+ this.element.find( ".ui-menu-item" )
+ .removeClass( "ui-menu-item" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-disabled" )
+ .removeUniqueId()
+ .removeClass( "ui-state-hover" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-haspopup" )
+ .children().each( function() {
+ var elem = $( this );
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
+ elem.remove();
+ }
+ });
+
+ // Destroy menu dividers
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+ },
+
+ _keydown: function( event ) {
+ var match, prev, character, skip,
+ preventDefault = true;
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.PAGE_UP:
+ this.previousPage( event );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ this.nextPage( event );
+ break;
+ case $.ui.keyCode.HOME:
+ this._move( "first", "first", event );
+ break;
+ case $.ui.keyCode.END:
+ this._move( "last", "last", event );
+ break;
+ case $.ui.keyCode.UP:
+ this.previous( event );
+ break;
+ case $.ui.keyCode.DOWN:
+ this.next( event );
+ break;
+ case $.ui.keyCode.LEFT:
+ this.collapse( event );
+ break;
+ case $.ui.keyCode.RIGHT:
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+ this.expand( event );
+ }
+ break;
+ case $.ui.keyCode.ENTER:
+ case $.ui.keyCode.SPACE:
+ this._activate( event );
+ break;
+ case $.ui.keyCode.ESCAPE:
+ this.collapse( event );
+ break;
+ default:
+ preventDefault = false;
+ prev = this.previousFilter || "";
+ character = String.fromCharCode( event.keyCode );
+ skip = false;
+
+ clearTimeout( this.filterTimer );
+
+ if ( character === prev ) {
+ skip = true;
+ } else {
+ character = prev + character;
+ }
+
+ match = this._filterMenuItems( character );
+ match = skip && match.index( this.active.next() ) !== -1 ?
+ this.active.nextAll( ".ui-menu-item" ) :
+ match;
+
+ // If no matches on the current filter, reset to the last character pressed
+ // to move down the menu to the first item that starts with that character
+ if ( !match.length ) {
+ character = String.fromCharCode( event.keyCode );
+ match = this._filterMenuItems( character );
+ }
+
+ if ( match.length ) {
+ this.focus( event, match );
+ this.previousFilter = character;
+ this.filterTimer = this._delay(function() {
+ delete this.previousFilter;
+ }, 1000 );
+ } else {
+ delete this.previousFilter;
+ }
+ }
+
+ if ( preventDefault ) {
+ event.preventDefault();
+ }
+ },
+
+ _activate: function( event ) {
+ if ( !this.active.is( ".ui-state-disabled" ) ) {
+ if ( this.active.is( "[aria-haspopup='true']" ) ) {
+ this.expand( event );
+ } else {
+ this.select( event );
+ }
+ }
+ },
+
+ refresh: function() {
+ var menus, items,
+ that = this,
+ icon = this.options.icons.submenu,
+ submenus = this.element.find( this.options.menus );
+
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
+ // Initialize nested menus
+ submenus.filter( ":not(.ui-menu)" )
+ .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
+ .hide()
+ .attr({
+ role: this.options.role,
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ })
+ .each(function() {
+ var menu = $( this ),
+ item = menu.parent(),
+ submenuCarat = $( "<span>" )
+ .addClass( "ui-menu-icon ui-icon " + icon )
+ .data( "ui-menu-submenu-carat", true );
+
+ item
+ .attr( "aria-haspopup", "true" )
+ .prepend( submenuCarat );
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
+ });
+
+ menus = submenus.add( this.element );
+ items = menus.find( this.options.items );
+
+ // Initialize menu-items containing spaces and/or dashes only as dividers
+ items.not( ".ui-menu-item" ).each(function() {
+ var item = $( this );
+ if ( that._isDivider( item ) ) {
+ item.addClass( "ui-widget-content ui-menu-divider" );
+ }
+ });
+
+ // Don't refresh list items that are already adapted
+ items.not( ".ui-menu-item, .ui-menu-divider" )
+ .addClass( "ui-menu-item" )
+ .uniqueId()
+ .attr({
+ tabIndex: -1,
+ role: this._itemRole()
+ });
+
+ // Add aria-disabled attribute to any disabled menu item
+ items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+ // If the active item has been removed, blur the menu
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ this.blur();
+ }
+ },
+
+ _itemRole: function() {
+ return {
+ menu: "menuitem",
+ listbox: "option"
+ }[ this.options.role ];
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ this.element.find( ".ui-menu-icon" )
+ .removeClass( this.options.icons.submenu )
+ .addClass( value.submenu );
+ }
+ if ( key === "disabled" ) {
+ this.element
+ .toggleClass( "ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ }
+ this._super( key, value );
+ },
+
+ focus: function( event, item ) {
+ var nested, focused;
+ this.blur( event, event && event.type === "focus" );
+
+ this._scrollIntoView( item );
+
+ this.active = item.first();
+ focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
+ // Only update aria-activedescendant if there's a role
+ // otherwise we assume focus is managed elsewhere
+ if ( this.options.role ) {
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
+ }
+
+ // Highlight active parent menu item, if any
+ this.active
+ .parent()
+ .closest( ".ui-menu-item" )
+ .addClass( "ui-state-active" );
+
+ if ( event && event.type === "keydown" ) {
+ this._close();
+ } else {
+ this.timer = this._delay(function() {
+ this._close();
+ }, this.delay );
+ }
+
+ nested = item.children( ".ui-menu" );
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+ this._startOpening(nested);
+ }
+ this.activeMenu = item.parent();
+
+ this._trigger( "focus", event, { item: item } );
+ },
+
+ _scrollIntoView: function( item ) {
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+ if ( this._hasScroll() ) {
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+ scroll = this.activeMenu.scrollTop();
+ elementHeight = this.activeMenu.height();
+ itemHeight = item.outerHeight();
+
+ if ( offset < 0 ) {
+ this.activeMenu.scrollTop( scroll + offset );
+ } else if ( offset + itemHeight > elementHeight ) {
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+ }
+ }
+ },
+
+ blur: function( event, fromFocus ) {
+ if ( !fromFocus ) {
+ clearTimeout( this.timer );
+ }
+
+ if ( !this.active ) {
+ return;
+ }
+
+ this.active.removeClass( "ui-state-focus" );
+ this.active = null;
+
+ this._trigger( "blur", event, { item: this.active } );
+ },
+
+ _startOpening: function( submenu ) {
+ clearTimeout( this.timer );
+
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
+ // shift in the submenu position when mousing over the carat icon
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
+ return;
+ }
+
+ this.timer = this._delay(function() {
+ this._close();
+ this._open( submenu );
+ }, this.delay );
+ },
+
+ _open: function( submenu ) {
+ var position = $.extend({
+ of: this.active
+ }, this.options.position );
+
+ clearTimeout( this.timer );
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+ .hide()
+ .attr( "aria-hidden", "true" );
+
+ submenu
+ .show()
+ .removeAttr( "aria-hidden" )
+ .attr( "aria-expanded", "true" )
+ .position( position );
+ },
+
+ collapseAll: function( event, all ) {
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ // If we were passed an event, look for the submenu that contains the event
+ var currentMenu = all ? this.element :
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+ if ( !currentMenu.length ) {
+ currentMenu = this.element;
+ }
+
+ this._close( currentMenu );
+
+ this.blur( event );
+ this.activeMenu = currentMenu;
+ }, this.delay );
+ },
+
+ // With no arguments, closes the currently active menu - if nothing is active
+ // it closes all menus. If passed an argument, it will search for menus BELOW
+ _close: function( startMenu ) {
+ if ( !startMenu ) {
+ startMenu = this.active ? this.active.parent() : this.element;
+ }
+
+ startMenu
+ .find( ".ui-menu" )
+ .hide()
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" )
+ .end()
+ .find( ".ui-state-active" ).not( ".ui-state-focus" )
+ .removeClass( "ui-state-active" );
+ },
+
+ _closeOnDocumentClick: function( event ) {
+ return !$( event.target ).closest( ".ui-menu" ).length;
+ },
+
+ _isDivider: function( item ) {
+
+ // Match hyphen, em dash, en dash
+ return !/[^\-\u2014\u2013\s]/.test( item.text() );
+ },
+
+ collapse: function( event ) {
+ var newItem = this.active &&
+ this.active.parent().closest( ".ui-menu-item", this.element );
+ if ( newItem && newItem.length ) {
+ this._close();
+ this.focus( event, newItem );
+ }
+ },
+
+ expand: function( event ) {
+ var newItem = this.active &&
+ this.active
+ .children( ".ui-menu " )
+ .find( this.options.items )
+ .first();
+
+ if ( newItem && newItem.length ) {
+ this._open( newItem.parent() );
+
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+ this._delay(function() {
+ this.focus( event, newItem );
+ });
+ }
+ },
+
+ next: function( event ) {
+ this._move( "next", "first", event );
+ },
+
+ previous: function( event ) {
+ this._move( "prev", "last", event );
+ },
+
+ isFirstItem: function() {
+ return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
+ },
+
+ isLastItem: function() {
+ return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
+ },
+
+ _move: function( direction, filter, event ) {
+ var next;
+ if ( this.active ) {
+ if ( direction === "first" || direction === "last" ) {
+ next = this.active
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+ .eq( -1 );
+ } else {
+ next = this.active
+ [ direction + "All" ]( ".ui-menu-item" )
+ .eq( 0 );
+ }
+ }
+ if ( !next || !next.length || !this.active ) {
+ next = this.activeMenu.find( this.options.items )[ filter ]();
+ }
+
+ this.focus( event, next );
+ },
+
+ nextPage: function( event ) {
+ var item, base, height;
+
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isLastItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.nextAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base - height < 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items )
+ [ !this.active ? "first" : "last" ]() );
+ }
+ },
+
+ previousPage: function( event ) {
+ var item, base, height;
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isFirstItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.prevAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base + height > 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items ).first() );
+ }
+ },
+
+ _hasScroll: function() {
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+ },
+
+ select: function( event ) {
+ // TODO: It should never be possible to not have an active item at this
+ // point, but the tests don't trigger mouseenter before click.
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+ var ui = { item: this.active };
+ if ( !this.active.has( ".ui-menu" ).length ) {
+ this.collapseAll( event, true );
+ }
+ this._trigger( "select", event, ui );
+ },
+
+ _filterMenuItems: function(character) {
+ var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
+ regex = new RegExp( "^" + escapedCharacter, "i" );
+
+ return this.activeMenu
+ .find( this.options.items )
+
+ // Only match on items, not dividers or other content (#10571)
+ .filter( ".ui-menu-item" )
+ .filter(function() {
+ return regex.test( $.trim( $( this ).text() ) );
+ });
+ }
+});
+
+
+/*!
+ * jQuery UI Autocomplete 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/autocomplete/
+ */
+
+
+$.widget( "ui.autocomplete", {
+ version: "1.11.4",
+ defaultElement: "<input>",
+ options: {
+ appendTo: null,
+ autoFocus: false,
+ delay: 300,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ },
+
+ requestIndex: 0,
+ pending: 0,
+
+ _create: function() {
+ // Some browsers only repeat keydown events, not keypress events,
+ // so we use the suppressKeyPress flag to determine if we've already
+ // handled the keydown event. #7269
+ // Unfortunately the code for & in keypress is the same as the up arrow,
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+ // events when we know the keydown event was used to modify the
+ // search term. #7799
+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+ nodeName = this.element[ 0 ].nodeName.toLowerCase(),
+ isTextarea = nodeName === "textarea",
+ isInput = nodeName === "input";
+
+ this.isMultiLine =
+ // Textareas are always multi-line
+ isTextarea ? true :
+ // Inputs are always single-line, even if inside a contentEditable element
+ // IE also treats inputs as contentEditable
+ isInput ? false :
+ // All other element types are determined by whether or not they're contentEditable
+ this.element.prop( "isContentEditable" );
+
+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+ this.isNewMenu = true;
+
+ this.element
+ .addClass( "ui-autocomplete-input" )
+ .attr( "autocomplete", "off" );
+
+ this._on( this.element, {
+ keydown: function( event ) {
+ if ( this.element.prop( "readOnly" ) ) {
+ suppressKeyPress = true;
+ suppressInput = true;
+ suppressKeyPressRepeat = true;
+ return;
+ }
+
+ suppressKeyPress = false;
+ suppressInput = false;
+ suppressKeyPressRepeat = false;
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ suppressKeyPress = true;
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ suppressKeyPress = true;
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ suppressKeyPress = true;
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ suppressKeyPress = true;
+ this._keyEvent( "next", event );
+ break;
+ case keyCode.ENTER:
+ // when menu is open and has focus
+ if ( this.menu.active ) {
+ // #6055 - Opera still allows the keypress to occur
+ // which causes forms to submit
+ suppressKeyPress = true;
+ event.preventDefault();
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.TAB:
+ if ( this.menu.active ) {
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.ESCAPE:
+ if ( this.menu.element.is( ":visible" ) ) {
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+ this.close( event );
+ // Different browsers have different default behavior for escape
+ // Single press can mean undo or clear
+ // Double press in IE means clear the whole form
+ event.preventDefault();
+ }
+ break;
+ default:
+ suppressKeyPressRepeat = true;
+ // search timeout should be triggered before the input value is changed
+ this._searchTimeout( event );
+ break;
+ }
+ },
+ keypress: function( event ) {
+ if ( suppressKeyPress ) {
+ suppressKeyPress = false;
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ event.preventDefault();
+ }
+ return;
+ }
+ if ( suppressKeyPressRepeat ) {
+ return;
+ }
+
+ // replicate some key handlers to allow them to repeat in Firefox and Opera
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ this._keyEvent( "next", event );
+ break;
+ }
+ },
+ input: function( event ) {
+ if ( suppressInput ) {
+ suppressInput = false;
+ event.preventDefault();
+ return;
+ }
+ this._searchTimeout( event );
+ },
+ focus: function() {
+ this.selectedItem = null;
+ this.previous = this._value();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ clearTimeout( this.searching );
+ this.close( event );
+ this._change( event );
+ }
+ });
+
+ this._initSource();
+ this.menu = $( "<ul>" )
+ .addClass( "ui-autocomplete ui-front" )
+ .appendTo( this._appendTo() )
+ .menu({
+ // disable ARIA support, the live region takes care of that
+ role: null
+ })
+ .hide()
+ .menu( "instance" );
+
+ this._on( this.menu.element, {
+ mousedown: function( event ) {
+ // prevent moving focus out of the text field
+ event.preventDefault();
+
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ });
+
+ // clicking on the scrollbar causes focus to shift to the body
+ // but we can't detect a mouseup or a click immediately afterward
+ // so we have to track the next mousedown and close the menu if
+ // the user clicks somewhere outside of the autocomplete
+ var menuElement = this.menu.element[ 0 ];
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+ this._delay(function() {
+ var that = this;
+ this.document.one( "mousedown", function( event ) {
+ if ( event.target !== that.element[ 0 ] &&
+ event.target !== menuElement &&
+ !$.contains( menuElement, event.target ) ) {
+ that.close();
+ }
+ });
+ });
+ }
+ },
+ menufocus: function( event, ui ) {
+ var label, item;
+ // support: Firefox
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
+ if ( this.isNewMenu ) {
+ this.isNewMenu = false;
+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+ this.menu.blur();
+
+ this.document.one( "mousemove", function() {
+ $( event.target ).trigger( event.originalEvent );
+ });
+
+ return;
+ }
+ }
+
+ item = ui.item.data( "ui-autocomplete-item" );
+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+ // use value to match what will end up in the input, if it was a key event
+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+ this._value( item.value );
+ }
+ }
+
+ // Announce the value in the liveRegion
+ label = ui.item.attr( "aria-label" ) || item.value;
+ if ( label && $.trim( label ).length ) {
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( label ).appendTo( this.liveRegion );
+ }
+ },
+ menuselect: function( event, ui ) {
+ var item = ui.item.data( "ui-autocomplete-item" ),
+ previous = this.previous;
+
+ // only trigger when focus was lost (click on menu)
+ if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
+ this.element.focus();
+ this.previous = previous;
+ // #6109 - IE triggers two focus events and the second
+ // is asynchronous, so we need to reset the previous
+ // term synchronously and asynchronously :-(
+ this._delay(function() {
+ this.previous = previous;
+ this.selectedItem = item;
+ });
+ }
+
+ if ( false !== this._trigger( "select", event, { item: item } ) ) {
+ this._value( item.value );
+ }
+ // reset the term after the select event
+ // this allows custom select handling to work properly
+ this.term = this._value();
+
+ this.close( event );
+ this.selectedItem = item;
+ }
+ });
+
+ this.liveRegion = $( "<span>", {
+ role: "status",
+ "aria-live": "assertive",
+ "aria-relevant": "additions"
+ })
+ .addClass( "ui-helper-hidden-accessible" )
+ .appendTo( this.document[ 0 ].body );
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _destroy: function() {
+ clearTimeout( this.searching );
+ this.element
+ .removeClass( "ui-autocomplete-input" )
+ .removeAttr( "autocomplete" );
+ this.menu.element.remove();
+ this.liveRegion.remove();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "source" ) {
+ this._initSource();
+ }
+ if ( key === "appendTo" ) {
+ this.menu.element.appendTo( this._appendTo() );
+ }
+ if ( key === "disabled" && value && this.xhr ) {
+ this.xhr.abort();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element || !element[ 0 ] ) {
+ element = this.element.closest( ".ui-front" );
+ }
+
+ if ( !element.length ) {
+ element = this.document[ 0 ].body;
+ }
+
+ return element;
+ },
+
+ _initSource: function() {
+ var array, url,
+ that = this;
+ if ( $.isArray( this.options.source ) ) {
+ array = this.options.source;
+ this.source = function( request, response ) {
+ response( $.ui.autocomplete.filter( array, request.term ) );
+ };
+ } else if ( typeof this.options.source === "string" ) {
+ url = this.options.source;
+ this.source = function( request, response ) {
+ if ( that.xhr ) {
+ that.xhr.abort();
+ }
+ that.xhr = $.ajax({
+ url: url,
+ data: request,
+ dataType: "json",
+ success: function( data ) {
+ response( data );
+ },
+ error: function() {
+ response([]);
+ }
+ });
+ };
+ } else {
+ this.source = this.options.source;
+ }
+ },
+
+ _searchTimeout: function( event ) {
+ clearTimeout( this.searching );
+ this.searching = this._delay(function() {
+
+ // Search if the value has changed, or if the user retypes the same value (see #7434)
+ var equalValues = this.term === this._value(),
+ menuVisible = this.menu.element.is( ":visible" ),
+ modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
+
+ if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
+ this.selectedItem = null;
+ this.search( null, event );
+ }
+ }, this.options.delay );
+ },
+
+ search: function( value, event ) {
+ value = value != null ? value : this._value();
+
+ // always save the actual value, not the one passed as an argument
+ this.term = this._value();
+
+ if ( value.length < this.options.minLength ) {
+ return this.close( event );
+ }
+
+ if ( this._trigger( "search", event ) === false ) {
+ return;
+ }
+
+ return this._search( value );
+ },
+
+ _search: function( value ) {
+ this.pending++;
+ this.element.addClass( "ui-autocomplete-loading" );
+ this.cancelSearch = false;
+
+ this.source( { term: value }, this._response() );
+ },
+
+ _response: function() {
+ var index = ++this.requestIndex;
+
+ return $.proxy(function( content ) {
+ if ( index === this.requestIndex ) {
+ this.__response( content );
+ }
+
+ this.pending--;
+ if ( !this.pending ) {
+ this.element.removeClass( "ui-autocomplete-loading" );
+ }
+ }, this );
+ },
+
+ __response: function( content ) {
+ if ( content ) {
+ content = this._normalize( content );
+ }
+ this._trigger( "response", null, { content: content } );
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+ this._suggest( content );
+ this._trigger( "open" );
+ } else {
+ // use ._close() instead of .close() so we don't cancel future searches
+ this._close();
+ }
+ },
+
+ close: function( event ) {
+ this.cancelSearch = true;
+ this._close( event );
+ },
+
+ _close: function( event ) {
+ if ( this.menu.element.is( ":visible" ) ) {
+ this.menu.element.hide();
+ this.menu.blur();
+ this.isNewMenu = true;
+ this._trigger( "close", event );
+ }
+ },
+
+ _change: function( event ) {
+ if ( this.previous !== this._value() ) {
+ this._trigger( "change", event, { item: this.selectedItem } );
+ }
+ },
+
+ _normalize: function( items ) {
+ // assume all items have the right format when the first item is complete
+ if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
+ return items;
+ }
+ return $.map( items, function( item ) {
+ if ( typeof item === "string" ) {
+ return {
+ label: item,
+ value: item
+ };
+ }
+ return $.extend( {}, item, {
+ label: item.label || item.value,
+ value: item.value || item.label
+ });
+ });
+ },
+
+ _suggest: function( items ) {
+ var ul = this.menu.element.empty();
+ this._renderMenu( ul, items );
+ this.isNewMenu = true;
+ this.menu.refresh();
+
+ // size and position menu
+ ul.show();
+ this._resizeMenu();
+ ul.position( $.extend({
+ of: this.element
+ }, this.options.position ) );
+
+ if ( this.options.autoFocus ) {
+ this.menu.next();
+ }
+ },
+
+ _resizeMenu: function() {
+ var ul = this.menu.element;
+ ul.outerWidth( Math.max(
+ // Firefox wraps long text (possibly a rounding bug)
+ // so we add 1px to avoid the wrapping (#7513)
+ ul.width( "" ).outerWidth() + 1,
+ this.element.outerWidth()
+ ) );
+ },
+
+ _renderMenu: function( ul, items ) {
+ var that = this;
+ $.each( items, function( index, item ) {
+ that._renderItemData( ul, item );
+ });
+ },
+
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+ },
+
+ _renderItem: function( ul, item ) {
+ return $( "<li>" ).text( item.label ).appendTo( ul );
+ },
+
+ _move: function( direction, event ) {
+ if ( !this.menu.element.is( ":visible" ) ) {
+ this.search( null, event );
+ return;
+ }
+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+ this.menu.isLastItem() && /^next/.test( direction ) ) {
+
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+
+ this.menu.blur();
+ return;
+ }
+ this.menu[ direction ]( event );
+ },
+
+ widget: function() {
+ return this.menu.element;
+ },
+
+ _value: function() {
+ return this.valueMethod.apply( this.element, arguments );
+ },
+
+ _keyEvent: function( keyEvent, event ) {
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ this._move( keyEvent, event );
+
+ // prevents moving cursor to beginning/end of the text field in some browsers
+ event.preventDefault();
+ }
+ }
+});
+
+$.extend( $.ui.autocomplete, {
+ escapeRegex: function( value ) {
+ return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+ },
+ filter: function( array, term ) {
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
+ return $.grep( array, function( value ) {
+ return matcher.test( value.label || value.value || value );
+ });
+ }
+});
+
+// live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+ options: {
+ messages: {
+ noResults: "No search results.",
+ results: function( amount ) {
+ return amount + ( amount > 1 ? " results are" : " result is" ) +
+ " available, use up and down arrow keys to navigate.";
+ }
+ }
+ },
+
+ __response: function( content ) {
+ var message;
+ this._superApply( arguments );
+ if ( this.options.disabled || this.cancelSearch ) {
+ return;
+ }
+ if ( content && content.length ) {
+ message = this.options.messages.results( content.length );
+ } else {
+ message = this.options.messages.noResults;
+ }
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( message ).appendTo( this.liveRegion );
+ }
+});
+
+var autocomplete = $.ui.autocomplete;
+
+
+/*!
+ * jQuery UI Button 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/button/
+ */
+
+
+var lastActive,
+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
+ formResetHandler = function() {
+ var form = $( this );
+ setTimeout(function() {
+ form.find( ":ui-button" ).button( "refresh" );
+ }, 1 );
+ },
+ radioGroup = function( radio ) {
+ var name = radio.name,
+ form = radio.form,
+ radios = $( [] );
+ if ( name ) {
+ name = name.replace( /'/g, "\\'" );
+ if ( form ) {
+ radios = $( form ).find( "[name='" + name + "'][type=radio]" );
+ } else {
+ radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
+ .filter(function() {
+ return !this.form;
+ });
+ }
+ }
+ return radios;
+ };
+
+$.widget( "ui.button", {
+ version: "1.11.4",
+ defaultElement: "<button>",
+ options: {
+ disabled: null,
+ text: true,
+ label: null,
+ icons: {
+ primary: null,
+ secondary: null
+ }
+ },
+ _create: function() {
+ this.element.closest( "form" )
+ .unbind( "reset" + this.eventNamespace )
+ .bind( "reset" + this.eventNamespace, formResetHandler );
+
+ if ( typeof this.options.disabled !== "boolean" ) {
+ this.options.disabled = !!this.element.prop( "disabled" );
+ } else {
+ this.element.prop( "disabled", this.options.disabled );
+ }
+
+ this._determineButtonType();
+ this.hasTitle = !!this.buttonElement.attr( "title" );
+
+ var that = this,
+ options = this.options,
+ toggleButton = this.type === "checkbox" || this.type === "radio",
+ activeClass = !toggleButton ? "ui-state-active" : "";
+
+ if ( options.label === null ) {
+ options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
+ }
+
+ this._hoverable( this.buttonElement );
+
+ this.buttonElement
+ .addClass( baseClasses )
+ .attr( "role", "button" )
+ .bind( "mouseenter" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ if ( this === lastActive ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ .bind( "mouseleave" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ $( this ).removeClass( activeClass );
+ })
+ .bind( "click" + this.eventNamespace, function( event ) {
+ if ( options.disabled ) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ });
+
+ // Can't use _focusable() because the element that receives focus
+ // and the element that gets the ui-state-focus class are different
+ this._on({
+ focus: function() {
+ this.buttonElement.addClass( "ui-state-focus" );
+ },
+ blur: function() {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ }
+ });
+
+ if ( toggleButton ) {
+ this.element.bind( "change" + this.eventNamespace, function() {
+ that.refresh();
+ });
+ }
+
+ if ( this.type === "checkbox" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ });
+ } else if ( this.type === "radio" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ that.buttonElement.attr( "aria-pressed", "true" );
+
+ var radio = that.element[ 0 ];
+ radioGroup( radio )
+ .not( radio )
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ });
+ } else {
+ this.buttonElement
+ .bind( "mousedown" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ lastActive = this;
+ that.document.one( "mouseup", function() {
+ lastActive = null;
+ });
+ })
+ .bind( "mouseup" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).removeClass( "ui-state-active" );
+ })
+ .bind( "keydown" + this.eventNamespace, function(event) {
+ if ( options.disabled ) {
+ return false;
+ }
+ if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ // see #8559, we bind to blur here in case the button element loses
+ // focus between keydown and keyup, it would be left in an "active" state
+ .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
+ $( this ).removeClass( "ui-state-active" );
+ });
+
+ if ( this.buttonElement.is("a") ) {
+ this.buttonElement.keyup(function(event) {
+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
+ $( this ).click();
+ }
+ });
+ }
+ }
+
+ this._setOption( "disabled", options.disabled );
+ this._resetButton();
+ },
+
+ _determineButtonType: function() {
+ var ancestor, labelSelector, checked;
+
+ if ( this.element.is("[type=checkbox]") ) {
+ this.type = "checkbox";
+ } else if ( this.element.is("[type=radio]") ) {
+ this.type = "radio";
+ } else if ( this.element.is("input") ) {
+ this.type = "input";
+ } else {
+ this.type = "button";
+ }
+
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ // we don't search against the document in case the element
+ // is disconnected from the DOM
+ ancestor = this.element.parents().last();
+ labelSelector = "label[for='" + this.element.attr("id") + "']";
+ this.buttonElement = ancestor.find( labelSelector );
+ if ( !this.buttonElement.length ) {
+ ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
+ this.buttonElement = ancestor.filter( labelSelector );
+ if ( !this.buttonElement.length ) {
+ this.buttonElement = ancestor.find( labelSelector );
+ }
+ }
+ this.element.addClass( "ui-helper-hidden-accessible" );
+
+ checked = this.element.is( ":checked" );
+ if ( checked ) {
+ this.buttonElement.addClass( "ui-state-active" );
+ }
+ this.buttonElement.prop( "aria-pressed", checked );
+ } else {
+ this.buttonElement = this.element;
+ }
+ },
+
+ widget: function() {
+ return this.buttonElement;
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-helper-hidden-accessible" );
+ this.buttonElement
+ .removeClass( baseClasses + " ui-state-active " + typeClasses )
+ .removeAttr( "role" )
+ .removeAttr( "aria-pressed" )
+ .html( this.buttonElement.find(".ui-button-text").html() );
+
+ if ( !this.hasTitle ) {
+ this.buttonElement.removeAttr( "title" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "disabled" ) {
+ this.widget().toggleClass( "ui-state-disabled", !!value );
+ this.element.prop( "disabled", !!value );
+ if ( value ) {
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ } else {
+ this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
+ }
+ }
+ return;
+ }
+ this._resetButton();
+ },
+
+ refresh: function() {
+ //See #8237 & #8828
+ var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
+
+ if ( isDisabled !== this.options.disabled ) {
+ this._setOption( "disabled", isDisabled );
+ }
+ if ( this.type === "radio" ) {
+ radioGroup( this.element[0] ).each(function() {
+ if ( $( this ).is( ":checked" ) ) {
+ $( this ).button( "widget" )
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ $( this ).button( "widget" )
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ });
+ } else if ( this.type === "checkbox" ) {
+ if ( this.element.is( ":checked" ) ) {
+ this.buttonElement
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ this.buttonElement
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ }
+ },
+
+ _resetButton: function() {
+ if ( this.type === "input" ) {
+ if ( this.options.label ) {
+ this.element.val( this.options.label );
+ }
+ return;
+ }
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
+ buttonText = $( "<span></span>", this.document[0] )
+ .addClass( "ui-button-text" )
+ .html( this.options.label )
+ .appendTo( buttonElement.empty() )
+ .text(),
+ icons = this.options.icons,
+ multipleIcons = icons.primary && icons.secondary,
+ buttonClasses = [];
+
+ if ( icons.primary || icons.secondary ) {
+ if ( this.options.text ) {
+ buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
+ }
+
+ if ( icons.primary ) {
+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
+ }
+
+ if ( icons.secondary ) {
+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
+ }
+
+ if ( !this.options.text ) {
+ buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
+
+ if ( !this.hasTitle ) {
+ buttonElement.attr( "title", $.trim( buttonText ) );
+ }
+ }
+ } else {
+ buttonClasses.push( "ui-button-text-only" );
+ }
+ buttonElement.addClass( buttonClasses.join( " " ) );
+ }
+});
+
+$.widget( "ui.buttonset", {
+ version: "1.11.4",
+ options: {
+ items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
+ },
+
+ _create: function() {
+ this.element.addClass( "ui-buttonset" );
+ },
+
+ _init: function() {
+ this.refresh();
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "disabled" ) {
+ this.buttons.button( "option", key, value );
+ }
+
+ this._super( key, value );
+ },
+
+ refresh: function() {
+ var rtl = this.element.css( "direction" ) === "rtl",
+ allButtons = this.element.find( this.options.items ),
+ existingButtons = allButtons.filter( ":ui-button" );
+
+ // Initialize new buttons
+ allButtons.not( ":ui-button" ).button();
+
+ // Refresh existing buttons
+ existingButtons.button( "refresh" );
+
+ this.buttons = allButtons
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
+ .filter( ":first" )
+ .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
+ .end()
+ .filter( ":last" )
+ .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
+ .end()
+ .end();
+ },
+
+ _destroy: function() {
+ this.element.removeClass( "ui-buttonset" );
+ this.buttons
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-left ui-corner-right" )
+ .end()
+ .button( "destroy" );
+ }
+});
+
+var button = $.ui.button;
+
+
+/*!
+ * jQuery UI Datepicker 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/datepicker/
+ */
+
+
+$.extend($.ui, { datepicker: { version: "1.11.4" } });
+
+var datepicker_instActive;
+
+function datepicker_getZindex( elem ) {
+ var position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+
+ return 0;
+}
+/* Date picker manager.
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
+ Settings for (groups of) date pickers are maintained in an instance object,
+ allowing multiple different settings on the same page. */
+
+function Datepicker() {
+ this._curInst = null; // The current instance in use
+ this._keyEvent = false; // If the last event was a key event
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
+ this._inDialog = false; // True if showing within a "dialog", false if not
+ this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
+ this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
+ this._appendClass = "ui-datepicker-append"; // The name of the append marker class
+ this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
+ this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
+ this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
+ this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
+ this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
+ this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
+ this.regional = []; // Available regional settings, indexed by language code
+ this.regional[""] = { // Default regional settings
+ closeText: "Done", // Display text for close link
+ prevText: "Prev", // Display text for previous month link
+ nextText: "Next", // Display text for next month link
+ currentText: "Today", // Display text for current month link
+ monthNames: ["January","February","March","April","May","June",
+ "July","August","September","October","November","December"], // Names of months for drop-down and formatting
+ monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
+ dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
+ dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
+ dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
+ weekHeader: "Wk", // Column header for week of the year
+ dateFormat: "mm/dd/yy", // See format options on parseDate
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
+ isRTL: false, // True if right-to-left language, false if left-to-right
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
+ yearSuffix: "" // Additional text to append to the year in the month headers
+ };
+ this._defaults = { // Global defaults for all the date picker instances
+ showOn: "focus", // "focus" for popup on focus,
+ // "button" for trigger button, or "both" for either
+ showAnim: "fadeIn", // Name of jQuery animation for popup
+ showOptions: {}, // Options for enhanced animations
+ defaultDate: null, // Used when field is blank: actual date,
+ // +/-number for offset from today, null for today
+ appendText: "", // Display text following the input box, e.g. showing the format
+ buttonText: "...", // Text for trigger button
+ buttonImage: "", // URL for trigger button image
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
+ hideIfNoPrevNext: false, // True to hide next/previous month links
+ // if not applicable, false to just disable them
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
+ gotoCurrent: false, // True if today link goes back to current selection instead
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
+ changeYear: false, // True if year can be selected directly, false if only prev/next
+ yearRange: "c-10:c+10", // Range of years to display in drop-down,
+ // either relative to today's year (-nn:+nn), relative to currently displayed year
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
+ showWeek: false, // True to show week of the year, false to not show it
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
+ // takes a Date and returns the number of the week for it
+ shortYearCutoff: "+10", // Short year values < this are in the current century,
+ // > this are in the previous century,
+ // string value starting with "+" for current year + value
+ minDate: null, // The earliest selectable date, or null for no limit
+ maxDate: null, // The latest selectable date, or null for no limit
+ duration: "fast", // Duration of display/closure
+ beforeShowDay: null, // Function that takes a date and returns an array with
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
+ beforeShow: null, // Function that takes an input field and
+ // returns a set of custom settings for the date picker
+ onSelect: null, // Define a callback function when a date is selected
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
+ onClose: null, // Define a callback function when the datepicker is closed
+ numberOfMonths: 1, // Number of months to show at a time
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
+ stepMonths: 1, // Number of months to step back/forward
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
+ altField: "", // Selector for an alternate field to store selected dates into
+ altFormat: "", // The date format to use for the alternate field
+ constrainInput: true, // The input is constrained by the current date format
+ showButtonPanel: false, // True to show button panel, false to not show it
+ autoSize: false, // True to size the input for the date format, false to leave as is
+ disabled: false // The initial disabled state
+ };
+ $.extend(this._defaults, this.regional[""]);
+ this.regional.en = $.extend( true, {}, this.regional[ "" ]);
+ this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
+ this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
+}
+
+$.extend(Datepicker.prototype, {
+ /* Class name added to elements to indicate already configured with a date picker. */
+ markerClassName: "hasDatepicker",
+
+ //Keep track of the maximum number of rows displayed (see #7043)
+ maxRows: 4,
+
+ // TODO rename to "widget" when switching to widget factory
+ _widgetDatepicker: function() {
+ return this.dpDiv;
+ },
+
+ /* Override the default settings for all instances of the date picker.
+ * @param settings object - the new settings to use as defaults (anonymous object)
+ * @return the manager object
+ */
+ setDefaults: function(settings) {
+ datepicker_extendRemove(this._defaults, settings || {});
+ return this;
+ },
+
+ /* Attach the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param settings object - the new settings to use for this date picker instance (anonymous)
+ */
+ _attachDatepicker: function(target, settings) {
+ var nodeName, inline, inst;
+ nodeName = target.nodeName.toLowerCase();
+ inline = (nodeName === "div" || nodeName === "span");
+ if (!target.id) {
+ this.uuid += 1;
+ target.id = "dp" + this.uuid;
+ }
+ inst = this._newInst($(target), inline);
+ inst.settings = $.extend({}, settings || {});
+ if (nodeName === "input") {
+ this._connectDatepicker(target, inst);
+ } else if (inline) {
+ this._inlineDatepicker(target, inst);
+ }
+ },
+
+ /* Create a new instance object. */
+ _newInst: function(target, inline) {
+ var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
+ return {id: id, input: target, // associated target
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
+ drawMonth: 0, drawYear: 0, // month being drawn
+ inline: inline, // is datepicker inline or not
+ dpDiv: (!inline ? this.dpDiv : // presentation div
+ datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
+ },
+
+ /* Attach the date picker to an input field. */
+ _connectDatepicker: function(target, inst) {
+ var input = $(target);
+ inst.append = $([]);
+ inst.trigger = $([]);
+ if (input.hasClass(this.markerClassName)) {
+ return;
+ }
+ this._attachments(input, inst);
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
+ keypress(this._doKeyPress).keyup(this._doKeyUp);
+ this._autoSize(inst);
+ $.data(target, "datepicker", inst);
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ },
+
+ /* Make attachments based on settings. */
+ _attachments: function(input, inst) {
+ var showOn, buttonText, buttonImage,
+ appendText = this._get(inst, "appendText"),
+ isRTL = this._get(inst, "isRTL");
+
+ if (inst.append) {
+ inst.append.remove();
+ }
+ if (appendText) {
+ inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
+ input[isRTL ? "before" : "after"](inst.append);
+ }
+
+ input.unbind("focus", this._showDatepicker);
+
+ if (inst.trigger) {
+ inst.trigger.remove();
+ }
+
+ showOn = this._get(inst, "showOn");
+ if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
+ input.focus(this._showDatepicker);
+ }
+ if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
+ buttonText = this._get(inst, "buttonText");
+ buttonImage = this._get(inst, "buttonImage");
+ inst.trigger = $(this._get(inst, "buttonImageOnly") ?
+ $("<img/>").addClass(this._triggerClass).
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
+ $("<button type='button'></button>").addClass(this._triggerClass).
+ html(!buttonImage ? buttonText : $("<img/>").attr(
+ { src:buttonImage, alt:buttonText, title:buttonText })));
+ input[isRTL ? "before" : "after"](inst.trigger);
+ inst.trigger.click(function() {
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
+ $.datepicker._hideDatepicker();
+ } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
+ $.datepicker._hideDatepicker();
+ $.datepicker._showDatepicker(input[0]);
+ } else {
+ $.datepicker._showDatepicker(input[0]);
+ }
+ return false;
+ });
+ }
+ },
+
+ /* Apply the maximum length for the date format. */
+ _autoSize: function(inst) {
+ if (this._get(inst, "autoSize") && !inst.inline) {
+ var findMax, max, maxI, i,
+ date = new Date(2009, 12 - 1, 20), // Ensure double digits
+ dateFormat = this._get(inst, "dateFormat");
+
+ if (dateFormat.match(/[DM]/)) {
+ findMax = function(names) {
+ max = 0;
+ maxI = 0;
+ for (i = 0; i < names.length; i++) {
+ if (names[i].length > max) {
+ max = names[i].length;
+ maxI = i;
+ }
+ }
+ return maxI;
+ };
+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
+ "monthNames" : "monthNamesShort"))));
+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
+ "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
+ }
+ inst.input.attr("size", this._formatDate(inst, date).length);
+ }
+ },
+
+ /* Attach an inline date picker to a div. */
+ _inlineDatepicker: function(target, inst) {
+ var divSpan = $(target);
+ if (divSpan.hasClass(this.markerClassName)) {
+ return;
+ }
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv);
+ $.data(target, "datepicker", inst);
+ this._setDate(inst, this._getDefaultDate(inst), true);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
+ inst.dpDiv.css( "display", "block" );
+ },
+
+ /* Pop-up the date picker in a "dialog" box.
+ * @param input element - ignored
+ * @param date string or Date - the initial date to display
+ * @param onSelect function - the function to call when a date is selected
+ * @param settings object - update the dialog date picker instance's settings (anonymous object)
+ * @param pos int[2] - coordinates for the dialog's position within the screen or
+ * event - with x/y coordinates or
+ * leave empty for default (screen centre)
+ * @return the manager object
+ */
+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
+ var id, browserWidth, browserHeight, scrollX, scrollY,
+ inst = this._dialogInst; // internal instance
+
+ if (!inst) {
+ this.uuid += 1;
+ id = "dp" + this.uuid;
+ this._dialogInput = $("<input type='text' id='" + id +
+ "' style='position: absolute; top: -100px; width: 0px;'/>");
+ this._dialogInput.keydown(this._doKeyDown);
+ $("body").append(this._dialogInput);
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
+ inst.settings = {};
+ $.data(this._dialogInput[0], "datepicker", inst);
+ }
+ datepicker_extendRemove(inst.settings, settings || {});
+ date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
+ this._dialogInput.val(date);
+
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
+ if (!this._pos) {
+ browserWidth = document.documentElement.clientWidth;
+ browserHeight = document.documentElement.clientHeight;
+ scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+ scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+ this._pos = // should use actual width/height below
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
+ }
+
+ // move input on screen for focus, but hidden behind dialog
+ this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
+ inst.settings.onSelect = onSelect;
+ this._inDialog = true;
+ this.dpDiv.addClass(this._dialogClass);
+ this._showDatepicker(this._dialogInput[0]);
+ if ($.blockUI) {
+ $.blockUI(this.dpDiv);
+ }
+ $.data(this._dialogInput[0], "datepicker", inst);
+ return this;
+ },
+
+ /* Detach a datepicker from its control.
+ * @param target element - the target input field or division or span
+ */
+ _destroyDatepicker: function(target) {
+ var nodeName,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ $.removeData(target, "datepicker");
+ if (nodeName === "input") {
+ inst.append.remove();
+ inst.trigger.remove();
+ $target.removeClass(this.markerClassName).
+ unbind("focus", this._showDatepicker).
+ unbind("keydown", this._doKeyDown).
+ unbind("keypress", this._doKeyPress).
+ unbind("keyup", this._doKeyUp);
+ } else if (nodeName === "div" || nodeName === "span") {
+ $target.removeClass(this.markerClassName).empty();
+ }
+
+ if ( datepicker_instActive === inst ) {
+ datepicker_instActive = null;
+ }
+ },
+
+ /* Enable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _enableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = false;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = false; }).end().
+ filter("img").css({opacity: "1.0", cursor: ""});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().removeClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", false);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ },
+
+ /* Disable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _disableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = true;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = true; }).end().
+ filter("img").css({opacity: "0.5", cursor: "default"});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().addClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", true);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ this._disabledInputs[this._disabledInputs.length] = target;
+ },
+
+ /* Is the first field in a jQuery collection disabled as a datepicker?
+ * @param target element - the target input field or division or span
+ * @return boolean - true if disabled, false if enabled
+ */
+ _isDisabledDatepicker: function(target) {
+ if (!target) {
+ return false;
+ }
+ for (var i = 0; i < this._disabledInputs.length; i++) {
+ if (this._disabledInputs[i] === target) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /* Retrieve the instance data for the target control.
+ * @param target element - the target input field or division or span
+ * @return object - the associated instance data
+ * @throws error if a jQuery problem getting data
+ */
+ _getInst: function(target) {
+ try {
+ return $.data(target, "datepicker");
+ }
+ catch (err) {
+ throw "Missing instance data for this datepicker";
+ }
+ },
+
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ * @param name object - the new settings to update or
+ * string - the name of the setting to change or retrieve,
+ * when retrieving also "all" for all instance settings or
+ * "defaults" for all global defaults
+ * @param value any - the new value for the setting
+ * (omit if above is an object or to retrieve a value)
+ */
+ _optionDatepicker: function(target, name, value) {
+ var settings, date, minDate, maxDate,
+ inst = this._getInst(target);
+
+ if (arguments.length === 2 && typeof name === "string") {
+ return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
+ (inst ? (name === "all" ? $.extend({}, inst.settings) :
+ this._get(inst, name)) : null));
+ }
+
+ settings = name || {};
+ if (typeof name === "string") {
+ settings = {};
+ settings[name] = value;
+ }
+
+ if (inst) {
+ if (this._curInst === inst) {
+ this._hideDatepicker();
+ }
+
+ date = this._getDateDatepicker(target, true);
+ minDate = this._getMinMaxDate(inst, "min");
+ maxDate = this._getMinMaxDate(inst, "max");
+ datepicker_extendRemove(inst.settings, settings);
+ // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
+ if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
+ inst.settings.minDate = this._formatDate(inst, minDate);
+ }
+ if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
+ inst.settings.maxDate = this._formatDate(inst, maxDate);
+ }
+ if ( "disabled" in settings ) {
+ if ( settings.disabled ) {
+ this._disableDatepicker(target);
+ } else {
+ this._enableDatepicker(target);
+ }
+ }
+ this._attachments($(target), inst);
+ this._autoSize(inst);
+ this._setDate(inst, date);
+ this._updateAlternate(inst);
+ this._updateDatepicker(inst);
+ }
+ },
+
+ // change method deprecated
+ _changeDatepicker: function(target, name, value) {
+ this._optionDatepicker(target, name, value);
+ },
+
+ /* Redraw the date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ */
+ _refreshDatepicker: function(target) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._updateDatepicker(inst);
+ }
+ },
+
+ /* Set the dates for a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param date Date - the new date
+ */
+ _setDateDatepicker: function(target, date) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._setDate(inst, date);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ }
+ },
+
+ /* Get the date(s) for the first entry in a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param noDefault boolean - true if no default date is to be used
+ * @return Date - the current date
+ */
+ _getDateDatepicker: function(target, noDefault) {
+ var inst = this._getInst(target);
+ if (inst && !inst.inline) {
+ this._setDateFromField(inst, noDefault);
+ }
+ return (inst ? this._getDate(inst) : null);
+ },
+
+ /* Handle keystrokes. */
+ _doKeyDown: function(event) {
+ var onSelect, dateStr, sel,
+ inst = $.datepicker._getInst(event.target),
+ handled = true,
+ isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
+
+ inst._keyEvent = true;
+ if ($.datepicker._datepickerShowing) {
+ switch (event.keyCode) {
+ case 9: $.datepicker._hideDatepicker();
+ handled = false;
+ break; // hide on tab out
+ case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
+ $.datepicker._currentClass + ")", inst.dpDiv);
+ if (sel[0]) {
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+ }
+
+ onSelect = $.datepicker._get(inst, "onSelect");
+ if (onSelect) {
+ dateStr = $.datepicker._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ } else {
+ $.datepicker._hideDatepicker();
+ }
+
+ return false; // don't submit the form
+ case 27: $.datepicker._hideDatepicker();
+ break; // hide on escape
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ break; // previous month/year on page up/+ ctrl
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ break; // next month/year on page down/+ ctrl
+ case 35: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._clearDate(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // clear on ctrl or command +end
+ case 36: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._gotoToday(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // current on ctrl or command +home
+ case 37: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // -1 day on ctrl or command +left
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +left on Mac
+ break;
+ case 38: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, -7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // -1 week on ctrl or command +up
+ case 39: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // +1 day on ctrl or command +right
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +right
+ break;
+ case 40: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, +7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // +1 week on ctrl or command +down
+ default: handled = false;
+ }
+ } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
+ $.datepicker._showDatepicker(this);
+ } else {
+ handled = false;
+ }
+
+ if (handled) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ },
+
+ /* Filter entered characters - based on date format. */
+ _doKeyPress: function(event) {
+ var chars, chr,
+ inst = $.datepicker._getInst(event.target);
+
+ if ($.datepicker._get(inst, "constrainInput")) {
+ chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
+ chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
+ return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
+ }
+ },
+
+ /* Synchronise manual entry and field/alternate field. */
+ _doKeyUp: function(event) {
+ var date,
+ inst = $.datepicker._getInst(event.target);
+
+ if (inst.input.val() !== inst.lastVal) {
+ try {
+ date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ (inst.input ? inst.input.val() : null),
+ $.datepicker._getFormatConfig(inst));
+
+ if (date) { // only if valid
+ $.datepicker._setDateFromField(inst);
+ $.datepicker._updateAlternate(inst);
+ $.datepicker._updateDatepicker(inst);
+ }
+ }
+ catch (err) {
+ }
+ }
+ return true;
+ },
+
+ /* Pop-up the date picker for a given input field.
+ * If false returned from beforeShow event handler do not show.
+ * @param input element - the input field attached to the date picker or
+ * event - if triggered by focus
+ */
+ _showDatepicker: function(input) {
+ input = input.target || input;
+ if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
+ input = $("input", input.parentNode)[0];
+ }
+
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
+ return;
+ }
+
+ var inst, beforeShow, beforeShowSettings, isFixed,
+ offset, showAnim, duration;
+
+ inst = $.datepicker._getInst(input);
+ if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
+ $.datepicker._curInst.dpDiv.stop(true, true);
+ if ( inst && $.datepicker._datepickerShowing ) {
+ $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
+ }
+ }
+
+ beforeShow = $.datepicker._get(inst, "beforeShow");
+ beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
+ if(beforeShowSettings === false){
+ return;
+ }
+ datepicker_extendRemove(inst.settings, beforeShowSettings);
+
+ inst.lastVal = null;
+ $.datepicker._lastInput = input;
+ $.datepicker._setDateFromField(inst);
+
+ if ($.datepicker._inDialog) { // hide cursor
+ input.value = "";
+ }
+ if (!$.datepicker._pos) { // position below input
+ $.datepicker._pos = $.datepicker._findPos(input);
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
+ }
+
+ isFixed = false;
+ $(input).parents().each(function() {
+ isFixed |= $(this).css("position") === "fixed";
+ return !isFixed;
+ });
+
+ offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
+ $.datepicker._pos = null;
+ //to avoid flashes on Firefox
+ inst.dpDiv.empty();
+ // determine sizing offscreen
+ inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
+ $.datepicker._updateDatepicker(inst);
+ // fix width for dynamic number of date pickers
+ // and adjust position before showing
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
+ "static" : (isFixed ? "fixed" : "absolute")), display: "none",
+ left: offset.left + "px", top: offset.top + "px"});
+
+ if (!inst.inline) {
+ showAnim = $.datepicker._get(inst, "showAnim");
+ duration = $.datepicker._get(inst, "duration");
+ inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
+ $.datepicker._datepickerShowing = true;
+
+ if ( $.effects && $.effects.effect[ showAnim ] ) {
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
+ } else {
+ inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
+ }
+
+ if ( $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ $.datepicker._curInst = inst;
+ }
+ },
+
+ /* Generate the date picker content. */
+ _updateDatepicker: function(inst) {
+ this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
+ datepicker_instActive = inst; // for delegate hover events
+ inst.dpDiv.empty().append(this._generateHTML(inst));
+ this._attachHandlers(inst);
+
+ var origyearshtml,
+ numMonths = this._getNumberOfMonths(inst),
+ cols = numMonths[1],
+ width = 17,
+ activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
+
+ if ( activeCell.length > 0 ) {
+ datepicker_handleMouseover.apply( activeCell.get( 0 ) );
+ }
+
+ inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
+ if (cols > 1) {
+ inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
+ }
+ inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
+ "Class"]("ui-datepicker-multi");
+ inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
+ "Class"]("ui-datepicker-rtl");
+
+ if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ // deffered render of the years select (to avoid flashes on Firefox)
+ if( inst.yearshtml ){
+ origyearshtml = inst.yearshtml;
+ setTimeout(function(){
+ //assure that inst.yearshtml didn't change.
+ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
+ inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
+ }
+ origyearshtml = inst.yearshtml = null;
+ }, 0);
+ }
+ },
+
+ // #6694 - don't focus the input if it's already focused
+ // this breaks the change event in IE
+ // Support: IE and jQuery <1.9
+ _shouldFocusInput: function( inst ) {
+ return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
+ },
+
+ /* Check positioning to remain on screen. */
+ _checkOffset: function(inst, offset, isFixed) {
+ var dpWidth = inst.dpDiv.outerWidth(),
+ dpHeight = inst.dpDiv.outerHeight(),
+ inputWidth = inst.input ? inst.input.outerWidth() : 0,
+ inputHeight = inst.input ? inst.input.outerHeight() : 0,
+ viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
+ viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
+
+ offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
+ offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
+ offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
+
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
+ Math.abs(dpHeight + inputHeight) : 0);
+
+ return offset;
+ },
+
+ /* Find an object's position on the screen. */
+ _findPos: function(obj) {
+ var position,
+ inst = this._getInst(obj),
+ isRTL = this._get(inst, "isRTL");
+
+ while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
+ obj = obj[isRTL ? "previousSibling" : "nextSibling"];
+ }
+
+ position = $(obj).offset();
+ return [position.left, position.top];
+ },
+
+ /* Hide the date picker from view.
+ * @param input element - the input field attached to the date picker
+ */
+ _hideDatepicker: function(input) {
+ var showAnim, duration, postProcess, onClose,
+ inst = this._curInst;
+
+ if (!inst || (input && inst !== $.data(input, "datepicker"))) {
+ return;
+ }
+
+ if (this._datepickerShowing) {
+ showAnim = this._get(inst, "showAnim");
+ duration = this._get(inst, "duration");
+ postProcess = function() {
+ $.datepicker._tidyDialog(inst);
+ };
+
+ // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
+ if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
+ } else {
+ inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
+ (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
+ }
+
+ if (!showAnim) {
+ postProcess();
+ }
+ this._datepickerShowing = false;
+
+ onClose = this._get(inst, "onClose");
+ if (onClose) {
+ onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
+ }
+
+ this._lastInput = null;
+ if (this._inDialog) {
+ this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
+ if ($.blockUI) {
+ $.unblockUI();
+ $("body").append(this.dpDiv);
+ }
+ }
+ this._inDialog = false;
+ }
+ },
+
+ /* Tidy up after a dialog display. */
+ _tidyDialog: function(inst) {
+ inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
+ },
+
+ /* Close date picker if clicked elsewhere. */
+ _checkExternalClick: function(event) {
+ if (!$.datepicker._curInst) {
+ return;
+ }
+
+ var $target = $(event.target),
+ inst = $.datepicker._getInst($target[0]);
+
+ if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
+ $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
+ !$target.hasClass($.datepicker.markerClassName) &&
+ !$target.closest("." + $.datepicker._triggerClass).length &&
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
+ ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
+ $.datepicker._hideDatepicker();
+ }
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustDate: function(id, offset, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+ this._adjustInstDate(inst, offset +
+ (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
+ period);
+ this._updateDatepicker(inst);
+ },
+
+ /* Action for current link. */
+ _gotoToday: function(id) {
+ var date,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._get(inst, "gotoCurrent") && inst.currentDay) {
+ inst.selectedDay = inst.currentDay;
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
+ inst.drawYear = inst.selectedYear = inst.currentYear;
+ } else {
+ date = new Date();
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ }
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a new month/year. */
+ _selectMonthYear: function(id, select, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ inst["selected" + (period === "M" ? "Month" : "Year")] =
+ inst["draw" + (period === "M" ? "Month" : "Year")] =
+ parseInt(select.options[select.selectedIndex].value,10);
+
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a day. */
+ _selectDay: function(id, month, year, td) {
+ var inst,
+ target = $(id);
+
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+
+ inst = this._getInst(target[0]);
+ inst.selectedDay = inst.currentDay = $("a", td).html();
+ inst.selectedMonth = inst.currentMonth = month;
+ inst.selectedYear = inst.currentYear = year;
+ this._selectDate(id, this._formatDate(inst,
+ inst.currentDay, inst.currentMonth, inst.currentYear));
+ },
+
+ /* Erase the input field and hide the date picker. */
+ _clearDate: function(id) {
+ var target = $(id);
+ this._selectDate(target, "");
+ },
+
+ /* Update the input field with the selected date. */
+ _selectDate: function(id, dateStr) {
+ var onSelect,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
+ if (inst.input) {
+ inst.input.val(dateStr);
+ }
+ this._updateAlternate(inst);
+
+ onSelect = this._get(inst, "onSelect");
+ if (onSelect) {
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
+ } else if (inst.input) {
+ inst.input.trigger("change"); // fire the change event
+ }
+
+ if (inst.inline){
+ this._updateDatepicker(inst);
+ } else {
+ this._hideDatepicker();
+ this._lastInput = inst.input[0];
+ if (typeof(inst.input[0]) !== "object") {
+ inst.input.focus(); // restore focus
+ }
+ this._lastInput = null;
+ }
+ },
+
+ /* Update any alternate field to synchronise with the main field. */
+ _updateAlternate: function(inst) {
+ var altFormat, date, dateStr,
+ altField = this._get(inst, "altField");
+
+ if (altField) { // update alternate field too
+ altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
+ date = this._getDate(inst);
+ dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
+ $(altField).each(function() { $(this).val(dateStr); });
+ }
+ },
+
+ /* Set as beforeShowDay function to prevent selection of weekends.
+ * @param date Date - the date to customise
+ * @return [boolean, string] - is this date selectable?, what is its CSS class?
+ */
+ noWeekends: function(date) {
+ var day = date.getDay();
+ return [(day > 0 && day < 6), ""];
+ },
+
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
+ * @param date Date - the date to get the week for
+ * @return number - the number of the week within the year that contains this date
+ */
+ iso8601Week: function(date) {
+ var time,
+ checkDate = new Date(date.getTime());
+
+ // Find Thursday of this week starting on Monday
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+
+ time = checkDate.getTime();
+ checkDate.setMonth(0); // Compare with Jan 1
+ checkDate.setDate(1);
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+ },
+
+ /* Parse a string value into a date object.
+ * See formatDate below for the possible formats.
+ *
+ * @param format string - the expected format of the date
+ * @param value string - the date in the above format
+ * @param settings Object - attributes include:
+ * shortYearCutoff number - the cutoff year for determining the century (optional)
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return Date - the extracted date value or null if value is blank
+ */
+ parseDate: function (format, value, settings) {
+ if (format == null || value == null) {
+ throw "Invalid arguments";
+ }
+
+ value = (typeof value === "object" ? value.toString() : value + "");
+ if (value === "") {
+ return null;
+ }
+
+ var iFormat, dim, extra,
+ iValue = 0,
+ shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
+ shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ year = -1,
+ month = -1,
+ day = -1,
+ doy = -1,
+ literal = false,
+ date,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Extract a number from the string value
+ getNumber = function(match) {
+ var isDoubled = lookAhead(match),
+ size = (match === "@" ? 14 : (match === "!" ? 20 :
+ (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
+ minSize = (match === "y" ? size : 1),
+ digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
+ num = value.substring(iValue).match(digits);
+ if (!num) {
+ throw "Missing number at position " + iValue;
+ }
+ iValue += num[0].length;
+ return parseInt(num[0], 10);
+ },
+ // Extract a name from the string value and convert to an index
+ getName = function(match, shortNames, longNames) {
+ var index = -1,
+ names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
+ return [ [k, v] ];
+ }).sort(function (a, b) {
+ return -(a[1].length - b[1].length);
+ });
+
+ $.each(names, function (i, pair) {
+ var name = pair[1];
+ if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
+ index = pair[0];
+ iValue += name.length;
+ return false;
+ }
+ });
+ if (index !== -1) {
+ return index + 1;
+ } else {
+ throw "Unknown name at position " + iValue;
+ }
+ },
+ // Confirm that a literal character matches the string value
+ checkLiteral = function() {
+ if (value.charAt(iValue) !== format.charAt(iFormat)) {
+ throw "Unexpected literal at position " + iValue;
+ }
+ iValue++;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ checkLiteral();
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ day = getNumber("d");
+ break;
+ case "D":
+ getName("D", dayNamesShort, dayNames);
+ break;
+ case "o":
+ doy = getNumber("o");
+ break;
+ case "m":
+ month = getNumber("m");
+ break;
+ case "M":
+ month = getName("M", monthNamesShort, monthNames);
+ break;
+ case "y":
+ year = getNumber("y");
+ break;
+ case "@":
+ date = new Date(getNumber("@"));
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "!":
+ date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "'":
+ if (lookAhead("'")){
+ checkLiteral();
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ checkLiteral();
+ }
+ }
+ }
+
+ if (iValue < value.length){
+ extra = value.substr(iValue);
+ if (!/^\s+/.test(extra)) {
+ throw "Extra/unparsed characters found in date: " + extra;
+ }
+ }
+
+ if (year === -1) {
+ year = new Date().getFullYear();
+ } else if (year < 100) {
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
+ (year <= shortYearCutoff ? 0 : -100);
+ }
+
+ if (doy > -1) {
+ month = 1;
+ day = doy;
+ do {
+ dim = this._getDaysInMonth(year, month - 1);
+ if (day <= dim) {
+ break;
+ }
+ month++;
+ day -= dim;
+ } while (true);
+ }
+
+ date = this._daylightSavingAdjust(new Date(year, month - 1, day));
+ if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
+ throw "Invalid date"; // E.g. 31/02/00
+ }
+ return date;
+ },
+
+ /* Standard date formats. */
+ ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
+ COOKIE: "D, dd M yy",
+ ISO_8601: "yy-mm-dd",
+ RFC_822: "D, d M y",
+ RFC_850: "DD, dd-M-y",
+ RFC_1036: "D, d M y",
+ RFC_1123: "D, d M yy",
+ RFC_2822: "D, d M yy",
+ RSS: "D, d M y", // RFC 822
+ TICKS: "!",
+ TIMESTAMP: "@",
+ W3C: "yy-mm-dd", // ISO 8601
+
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
+
+ /* Format a date object into a string value.
+ * The format can be combinations of the following:
+ * d - day of month (no leading zero)
+ * dd - day of month (two digit)
+ * o - day of year (no leading zeros)
+ * oo - day of year (three digit)
+ * D - day name short
+ * DD - day name long
+ * m - month of year (no leading zero)
+ * mm - month of year (two digit)
+ * M - month name short
+ * MM - month name long
+ * y - year (two digit)
+ * yy - year (four digit)
+ * @ - Unix timestamp (ms since 01/01/1970)
+ * ! - Windows ticks (100ns since 01/01/0001)
+ * "..." - literal text
+ * '' - single quote
+ *
+ * @param format string - the desired format of the date
+ * @param date Date - the date value to format
+ * @param settings Object - attributes include:
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return string - the date in the above format
+ */
+ formatDate: function (format, date, settings) {
+ if (!date) {
+ return "";
+ }
+
+ var iFormat,
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Format a number, with leading zero if necessary
+ formatNumber = function(match, value, len) {
+ var num = "" + value;
+ if (lookAhead(match)) {
+ while (num.length < len) {
+ num = "0" + num;
+ }
+ }
+ return num;
+ },
+ // Format a name, short or long as requested
+ formatName = function(match, value, shortNames, longNames) {
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
+ },
+ output = "",
+ literal = false;
+
+ if (date) {
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ output += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ output += formatNumber("d", date.getDate(), 2);
+ break;
+ case "D":
+ output += formatName("D", date.getDay(), dayNamesShort, dayNames);
+ break;
+ case "o":
+ output += formatNumber("o",
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
+ break;
+ case "m":
+ output += formatNumber("m", date.getMonth() + 1, 2);
+ break;
+ case "M":
+ output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
+ break;
+ case "y":
+ output += (lookAhead("y") ? date.getFullYear() :
+ (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
+ break;
+ case "@":
+ output += date.getTime();
+ break;
+ case "!":
+ output += date.getTime() * 10000 + this._ticksTo1970;
+ break;
+ case "'":
+ if (lookAhead("'")) {
+ output += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ output += format.charAt(iFormat);
+ }
+ }
+ }
+ }
+ return output;
+ },
+
+ /* Extract all possible characters from the date format. */
+ _possibleChars: function (format) {
+ var iFormat,
+ chars = "",
+ literal = false,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ chars += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d": case "m": case "y": case "@":
+ chars += "0123456789";
+ break;
+ case "D": case "M":
+ return null; // Accept anything
+ case "'":
+ if (lookAhead("'")) {
+ chars += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ chars += format.charAt(iFormat);
+ }
+ }
+ }
+ return chars;
+ },
+
+ /* Get a setting value, defaulting if necessary. */
+ _get: function(inst, name) {
+ return inst.settings[name] !== undefined ?
+ inst.settings[name] : this._defaults[name];
+ },
+
+ /* Parse existing date and initialise date picker. */
+ _setDateFromField: function(inst, noDefault) {
+ if (inst.input.val() === inst.lastVal) {
+ return;
+ }
+
+ var dateFormat = this._get(inst, "dateFormat"),
+ dates = inst.lastVal = inst.input ? inst.input.val() : null,
+ defaultDate = this._getDefaultDate(inst),
+ date = defaultDate,
+ settings = this._getFormatConfig(inst);
+
+ try {
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
+ } catch (event) {
+ dates = (noDefault ? "" : dates);
+ }
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ inst.currentDay = (dates ? date.getDate() : 0);
+ inst.currentMonth = (dates ? date.getMonth() : 0);
+ inst.currentYear = (dates ? date.getFullYear() : 0);
+ this._adjustInstDate(inst);
+ },
+
+ /* Retrieve the default date shown on opening. */
+ _getDefaultDate: function(inst) {
+ return this._restrictMinMax(inst,
+ this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
+ },
+
+ /* A date may be specified as an exact value or a relative one. */
+ _determineDate: function(inst, date, defaultDate) {
+ var offsetNumeric = function(offset) {
+ var date = new Date();
+ date.setDate(date.getDate() + offset);
+ return date;
+ },
+ offsetString = function(offset) {
+ try {
+ return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ offset, $.datepicker._getFormatConfig(inst));
+ }
+ catch (e) {
+ // Ignore
+ }
+
+ var date = (offset.toLowerCase().match(/^c/) ?
+ $.datepicker._getDate(inst) : null) || new Date(),
+ year = date.getFullYear(),
+ month = date.getMonth(),
+ day = date.getDate(),
+ pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
+ matches = pattern.exec(offset);
+
+ while (matches) {
+ switch (matches[2] || "d") {
+ case "d" : case "D" :
+ day += parseInt(matches[1],10); break;
+ case "w" : case "W" :
+ day += parseInt(matches[1],10) * 7; break;
+ case "m" : case "M" :
+ month += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ case "y": case "Y" :
+ year += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ }
+ matches = pattern.exec(offset);
+ }
+ return new Date(year, month, day);
+ },
+ newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
+ (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
+
+ newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
+ if (newDate) {
+ newDate.setHours(0);
+ newDate.setMinutes(0);
+ newDate.setSeconds(0);
+ newDate.setMilliseconds(0);
+ }
+ return this._daylightSavingAdjust(newDate);
+ },
+
+ /* Handle switch to/from daylight saving.
+ * Hours may be non-zero on daylight saving cut-over:
+ * > 12 when midnight changeover, but then cannot generate
+ * midnight datetime, so jump to 1AM, otherwise reset.
+ * @param date (Date) the date to check
+ * @return (Date) the corrected date
+ */
+ _daylightSavingAdjust: function(date) {
+ if (!date) {
+ return null;
+ }
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
+ return date;
+ },
+
+ /* Set the date(s) directly. */
+ _setDate: function(inst, date, noChange) {
+ var clear = !date,
+ origMonth = inst.selectedMonth,
+ origYear = inst.selectedYear,
+ newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
+
+ inst.selectedDay = inst.currentDay = newDate.getDate();
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
+ inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
+ if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
+ this._notifyChange(inst);
+ }
+ this._adjustInstDate(inst);
+ if (inst.input) {
+ inst.input.val(clear ? "" : this._formatDate(inst));
+ }
+ },
+
+ /* Retrieve the date(s) directly. */
+ _getDate: function(inst) {
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
+ this._daylightSavingAdjust(new Date(
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return startDate;
+ },
+
+ /* Attach the onxxx handlers. These are declared statically so
+ * they work with static code transformers like Caja.
+ */
+ _attachHandlers: function(inst) {
+ var stepMonths = this._get(inst, "stepMonths"),
+ id = "#" + inst.id.replace( /\\\\/g, "\\" );
+ inst.dpDiv.find("[data-handler]").map(function () {
+ var handler = {
+ prev: function () {
+ $.datepicker._adjustDate(id, -stepMonths, "M");
+ },
+ next: function () {
+ $.datepicker._adjustDate(id, +stepMonths, "M");
+ },
+ hide: function () {
+ $.datepicker._hideDatepicker();
+ },
+ today: function () {
+ $.datepicker._gotoToday(id);
+ },
+ selectDay: function () {
+ $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
+ return false;
+ },
+ selectMonth: function () {
+ $.datepicker._selectMonthYear(id, this, "M");
+ return false;
+ },
+ selectYear: function () {
+ $.datepicker._selectMonthYear(id, this, "Y");
+ return false;
+ }
+ };
+ $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
+ });
+ },
+
+ /* Generate the HTML for the current state of the date picker. */
+ _generateHTML: function(inst) {
+ var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
+ controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
+ monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
+ selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
+ cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
+ printDate, dRow, tbody, daySettings, otherMonth, unselectable,
+ tempDate = new Date(),
+ today = this._daylightSavingAdjust(
+ new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
+ isRTL = this._get(inst, "isRTL"),
+ showButtonPanel = this._get(inst, "showButtonPanel"),
+ hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
+ navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
+ numMonths = this._getNumberOfMonths(inst),
+ showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
+ stepMonths = this._get(inst, "stepMonths"),
+ isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
+ currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ drawMonth = inst.drawMonth - showCurrentAtPos,
+ drawYear = inst.drawYear;
+
+ if (drawMonth < 0) {
+ drawMonth += 12;
+ drawYear--;
+ }
+ if (maxDate) {
+ maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
+ drawMonth--;
+ if (drawMonth < 0) {
+ drawMonth = 11;
+ drawYear--;
+ }
+ }
+ }
+ inst.drawMonth = drawMonth;
+ inst.drawYear = drawYear;
+
+ prevText = this._get(inst, "prevText");
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
+ " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
+
+ nextText = this._get(inst, "nextText");
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
+ " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
+
+ currentText = this._get(inst, "currentText");
+ gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
+ currentText = (!navigationAsDateFormat ? currentText :
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
+
+ controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
+ this._get(inst, "closeText") + "</button>" : "");
+
+ buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
+ (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
+ ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
+
+ firstDay = parseInt(this._get(inst, "firstDay"),10);
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
+
+ showWeek = this._get(inst, "showWeek");
+ dayNames = this._get(inst, "dayNames");
+ dayNamesMin = this._get(inst, "dayNamesMin");
+ monthNames = this._get(inst, "monthNames");
+ monthNamesShort = this._get(inst, "monthNamesShort");
+ beforeShowDay = this._get(inst, "beforeShowDay");
+ showOtherMonths = this._get(inst, "showOtherMonths");
+ selectOtherMonths = this._get(inst, "selectOtherMonths");
+ defaultDate = this._getDefaultDate(inst);
+ html = "";
+ dow;
+ for (row = 0; row < numMonths[0]; row++) {
+ group = "";
+ this.maxRows = 4;
+ for (col = 0; col < numMonths[1]; col++) {
+ selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
+ cornerClass = " ui-corner-all";
+ calender = "";
+ if (isMultiMonth) {
+ calender += "<div class='ui-datepicker-group";
+ if (numMonths[1] > 1) {
+ switch (col) {
+ case 0: calender += " ui-datepicker-group-first";
+ cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
+ case numMonths[1]-1: calender += " ui-datepicker-group-last";
+ cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
+ default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
+ }
+ }
+ calender += "'>";
+ }
+ calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
+ (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
+ (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
+ "</div><table class='ui-datepicker-calendar'><thead>" +
+ "<tr>";
+ thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
+ for (dow = 0; dow < 7; dow++) { // days of the week
+ day = (dow + firstDay) % 7;
+ thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
+ "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
+ }
+ calender += thead + "</tr></thead><tbody>";
+ daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
+ if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
+ }
+ leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
+ curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
+ numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
+ this.maxRows = numRows;
+ printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
+ for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
+ calender += "<tr>";
+ tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
+ this._get(inst, "calculateWeek")(printDate) + "</td>");
+ for (dow = 0; dow < 7; dow++) { // create date picker days
+ daySettings = (beforeShowDay ?
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
+ otherMonth = (printDate.getMonth() !== drawMonth);
+ unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
+ tbody += "<td class='" +
+ ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
+ (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
+ ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
+ (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
+ // or defaultDate is current printedDate and defaultDate is selectedDate
+ " " + this._dayOverClass : "") + // highlight selected day
+ (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
+ (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
+ (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
+ (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
+ (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
+ (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
+ (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
+ (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
+ (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
+ (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
+ "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
+ printDate.setDate(printDate.getDate() + 1);
+ printDate = this._daylightSavingAdjust(printDate);
+ }
+ calender += tbody + "</tr>";
+ }
+ drawMonth++;
+ if (drawMonth > 11) {
+ drawMonth = 0;
+ drawYear++;
+ }
+ calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
+ ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
+ group += calender;
+ }
+ html += group;
+ }
+ html += buttonPanel;
+ inst._keyEvent = false;
+ return html;
+ },
+
+ /* Generate the month and year header. */
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
+ secondary, monthNames, monthNamesShort) {
+
+ var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
+ changeMonth = this._get(inst, "changeMonth"),
+ changeYear = this._get(inst, "changeYear"),
+ showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
+ html = "<div class='ui-datepicker-title'>",
+ monthHtml = "";
+
+ // month selection
+ if (secondary || !changeMonth) {
+ monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
+ } else {
+ inMinYear = (minDate && minDate.getFullYear() === drawYear);
+ inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
+ monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
+ for ( month = 0; month < 12; month++) {
+ if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
+ monthHtml += "<option value='" + month + "'" +
+ (month === drawMonth ? " selected='selected'" : "") +
+ ">" + monthNamesShort[month] + "</option>";
+ }
+ }
+ monthHtml += "</select>";
+ }
+
+ if (!showMonthAfterYear) {
+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
+ }
+
+ // year selection
+ if ( !inst.yearshtml ) {
+ inst.yearshtml = "";
+ if (secondary || !changeYear) {
+ html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
+ } else {
+ // determine range of years to display
+ years = this._get(inst, "yearRange").split(":");
+ thisYear = new Date().getFullYear();
+ determineYear = function(value) {
+ var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
+ (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
+ parseInt(value, 10)));
+ return (isNaN(year) ? thisYear : year);
+ };
+ year = determineYear(years[0]);
+ endYear = Math.max(year, determineYear(years[1] || ""));
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
+ inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
+ for (; year <= endYear; year++) {
+ inst.yearshtml += "<option value='" + year + "'" +
+ (year === drawYear ? " selected='selected'" : "") +
+ ">" + year + "</option>";
+ }
+ inst.yearshtml += "</select>";
+
+ html += inst.yearshtml;
+ inst.yearshtml = null;
+ }
+ }
+
+ html += this._get(inst, "yearSuffix");
+ if (showMonthAfterYear) {
+ html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
+ }
+ html += "</div>"; // Close datepicker_header
+ return html;
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustInstDate: function(inst, offset, period) {
+ var year = inst.drawYear + (period === "Y" ? offset : 0),
+ month = inst.drawMonth + (period === "M" ? offset : 0),
+ day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
+ date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
+
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ if (period === "M" || period === "Y") {
+ this._notifyChange(inst);
+ }
+ },
+
+ /* Ensure a date is within any min/max bounds. */
+ _restrictMinMax: function(inst, date) {
+ var minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ newDate = (minDate && date < minDate ? minDate : date);
+ return (maxDate && newDate > maxDate ? maxDate : newDate);
+ },
+
+ /* Notify change of month/year. */
+ _notifyChange: function(inst) {
+ var onChange = this._get(inst, "onChangeMonthYear");
+ if (onChange) {
+ onChange.apply((inst.input ? inst.input[0] : null),
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
+ }
+ },
+
+ /* Determine the number of months to show. */
+ _getNumberOfMonths: function(inst) {
+ var numMonths = this._get(inst, "numberOfMonths");
+ return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+ },
+
+ /* Determine the current maximum date - ensure no time components are set. */
+ _getMinMaxDate: function(inst, minMax) {
+ return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+ },
+
+ /* Find the number of days in a given month. */
+ _getDaysInMonth: function(year, month) {
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
+ },
+
+ /* Find the day of the week of the first of a month. */
+ _getFirstDayOfMonth: function(year, month) {
+ return new Date(year, month, 1).getDay();
+ },
+
+ /* Determines if we should allow a "next/prev" month display change. */
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
+ var numMonths = this._getNumberOfMonths(inst),
+ date = this._daylightSavingAdjust(new Date(curYear,
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+
+ if (offset < 0) {
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+ }
+ return this._isInRange(inst, date);
+ },
+
+ /* Is the given date in the accepted range? */
+ _isInRange: function(inst, date) {
+ var yearSplit, currentYear,
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ minYear = null,
+ maxYear = null,
+ years = this._get(inst, "yearRange");
+ if (years){
+ yearSplit = years.split(":");
+ currentYear = new Date().getFullYear();
+ minYear = parseInt(yearSplit[0], 10);
+ maxYear = parseInt(yearSplit[1], 10);
+ if ( yearSplit[0].match(/[+\-].*/) ) {
+ minYear += currentYear;
+ }
+ if ( yearSplit[1].match(/[+\-].*/) ) {
+ maxYear += currentYear;
+ }
+ }
+
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
+ (!maxDate || date.getTime() <= maxDate.getTime()) &&
+ (!minYear || date.getFullYear() >= minYear) &&
+ (!maxYear || date.getFullYear() <= maxYear));
+ },
+
+ /* Provide the configuration settings for formatting/parsing. */
+ _getFormatConfig: function(inst) {
+ var shortYearCutoff = this._get(inst, "shortYearCutoff");
+ shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+ return {shortYearCutoff: shortYearCutoff,
+ dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
+ monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+ },
+
+ /* Format the given date for display. */
+ _formatDate: function(inst, day, month, year) {
+ if (!day) {
+ inst.currentDay = inst.selectedDay;
+ inst.currentMonth = inst.selectedMonth;
+ inst.currentYear = inst.selectedYear;
+ }
+ var date = (day ? (typeof day === "object" ? day :
+ this._daylightSavingAdjust(new Date(year, month, day))) :
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
+ }
+});
+
+/*
+ * Bind hover events for datepicker elements.
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
+ * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
+ */
+function datepicker_bindHover(dpDiv) {
+ var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
+ return dpDiv.delegate(selector, "mouseout", function() {
+ $(this).removeClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).removeClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).removeClass("ui-datepicker-next-hover");
+ }
+ })
+ .delegate( selector, "mouseover", datepicker_handleMouseover );
+}
+
+function datepicker_handleMouseover() {
+ if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
+ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+ $(this).addClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).addClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).addClass("ui-datepicker-next-hover");
+ }
+ }
+}
+
+/* jQuery extend now ignores nulls! */
+function datepicker_extendRemove(target, props) {
+ $.extend(target, props);
+ for (var name in props) {
+ if (props[name] == null) {
+ target[name] = props[name];
+ }
+ }
+ return target;
+}
+
+/* Invoke the datepicker functionality.
+ @param options string - a command, optionally followed by additional parameters or
+ Object - settings for attaching new datepicker functionality
+ @return jQuery object */
+$.fn.datepicker = function(options){
+
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
+ if ( !this.length ) {
+ return this;
+ }
+
+ /* Initialise the date picker. */
+ if (!$.datepicker.initialized) {
+ $(document).mousedown($.datepicker._checkExternalClick);
+ $.datepicker.initialized = true;
+ }
+
+ /* Append datepicker main container to body if not exist. */
+ if ($("#"+$.datepicker._mainDivId).length === 0) {
+ $("body").append($.datepicker.dpDiv);
+ }
+
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
+ if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ return this.each(function() {
+ typeof options === "string" ?
+ $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this].concat(otherArgs)) :
+ $.datepicker._attachDatepicker(this, options);
+ });
+};
+
+$.datepicker = new Datepicker(); // singleton instance
+$.datepicker.initialized = false;
+$.datepicker.uuid = new Date().getTime();
+$.datepicker.version = "1.11.4";
+
+var datepicker = $.datepicker;
+
+
+/*!
+ * jQuery UI Dialog 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/dialog/
+ */
+
+
+var dialog = $.widget( "ui.dialog", {
+ version: "1.11.4",
+ options: {
+ appendTo: "body",
+ autoOpen: true,
+ buttons: [],
+ closeOnEscape: true,
+ closeText: "Close",
+ dialogClass: "",
+ draggable: true,
+ hide: null,
+ height: "auto",
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: {
+ my: "center",
+ at: "center",
+ of: window,
+ collision: "fit",
+ // Ensure the titlebar is always visible
+ using: function( pos ) {
+ var topOffset = $( this ).css( pos ).offset().top;
+ if ( topOffset < 0 ) {
+ $( this ).css( "top", pos.top - topOffset );
+ }
+ }
+ },
+ resizable: true,
+ show: null,
+ title: null,
+ width: 300,
+
+ // callbacks
+ beforeClose: null,
+ close: null,
+ drag: null,
+ dragStart: null,
+ dragStop: null,
+ focus: null,
+ open: null,
+ resize: null,
+ resizeStart: null,
+ resizeStop: null
+ },
+
+ sizeRelatedOptions: {
+ buttons: true,
+ height: true,
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true,
+ width: true
+ },
+
+ resizableRelatedOptions: {
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true
+ },
+
+ _create: function() {
+ this.originalCss = {
+ display: this.element[ 0 ].style.display,
+ width: this.element[ 0 ].style.width,
+ minHeight: this.element[ 0 ].style.minHeight,
+ maxHeight: this.element[ 0 ].style.maxHeight,
+ height: this.element[ 0 ].style.height
+ };
+ this.originalPosition = {
+ parent: this.element.parent(),
+ index: this.element.parent().children().index( this.element )
+ };
+ this.originalTitle = this.element.attr( "title" );
+ this.options.title = this.options.title || this.originalTitle;
+
+ this._createWrapper();
+
+ this.element
+ .show()
+ .removeAttr( "title" )
+ .addClass( "ui-dialog-content ui-widget-content" )
+ .appendTo( this.uiDialog );
+
+ this._createTitlebar();
+ this._createButtonPane();
+
+ if ( this.options.draggable && $.fn.draggable ) {
+ this._makeDraggable();
+ }
+ if ( this.options.resizable && $.fn.resizable ) {
+ this._makeResizable();
+ }
+
+ this._isOpen = false;
+
+ this._trackFocus();
+ },
+
+ _init: function() {
+ if ( this.options.autoOpen ) {
+ this.open();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+ if ( element && (element.jquery || element.nodeType) ) {
+ return $( element );
+ }
+ return this.document.find( element || "body" ).eq( 0 );
+ },
+
+ _destroy: function() {
+ var next,
+ originalPosition = this.originalPosition;
+
+ this._untrackInstance();
+ this._destroyOverlay();
+
+ this.element
+ .removeUniqueId()
+ .removeClass( "ui-dialog-content ui-widget-content" )
+ .css( this.originalCss )
+ // Without detaching first, the following becomes really slow
+ .detach();
+
+ this.uiDialog.stop( true, true ).remove();
+
+ if ( this.originalTitle ) {
+ this.element.attr( "title", this.originalTitle );
+ }
+
+ next = originalPosition.parent.children().eq( originalPosition.index );
+ // Don't try to place the dialog next to itself (#8613)
+ if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
+ next.before( this.element );
+ } else {
+ originalPosition.parent.append( this.element );
+ }
+ },
+
+ widget: function() {
+ return this.uiDialog;
+ },
+
+ disable: $.noop,
+ enable: $.noop,
+
+ close: function( event ) {
+ var activeElement,
+ that = this;
+
+ if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
+ return;
+ }
+
+ this._isOpen = false;
+ this._focusedElement = null;
+ this._destroyOverlay();
+ this._untrackInstance();
+
+ if ( !this.opener.filter( ":focusable" ).focus().length ) {
+
+ // support: IE9
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+ activeElement = this.document[ 0 ].activeElement;
+
+ // Support: IE9, IE10
+ // If the <body> is blurred, IE will switch windows, see #4520
+ if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
+
+ // Hiding a focused element doesn't trigger blur in WebKit
+ // so in case we have nothing to focus on, explicitly blur the active element
+ // https://bugs.webkit.org/show_bug.cgi?id=47182
+ $( activeElement ).blur();
+ }
+ } catch ( error ) {}
+ }
+
+ this._hide( this.uiDialog, this.options.hide, function() {
+ that._trigger( "close", event );
+ });
+ },
+
+ isOpen: function() {
+ return this._isOpen;
+ },
+
+ moveToTop: function() {
+ this._moveToTop();
+ },
+
+ _moveToTop: function( event, silent ) {
+ var moved = false,
+ zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
+ return +$( this ).css( "z-index" );
+ }).get(),
+ zIndexMax = Math.max.apply( null, zIndices );
+
+ if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
+ this.uiDialog.css( "z-index", zIndexMax + 1 );
+ moved = true;
+ }
+
+ if ( moved && !silent ) {
+ this._trigger( "focus", event );
+ }
+ return moved;
+ },
+
+ open: function() {
+ var that = this;
+ if ( this._isOpen ) {
+ if ( this._moveToTop() ) {
+ this._focusTabbable();
+ }
+ return;
+ }
+
+ this._isOpen = true;
+ this.opener = $( this.document[ 0 ].activeElement );
+
+ this._size();
+ this._position();
+ this._createOverlay();
+ this._moveToTop( null, true );
+
+ // Ensure the overlay is moved to the top with the dialog, but only when
+ // opening. The overlay shouldn't move after the dialog is open so that
+ // modeless dialogs opened after the modal dialog stack properly.
+ if ( this.overlay ) {
+ this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
+ }
+
+ this._show( this.uiDialog, this.options.show, function() {
+ that._focusTabbable();
+ that._trigger( "focus" );
+ });
+
+ // Track the dialog immediately upon openening in case a focus event
+ // somehow occurs outside of the dialog before an element inside the
+ // dialog is focused (#10152)
+ this._makeFocusTarget();
+
+ this._trigger( "open" );
+ },
+
+ _focusTabbable: function() {
+ // Set focus to the first match:
+ // 1. An element that was focused previously
+ // 2. First element inside the dialog matching [autofocus]
+ // 3. Tabbable element inside the content element
+ // 4. Tabbable element inside the buttonpane
+ // 5. The close button
+ // 6. The dialog itself
+ var hasFocus = this._focusedElement;
+ if ( !hasFocus ) {
+ hasFocus = this.element.find( "[autofocus]" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.element.find( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialog;
+ }
+ hasFocus.eq( 0 ).focus();
+ },
+
+ _keepFocus: function( event ) {
+ function checkFocus() {
+ var activeElement = this.document[0].activeElement,
+ isActive = this.uiDialog[0] === activeElement ||
+ $.contains( this.uiDialog[0], activeElement );
+ if ( !isActive ) {
+ this._focusTabbable();
+ }
+ }
+ event.preventDefault();
+ checkFocus.call( this );
+ // support: IE
+ // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
+ // so we check again later
+ this._delay( checkFocus );
+ },
+
+ _createWrapper: function() {
+ this.uiDialog = $("<div>")
+ .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
+ this.options.dialogClass )
+ .hide()
+ .attr({
+ // Setting tabIndex makes the div focusable
+ tabIndex: -1,
+ role: "dialog"
+ })
+ .appendTo( this._appendTo() );
+
+ this._on( this.uiDialog, {
+ keydown: function( event ) {
+ if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
+ event.keyCode === $.ui.keyCode.ESCAPE ) {
+ event.preventDefault();
+ this.close( event );
+ return;
+ }
+
+ // prevent tabbing out of dialogs
+ if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
+ return;
+ }
+ var tabbables = this.uiDialog.find( ":tabbable" ),
+ first = tabbables.filter( ":first" ),
+ last = tabbables.filter( ":last" );
+
+ if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
+ this._delay(function() {
+ first.focus();
+ });
+ event.preventDefault();
+ } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
+ this._delay(function() {
+ last.focus();
+ });
+ event.preventDefault();
+ }
+ },
+ mousedown: function( event ) {
+ if ( this._moveToTop( event ) ) {
+ this._focusTabbable();
+ }
+ }
+ });
+
+ // We assume that any existing aria-describedby attribute means
+ // that the dialog content is marked up properly
+ // otherwise we brute force the content as the description
+ if ( !this.element.find( "[aria-describedby]" ).length ) {
+ this.uiDialog.attr({
+ "aria-describedby": this.element.uniqueId().attr( "id" )
+ });
+ }
+ },
+
+ _createTitlebar: function() {
+ var uiDialogTitle;
+
+ this.uiDialogTitlebar = $( "<div>" )
+ .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
+ .prependTo( this.uiDialog );
+ this._on( this.uiDialogTitlebar, {
+ mousedown: function( event ) {
+ // Don't prevent click on close button (#8838)
+ // Focusing a dialog that is partially scrolled out of view
+ // causes the browser to scroll it into view, preventing the click event
+ if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
+ // Dialog isn't getting focus when dragging (#8063)
+ this.uiDialog.focus();
+ }
+ }
+ });
+
+ // support: IE
+ // Use type="button" to prevent enter keypresses in textboxes from closing the
+ // dialog in IE (#9312)
+ this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
+ .button({
+ label: this.options.closeText,
+ icons: {
+ primary: "ui-icon-closethick"
+ },
+ text: false
+ })
+ .addClass( "ui-dialog-titlebar-close" )
+ .appendTo( this.uiDialogTitlebar );
+ this._on( this.uiDialogTitlebarClose, {
+ click: function( event ) {
+ event.preventDefault();
+ this.close( event );
+ }
+ });
+
+ uiDialogTitle = $( "<span>" )
+ .uniqueId()
+ .addClass( "ui-dialog-title" )
+ .prependTo( this.uiDialogTitlebar );
+ this._title( uiDialogTitle );
+
+ this.uiDialog.attr({
+ "aria-labelledby": uiDialogTitle.attr( "id" )
+ });
+ },
+
+ _title: function( title ) {
+ if ( !this.options.title ) {
+ title.html( "&#160;" );
+ }
+ title.text( this.options.title );
+ },
+
+ _createButtonPane: function() {
+ this.uiDialogButtonPane = $( "<div>" )
+ .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
+
+ this.uiButtonSet = $( "<div>" )
+ .addClass( "ui-dialog-buttonset" )
+ .appendTo( this.uiDialogButtonPane );
+
+ this._createButtons();
+ },
+
+ _createButtons: function() {
+ var that = this,
+ buttons = this.options.buttons;
+
+ // if we already have a button pane, remove it
+ this.uiDialogButtonPane.remove();
+ this.uiButtonSet.empty();
+
+ if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
+ this.uiDialog.removeClass( "ui-dialog-buttons" );
+ return;
+ }
+
+ $.each( buttons, function( name, props ) {
+ var click, buttonOptions;
+ props = $.isFunction( props ) ?
+ { click: props, text: name } :
+ props;
+ // Default to a non-submitting button
+ props = $.extend( { type: "button" }, props );
+ // Change the context for the click callback to be the main element
+ click = props.click;
+ props.click = function() {
+ click.apply( that.element[ 0 ], arguments );
+ };
+ buttonOptions = {
+ icons: props.icons,
+ text: props.showText
+ };
+ delete props.icons;
+ delete props.showText;
+ $( "<button></button>", props )
+ .button( buttonOptions )
+ .appendTo( that.uiButtonSet );
+ });
+ this.uiDialog.addClass( "ui-dialog-buttons" );
+ this.uiDialogButtonPane.appendTo( this.uiDialog );
+ },
+
+ _makeDraggable: function() {
+ var that = this,
+ options = this.options;
+
+ function filteredUi( ui ) {
+ return {
+ position: ui.position,
+ offset: ui.offset
+ };
+ }
+
+ this.uiDialog.draggable({
+ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
+ handle: ".ui-dialog-titlebar",
+ containment: "document",
+ start: function( event, ui ) {
+ $( this ).addClass( "ui-dialog-dragging" );
+ that._blockFrames();
+ that._trigger( "dragStart", event, filteredUi( ui ) );
+ },
+ drag: function( event, ui ) {
+ that._trigger( "drag", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ var left = ui.offset.left - that.document.scrollLeft(),
+ top = ui.offset.top - that.document.scrollTop();
+
+ options.position = {
+ my: "left top",
+ at: "left" + (left >= 0 ? "+" : "") + left + " " +
+ "top" + (top >= 0 ? "+" : "") + top,
+ of: that.window
+ };
+ $( this ).removeClass( "ui-dialog-dragging" );
+ that._unblockFrames();
+ that._trigger( "dragStop", event, filteredUi( ui ) );
+ }
+ });
+ },
+
+ _makeResizable: function() {
+ var that = this,
+ options = this.options,
+ handles = options.resizable,
+ // .ui-resizable has position: relative defined in the stylesheet
+ // but dialogs have to use absolute or fixed positioning
+ position = this.uiDialog.css("position"),
+ resizeHandles = typeof handles === "string" ?
+ handles :
+ "n,e,s,w,se,sw,ne,nw";
+
+ function filteredUi( ui ) {
+ return {
+ originalPosition: ui.originalPosition,
+ originalSize: ui.originalSize,
+ position: ui.position,
+ size: ui.size
+ };
+ }
+
+ this.uiDialog.resizable({
+ cancel: ".ui-dialog-content",
+ containment: "document",
+ alsoResize: this.element,
+ maxWidth: options.maxWidth,
+ maxHeight: options.maxHeight,
+ minWidth: options.minWidth,
+ minHeight: this._minHeight(),
+ handles: resizeHandles,
+ start: function( event, ui ) {
+ $( this ).addClass( "ui-dialog-resizing" );
+ that._blockFrames();
+ that._trigger( "resizeStart", event, filteredUi( ui ) );
+ },
+ resize: function( event, ui ) {
+ that._trigger( "resize", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ var offset = that.uiDialog.offset(),
+ left = offset.left - that.document.scrollLeft(),
+ top = offset.top - that.document.scrollTop();
+
+ options.height = that.uiDialog.height();
+ options.width = that.uiDialog.width();
+ options.position = {
+ my: "left top",
+ at: "left" + (left >= 0 ? "+" : "") + left + " " +
+ "top" + (top >= 0 ? "+" : "") + top,
+ of: that.window
+ };
+ $( this ).removeClass( "ui-dialog-resizing" );
+ that._unblockFrames();
+ that._trigger( "resizeStop", event, filteredUi( ui ) );
+ }
+ })
+ .css( "position", position );
+ },
+
+ _trackFocus: function() {
+ this._on( this.widget(), {
+ focusin: function( event ) {
+ this._makeFocusTarget();
+ this._focusedElement = $( event.target );
+ }
+ });
+ },
+
+ _makeFocusTarget: function() {
+ this._untrackInstance();
+ this._trackingInstances().unshift( this );
+ },
+
+ _untrackInstance: function() {
+ var instances = this._trackingInstances(),
+ exists = $.inArray( this, instances );
+ if ( exists !== -1 ) {
+ instances.splice( exists, 1 );
+ }
+ },
+
+ _trackingInstances: function() {
+ var instances = this.document.data( "ui-dialog-instances" );
+ if ( !instances ) {
+ instances = [];
+ this.document.data( "ui-dialog-instances", instances );
+ }
+ return instances;
+ },
+
+ _minHeight: function() {
+ var options = this.options;
+
+ return options.height === "auto" ?
+ options.minHeight :
+ Math.min( options.minHeight, options.height );
+ },
+
+ _position: function() {
+ // Need to show the dialog to get the actual offset in the position plugin
+ var isVisible = this.uiDialog.is( ":visible" );
+ if ( !isVisible ) {
+ this.uiDialog.show();
+ }
+ this.uiDialog.position( this.options.position );
+ if ( !isVisible ) {
+ this.uiDialog.hide();
+ }
+ },
+
+ _setOptions: function( options ) {
+ var that = this,
+ resize = false,
+ resizableOptions = {};
+
+ $.each( options, function( key, value ) {
+ that._setOption( key, value );
+
+ if ( key in that.sizeRelatedOptions ) {
+ resize = true;
+ }
+ if ( key in that.resizableRelatedOptions ) {
+ resizableOptions[ key ] = value;
+ }
+ });
+
+ if ( resize ) {
+ this._size();
+ this._position();
+ }
+ if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+ this.uiDialog.resizable( "option", resizableOptions );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var isDraggable, isResizable,
+ uiDialog = this.uiDialog;
+
+ if ( key === "dialogClass" ) {
+ uiDialog
+ .removeClass( this.options.dialogClass )
+ .addClass( value );
+ }
+
+ if ( key === "disabled" ) {
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "appendTo" ) {
+ this.uiDialog.appendTo( this._appendTo() );
+ }
+
+ if ( key === "buttons" ) {
+ this._createButtons();
+ }
+
+ if ( key === "closeText" ) {
+ this.uiDialogTitlebarClose.button({
+ // Ensure that we always pass a string
+ label: "" + value
+ });
+ }
+
+ if ( key === "draggable" ) {
+ isDraggable = uiDialog.is( ":data(ui-draggable)" );
+ if ( isDraggable && !value ) {
+ uiDialog.draggable( "destroy" );
+ }
+
+ if ( !isDraggable && value ) {
+ this._makeDraggable();
+ }
+ }
+
+ if ( key === "position" ) {
+ this._position();
+ }
+
+ if ( key === "resizable" ) {
+ // currently resizable, becoming non-resizable
+ isResizable = uiDialog.is( ":data(ui-resizable)" );
+ if ( isResizable && !value ) {
+ uiDialog.resizable( "destroy" );
+ }
+
+ // currently resizable, changing handles
+ if ( isResizable && typeof value === "string" ) {
+ uiDialog.resizable( "option", "handles", value );
+ }
+
+ // currently non-resizable, becoming resizable
+ if ( !isResizable && value !== false ) {
+ this._makeResizable();
+ }
+ }
+
+ if ( key === "title" ) {
+ this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
+ }
+ },
+
+ _size: function() {
+ // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
+ // divs will both have width and height set, so we need to reset them
+ var nonContentHeight, minContentHeight, maxContentHeight,
+ options = this.options;
+
+ // Reset content sizing
+ this.element.show().css({
+ width: "auto",
+ minHeight: 0,
+ maxHeight: "none",
+ height: 0
+ });
+
+ if ( options.minWidth > options.width ) {
+ options.width = options.minWidth;
+ }
+
+ // reset wrapper sizing
+ // determine the height of all the non-content elements
+ nonContentHeight = this.uiDialog.css({
+ height: "auto",
+ width: options.width
+ })
+ .outerHeight();
+ minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
+ maxContentHeight = typeof options.maxHeight === "number" ?
+ Math.max( 0, options.maxHeight - nonContentHeight ) :
+ "none";
+
+ if ( options.height === "auto" ) {
+ this.element.css({
+ minHeight: minContentHeight,
+ maxHeight: maxContentHeight,
+ height: "auto"
+ });
+ } else {
+ this.element.height( Math.max( 0, options.height - nonContentHeight ) );
+ }
+
+ if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+ this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
+ }
+ },
+
+ _blockFrames: function() {
+ this.iframeBlocks = this.document.find( "iframe" ).map(function() {
+ var iframe = $( this );
+
+ return $( "<div>" )
+ .css({
+ position: "absolute",
+ width: iframe.outerWidth(),
+ height: iframe.outerHeight()
+ })
+ .appendTo( iframe.parent() )
+ .offset( iframe.offset() )[0];
+ });
+ },
+
+ _unblockFrames: function() {
+ if ( this.iframeBlocks ) {
+ this.iframeBlocks.remove();
+ delete this.iframeBlocks;
+ }
+ },
+
+ _allowInteraction: function( event ) {
+ if ( $( event.target ).closest( ".ui-dialog" ).length ) {
+ return true;
+ }
+
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ return !!$( event.target ).closest( ".ui-datepicker" ).length;
+ },
+
+ _createOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ // We use a delay in case the overlay is created from an
+ // event that we're going to be cancelling (#2804)
+ var isOpening = true;
+ this._delay(function() {
+ isOpening = false;
+ });
+
+ if ( !this.document.data( "ui-dialog-overlays" ) ) {
+
+ // Prevent use of anchors and inputs
+ // Using _on() for an event handler shared across many instances is
+ // safe because the dialogs stack and must be closed in reverse order
+ this._on( this.document, {
+ focusin: function( event ) {
+ if ( isOpening ) {
+ return;
+ }
+
+ if ( !this._allowInteraction( event ) ) {
+ event.preventDefault();
+ this._trackingInstances()[ 0 ]._focusTabbable();
+ }
+ }
+ });
+ }
+
+ this.overlay = $( "<div>" )
+ .addClass( "ui-widget-overlay ui-front" )
+ .appendTo( this._appendTo() );
+ this._on( this.overlay, {
+ mousedown: "_keepFocus"
+ });
+ this.document.data( "ui-dialog-overlays",
+ (this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
+ },
+
+ _destroyOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ if ( this.overlay ) {
+ var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
+
+ if ( !overlays ) {
+ this.document
+ .unbind( "focusin" )
+ .removeData( "ui-dialog-overlays" );
+ } else {
+ this.document.data( "ui-dialog-overlays", overlays );
+ }
+
+ this.overlay.remove();
+ this.overlay = null;
+ }
+ }
+});
+
+
+/*!
+ * jQuery UI Spinner 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/spinner/
+ */
+
+
+function spinner_modifier( fn ) {
+ return function() {
+ var previous = this.element.val();
+ fn.apply( this, arguments );
+ this._refresh();
+ if ( previous !== this.element.val() ) {
+ this._trigger( "change" );
+ }
+ };
+}
+
+var spinner = $.widget( "ui.spinner", {
+ version: "1.11.4",
+ defaultElement: "<input>",
+ widgetEventPrefix: "spin",
+ options: {
+ culture: null,
+ icons: {
+ down: "ui-icon-triangle-1-s",
+ up: "ui-icon-triangle-1-n"
+ },
+ incremental: true,
+ max: null,
+ min: null,
+ numberFormat: null,
+ page: 10,
+ step: 1,
+
+ change: null,
+ spin: null,
+ start: null,
+ stop: null
+ },
+
+ _create: function() {
+ // handle string values that need to be parsed
+ this._setOption( "max", this.options.max );
+ this._setOption( "min", this.options.min );
+ this._setOption( "step", this.options.step );
+
+ // Only format if there is a value, prevents the field from being marked
+ // as invalid in Firefox, see #9573.
+ if ( this.value() !== "" ) {
+ // Format the value, but don't constrain.
+ this._value( this.element.val(), true );
+ }
+
+ this._draw();
+ this._on( this._events );
+ this._refresh();
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _getCreateOptions: function() {
+ var options = {},
+ element = this.element;
+
+ $.each( [ "min", "max", "step" ], function( i, option ) {
+ var value = element.attr( option );
+ if ( value !== undefined && value.length ) {
+ options[ option ] = value;
+ }
+ });
+
+ return options;
+ },
+
+ _events: {
+ keydown: function( event ) {
+ if ( this._start( event ) && this._keydown( event ) ) {
+ event.preventDefault();
+ }
+ },
+ keyup: "_stop",
+ focus: function() {
+ this.previous = this.element.val();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ this._stop();
+ this._refresh();
+ if ( this.previous !== this.element.val() ) {
+ this._trigger( "change", event );
+ }
+ },
+ mousewheel: function( event, delta ) {
+ if ( !delta ) {
+ return;
+ }
+ if ( !this.spinning && !this._start( event ) ) {
+ return false;
+ }
+
+ this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
+ clearTimeout( this.mousewheelTimer );
+ this.mousewheelTimer = this._delay(function() {
+ if ( this.spinning ) {
+ this._stop( event );
+ }
+ }, 100 );
+ event.preventDefault();
+ },
+ "mousedown .ui-spinner-button": function( event ) {
+ var previous;
+
+ // We never want the buttons to have focus; whenever the user is
+ // interacting with the spinner, the focus should be on the input.
+ // If the input is focused then this.previous is properly set from
+ // when the input first received focus. If the input is not focused
+ // then we need to set this.previous based on the value before spinning.
+ previous = this.element[0] === this.document[0].activeElement ?
+ this.previous : this.element.val();
+ function checkFocus() {
+ var isActive = this.element[0] === this.document[0].activeElement;
+ if ( !isActive ) {
+ this.element.focus();
+ this.previous = previous;
+ // support: IE
+ // IE sets focus asynchronously, so we need to check if focus
+ // moved off of the input because the user clicked on the button.
+ this._delay(function() {
+ this.previous = previous;
+ });
+ }
+ }
+
+ // ensure focus is on (or stays on) the text field
+ event.preventDefault();
+ checkFocus.call( this );
+
+ // support: IE
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ // and check (again) if focus moved off of the input.
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ checkFocus.call( this );
+ });
+
+ if ( this._start( event ) === false ) {
+ return;
+ }
+
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ "mouseup .ui-spinner-button": "_stop",
+ "mouseenter .ui-spinner-button": function( event ) {
+ // button will add ui-state-active if mouse was down while mouseleave and kept down
+ if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
+ return;
+ }
+
+ if ( this._start( event ) === false ) {
+ return false;
+ }
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ // TODO: do we really want to consider this a stop?
+ // shouldn't we just stop the repeater and wait until mouseup before
+ // we trigger the stop event?
+ "mouseleave .ui-spinner-button": "_stop"
+ },
+
+ _draw: function() {
+ var uiSpinner = this.uiSpinner = this.element
+ .addClass( "ui-spinner-input" )
+ .attr( "autocomplete", "off" )
+ .wrap( this._uiSpinnerHtml() )
+ .parent()
+ // add buttons
+ .append( this._buttonHtml() );
+
+ this.element.attr( "role", "spinbutton" );
+
+ // button bindings
+ this.buttons = uiSpinner.find( ".ui-spinner-button" )
+ .attr( "tabIndex", -1 )
+ .button()
+ .removeClass( "ui-corner-all" );
+
+ // IE 6 doesn't understand height: 50% for the buttons
+ // unless the wrapper has an explicit height
+ if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
+ uiSpinner.height() > 0 ) {
+ uiSpinner.height( uiSpinner.height() );
+ }
+
+ // disable spinner if element was already disabled
+ if ( this.options.disabled ) {
+ this.disable();
+ }
+ },
+
+ _keydown: function( event ) {
+ var options = this.options,
+ keyCode = $.ui.keyCode;
+
+ switch ( event.keyCode ) {
+ case keyCode.UP:
+ this._repeat( null, 1, event );
+ return true;
+ case keyCode.DOWN:
+ this._repeat( null, -1, event );
+ return true;
+ case keyCode.PAGE_UP:
+ this._repeat( null, options.page, event );
+ return true;
+ case keyCode.PAGE_DOWN:
+ this._repeat( null, -options.page, event );
+ return true;
+ }
+
+ return false;
+ },
+
+ _uiSpinnerHtml: function() {
+ return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
+ },
+
+ _buttonHtml: function() {
+ return "" +
+ "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
+ "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
+ "</a>" +
+ "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
+ "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
+ "</a>";
+ },
+
+ _start: function( event ) {
+ if ( !this.spinning && this._trigger( "start", event ) === false ) {
+ return false;
+ }
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+ this.spinning = true;
+ return true;
+ },
+
+ _repeat: function( i, steps, event ) {
+ i = i || 500;
+
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ this._repeat( 40, steps, event );
+ }, i );
+
+ this._spin( steps * this.options.step, event );
+ },
+
+ _spin: function( step, event ) {
+ var value = this.value() || 0;
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+
+ value = this._adjustValue( value + step * this._increment( this.counter ) );
+
+ if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
+ this._value( value );
+ this.counter++;
+ }
+ },
+
+ _increment: function( i ) {
+ var incremental = this.options.incremental;
+
+ if ( incremental ) {
+ return $.isFunction( incremental ) ?
+ incremental( i ) :
+ Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
+ }
+
+ return 1;
+ },
+
+ _precision: function() {
+ var precision = this._precisionOf( this.options.step );
+ if ( this.options.min !== null ) {
+ precision = Math.max( precision, this._precisionOf( this.options.min ) );
+ }
+ return precision;
+ },
+
+ _precisionOf: function( num ) {
+ var str = num.toString(),
+ decimal = str.indexOf( "." );
+ return decimal === -1 ? 0 : str.length - decimal - 1;
+ },
+
+ _adjustValue: function( value ) {
+ var base, aboveMin,
+ options = this.options;
+
+ // make sure we're at a valid step
+ // - find out where we are relative to the base (min or 0)
+ base = options.min !== null ? options.min : 0;
+ aboveMin = value - base;
+ // - round to the nearest step
+ aboveMin = Math.round(aboveMin / options.step) * options.step;
+ // - rounding is based on 0, so adjust back to our base
+ value = base + aboveMin;
+
+ // fix precision from bad JS floating point math
+ value = parseFloat( value.toFixed( this._precision() ) );
+
+ // clamp the value
+ if ( options.max !== null && value > options.max) {
+ return options.max;
+ }
+ if ( options.min !== null && value < options.min ) {
+ return options.min;
+ }
+
+ return value;
+ },
+
+ _stop: function( event ) {
+ if ( !this.spinning ) {
+ return;
+ }
+
+ clearTimeout( this.timer );
+ clearTimeout( this.mousewheelTimer );
+ this.counter = 0;
+ this.spinning = false;
+ this._trigger( "stop", event );
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "culture" || key === "numberFormat" ) {
+ var prevValue = this._parse( this.element.val() );
+ this.options[ key ] = value;
+ this.element.val( this._format( prevValue ) );
+ return;
+ }
+
+ if ( key === "max" || key === "min" || key === "step" ) {
+ if ( typeof value === "string" ) {
+ value = this._parse( value );
+ }
+ }
+ if ( key === "icons" ) {
+ this.buttons.first().find( ".ui-icon" )
+ .removeClass( this.options.icons.up )
+ .addClass( value.up );
+ this.buttons.last().find( ".ui-icon" )
+ .removeClass( this.options.icons.down )
+ .addClass( value.down );
+ }
+
+ this._super( key, value );
+
+ if ( key === "disabled" ) {
+ this.widget().toggleClass( "ui-state-disabled", !!value );
+ this.element.prop( "disabled", !!value );
+ this.buttons.button( value ? "disable" : "enable" );
+ }
+ },
+
+ _setOptions: spinner_modifier(function( options ) {
+ this._super( options );
+ }),
+
+ _parse: function( val ) {
+ if ( typeof val === "string" && val !== "" ) {
+ val = window.Globalize && this.options.numberFormat ?
+ Globalize.parseFloat( val, 10, this.options.culture ) : +val;
+ }
+ return val === "" || isNaN( val ) ? null : val;
+ },
+
+ _format: function( value ) {
+ if ( value === "" ) {
+ return "";
+ }
+ return window.Globalize && this.options.numberFormat ?
+ Globalize.format( value, this.options.numberFormat, this.options.culture ) :
+ value;
+ },
+
+ _refresh: function() {
+ this.element.attr({
+ "aria-valuemin": this.options.min,
+ "aria-valuemax": this.options.max,
+ // TODO: what should we do with values that can't be parsed?
+ "aria-valuenow": this._parse( this.element.val() )
+ });
+ },
+
+ isValid: function() {
+ var value = this.value();
+
+ // null is invalid
+ if ( value === null ) {
+ return false;
+ }
+
+ // if value gets adjusted, it's invalid
+ return value === this._adjustValue( value );
+ },
+
+ // update the value without triggering change
+ _value: function( value, allowAny ) {
+ var parsed;
+ if ( value !== "" ) {
+ parsed = this._parse( value );
+ if ( parsed !== null ) {
+ if ( !allowAny ) {
+ parsed = this._adjustValue( parsed );
+ }
+ value = this._format( parsed );
+ }
+ }
+ this.element.val( value );
+ this._refresh();
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-spinner-input" )
+ .prop( "disabled", false )
+ .removeAttr( "autocomplete" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+ this.uiSpinner.replaceWith( this.element );
+ },
+
+ stepUp: spinner_modifier(function( steps ) {
+ this._stepUp( steps );
+ }),
+ _stepUp: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * this.options.step );
+ this._stop();
+ }
+ },
+
+ stepDown: spinner_modifier(function( steps ) {
+ this._stepDown( steps );
+ }),
+ _stepDown: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * -this.options.step );
+ this._stop();
+ }
+ },
+
+ pageUp: spinner_modifier(function( pages ) {
+ this._stepUp( (pages || 1) * this.options.page );
+ }),
+
+ pageDown: spinner_modifier(function( pages ) {
+ this._stepDown( (pages || 1) * this.options.page );
+ }),
+
+ value: function( newVal ) {
+ if ( !arguments.length ) {
+ return this._parse( this.element.val() );
+ }
+ spinner_modifier( this._value ).call( this, newVal );
+ },
+
+ widget: function() {
+ return this.uiSpinner;
+ }
+});
+
+
+/*!
+ * jQuery UI Tabs 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tabs/
+ */
+
+
+var tabs = $.widget( "ui.tabs", {
+ version: "1.11.4",
+ delay: 300,
+ options: {
+ active: null,
+ collapsible: false,
+ event: "click",
+ heightStyle: "content",
+ hide: null,
+ show: null,
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ load: null
+ },
+
+ _isLocal: (function() {
+ var rhash = /#.*$/;
+
+ return function( anchor ) {
+ var anchorUrl, locationUrl;
+
+ // support: IE7
+ // IE7 doesn't normalize the href property when set via script (#9317)
+ anchor = anchor.cloneNode( false );
+
+ anchorUrl = anchor.href.replace( rhash, "" );
+ locationUrl = location.href.replace( rhash, "" );
+
+ // decoding may throw an error if the URL isn't UTF-8 (#9518)
+ try {
+ anchorUrl = decodeURIComponent( anchorUrl );
+ } catch ( error ) {}
+ try {
+ locationUrl = decodeURIComponent( locationUrl );
+ } catch ( error ) {}
+
+ return anchor.hash.length > 1 && anchorUrl === locationUrl;
+ };
+ })(),
+
+ _create: function() {
+ var that = this,
+ options = this.options;
+
+ this.running = false;
+
+ this.element
+ .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
+ .toggleClass( "ui-tabs-collapsible", options.collapsible );
+
+ this._processTabs();
+ options.active = this._initialActive();
+
+ // Take disabling tabs via class attribute from HTML
+ // into account and update option properly.
+ if ( $.isArray( options.disabled ) ) {
+ options.disabled = $.unique( options.disabled.concat(
+ $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
+ return that.tabs.index( li );
+ })
+ ) ).sort();
+ }
+
+ // check for length avoids error when initializing empty list
+ if ( this.options.active !== false && this.anchors.length ) {
+ this.active = this._findActive( options.active );
+ } else {
+ this.active = $();
+ }
+
+ this._refresh();
+
+ if ( this.active.length ) {
+ this.load( options.active );
+ }
+ },
+
+ _initialActive: function() {
+ var active = this.options.active,
+ collapsible = this.options.collapsible,
+ locationHash = location.hash.substring( 1 );
+
+ if ( active === null ) {
+ // check the fragment identifier in the URL
+ if ( locationHash ) {
+ this.tabs.each(function( i, tab ) {
+ if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
+ active = i;
+ return false;
+ }
+ });
+ }
+
+ // check for a tab marked active via a class
+ if ( active === null ) {
+ active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
+ }
+
+ // no active tab, set to false
+ if ( active === null || active === -1 ) {
+ active = this.tabs.length ? 0 : false;
+ }
+ }
+
+ // handle numbers: negative, out of range
+ if ( active !== false ) {
+ active = this.tabs.index( this.tabs.eq( active ) );
+ if ( active === -1 ) {
+ active = collapsible ? false : 0;
+ }
+ }
+
+ // don't allow collapsible: false and active: false
+ if ( !collapsible && active === false && this.anchors.length ) {
+ active = 0;
+ }
+
+ return active;
+ },
+
+ _getCreateEventData: function() {
+ return {
+ tab: this.active,
+ panel: !this.active.length ? $() : this._getPanelForTab( this.active )
+ };
+ },
+
+ _tabKeydown: function( event ) {
+ var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
+ selectedIndex = this.tabs.index( focusedTab ),
+ goingForward = true;
+
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ selectedIndex++;
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.LEFT:
+ goingForward = false;
+ selectedIndex--;
+ break;
+ case $.ui.keyCode.END:
+ selectedIndex = this.anchors.length - 1;
+ break;
+ case $.ui.keyCode.HOME:
+ selectedIndex = 0;
+ break;
+ case $.ui.keyCode.SPACE:
+ // Activate only, no collapsing
+ event.preventDefault();
+ clearTimeout( this.activating );
+ this._activate( selectedIndex );
+ return;
+ case $.ui.keyCode.ENTER:
+ // Toggle (cancel delayed activation, allow collapsing)
+ event.preventDefault();
+ clearTimeout( this.activating );
+ // Determine if we should collapse or activate
+ this._activate( selectedIndex === this.options.active ? false : selectedIndex );
+ return;
+ default:
+ return;
+ }
+
+ // Focus the appropriate tab, based on which key was pressed
+ event.preventDefault();
+ clearTimeout( this.activating );
+ selectedIndex = this._focusNextTab( selectedIndex, goingForward );
+
+ // Navigating with control/command key will prevent automatic activation
+ if ( !event.ctrlKey && !event.metaKey ) {
+
+ // Update aria-selected immediately so that AT think the tab is already selected.
+ // Otherwise AT may confuse the user by stating that they need to activate the tab,
+ // but the tab will already be activated by the time the announcement finishes.
+ focusedTab.attr( "aria-selected", "false" );
+ this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
+
+ this.activating = this._delay(function() {
+ this.option( "active", selectedIndex );
+ }, this.delay );
+ }
+ },
+
+ _panelKeydown: function( event ) {
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ // Ctrl+up moves focus to the current tab
+ if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
+ event.preventDefault();
+ this.active.focus();
+ }
+ },
+
+ // Alt+page up/down moves focus to the previous/next tab (and activates)
+ _handlePageNav: function( event ) {
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
+ this._activate( this._focusNextTab( this.options.active - 1, false ) );
+ return true;
+ }
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
+ this._activate( this._focusNextTab( this.options.active + 1, true ) );
+ return true;
+ }
+ },
+
+ _findNextTab: function( index, goingForward ) {
+ var lastTabIndex = this.tabs.length - 1;
+
+ function constrain() {
+ if ( index > lastTabIndex ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = lastTabIndex;
+ }
+ return index;
+ }
+
+ while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
+ index = goingForward ? index + 1 : index - 1;
+ }
+
+ return index;
+ },
+
+ _focusNextTab: function( index, goingForward ) {
+ index = this._findNextTab( index, goingForward );
+ this.tabs.eq( index ).focus();
+ return index;
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "disabled" ) {
+ // don't use the widget factory's disabled handling
+ this._setupDisabled( value );
+ return;
+ }
+
+ this._super( key, value);
+
+ if ( key === "collapsible" ) {
+ this.element.toggleClass( "ui-tabs-collapsible", value );
+ // Setting collapsible: false while collapsed; open first panel
+ if ( !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+ }
+
+ if ( key === "event" ) {
+ this._setupEvents( value );
+ }
+
+ if ( key === "heightStyle" ) {
+ this._setupHeightStyle( value );
+ }
+ },
+
+ _sanitizeSelector: function( hash ) {
+ return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
+ },
+
+ refresh: function() {
+ var options = this.options,
+ lis = this.tablist.children( ":has(a[href])" );
+
+ // get disabled tabs from class attribute from HTML
+ // this will get converted to a boolean if needed in _refresh()
+ options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
+ return lis.index( tab );
+ });
+
+ this._processTabs();
+
+ // was collapsed or no tabs
+ if ( options.active === false || !this.anchors.length ) {
+ options.active = false;
+ this.active = $();
+ // was active, but active tab is gone
+ } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining tabs are disabled
+ if ( this.tabs.length === options.disabled.length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous tab
+ } else {
+ this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
+ }
+ // was active, active tab still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.tabs.index( this.active );
+ }
+
+ this._refresh();
+ },
+
+ _refresh: function() {
+ this._setupDisabled( this.options.disabled );
+ this._setupEvents( this.options.event );
+ this._setupHeightStyle( this.options.heightStyle );
+
+ this.tabs.not( this.active ).attr({
+ "aria-selected": "false",
+ "aria-expanded": "false",
+ tabIndex: -1
+ });
+ this.panels.not( this._getPanelForTab( this.active ) )
+ .hide()
+ .attr({
+ "aria-hidden": "true"
+ });
+
+ // Make sure one tab is in the tab order
+ if ( !this.active.length ) {
+ this.tabs.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active
+ .addClass( "ui-tabs-active ui-state-active" )
+ .attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ this._getPanelForTab( this.active )
+ .show()
+ .attr({
+ "aria-hidden": "false"
+ });
+ }
+ },
+
+ _processTabs: function() {
+ var that = this,
+ prevTabs = this.tabs,
+ prevAnchors = this.anchors,
+ prevPanels = this.panels;
+
+ this.tablist = this._getList()
+ .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .attr( "role", "tablist" )
+
+ // Prevent users from focusing disabled tabs via click
+ .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
+ if ( $( this ).is( ".ui-state-disabled" ) ) {
+ event.preventDefault();
+ }
+ })
+
+ // support: IE <9
+ // Preventing the default action in mousedown doesn't prevent IE
+ // from focusing the element, so if the anchor gets focused, blur.
+ // We don't have to worry about focusing the previously focused
+ // element since clicking on a non-focusable element should focus
+ // the body anyway.
+ .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
+ if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
+ this.blur();
+ }
+ });
+
+ this.tabs = this.tablist.find( "> li:has(a[href])" )
+ .addClass( "ui-state-default ui-corner-top" )
+ .attr({
+ role: "tab",
+ tabIndex: -1
+ });
+
+ this.anchors = this.tabs.map(function() {
+ return $( "a", this )[ 0 ];
+ })
+ .addClass( "ui-tabs-anchor" )
+ .attr({
+ role: "presentation",
+ tabIndex: -1
+ });
+
+ this.panels = $();
+
+ this.anchors.each(function( i, anchor ) {
+ var selector, panel, panelId,
+ anchorId = $( anchor ).uniqueId().attr( "id" ),
+ tab = $( anchor ).closest( "li" ),
+ originalAriaControls = tab.attr( "aria-controls" );
+
+ // inline tab
+ if ( that._isLocal( anchor ) ) {
+ selector = anchor.hash;
+ panelId = selector.substring( 1 );
+ panel = that.element.find( that._sanitizeSelector( selector ) );
+ // remote tab
+ } else {
+ // If the tab doesn't already have aria-controls,
+ // generate an id by using a throw-away element
+ panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
+ selector = "#" + panelId;
+ panel = that.element.find( selector );
+ if ( !panel.length ) {
+ panel = that._createPanel( panelId );
+ panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
+ }
+ panel.attr( "aria-live", "polite" );
+ }
+
+ if ( panel.length) {
+ that.panels = that.panels.add( panel );
+ }
+ if ( originalAriaControls ) {
+ tab.data( "ui-tabs-aria-controls", originalAriaControls );
+ }
+ tab.attr({
+ "aria-controls": panelId,
+ "aria-labelledby": anchorId
+ });
+ panel.attr( "aria-labelledby", anchorId );
+ });
+
+ this.panels
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .attr( "role", "tabpanel" );
+
+ // Avoid memory leaks (#10056)
+ if ( prevTabs ) {
+ this._off( prevTabs.not( this.tabs ) );
+ this._off( prevAnchors.not( this.anchors ) );
+ this._off( prevPanels.not( this.panels ) );
+ }
+ },
+
+ // allow overriding how to find the list for rare usage scenarios (#7715)
+ _getList: function() {
+ return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
+ },
+
+ _createPanel: function( id ) {
+ return $( "<div>" )
+ .attr( "id", id )
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .data( "ui-tabs-destroy", true );
+ },
+
+ _setupDisabled: function( disabled ) {
+ if ( $.isArray( disabled ) ) {
+ if ( !disabled.length ) {
+ disabled = false;
+ } else if ( disabled.length === this.anchors.length ) {
+ disabled = true;
+ }
+ }
+
+ // disable tabs
+ for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
+ if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
+ $( li )
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ } else {
+ $( li )
+ .removeClass( "ui-state-disabled" )
+ .removeAttr( "aria-disabled" );
+ }
+ }
+
+ this.options.disabled = disabled;
+ },
+
+ _setupEvents: function( event ) {
+ var events = {};
+ if ( event ) {
+ $.each( event.split(" "), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+ // Always prevent the default action, even when disabled
+ this._on( true, this.anchors, {
+ click: function( event ) {
+ event.preventDefault();
+ }
+ });
+ this._on( this.anchors, events );
+ this._on( this.tabs, { keydown: "_tabKeydown" } );
+ this._on( this.panels, { keydown: "_panelKeydown" } );
+
+ this._focusable( this.tabs );
+ this._hoverable( this.tabs );
+ },
+
+ _setupHeightStyle: function( heightStyle ) {
+ var maxHeight,
+ parent = this.element.parent();
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ maxHeight -= this.element.outerHeight() - this.element.height();
+
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.element.children().not( this.panels ).each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.panels.each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.panels.each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
+ }).height( maxHeight );
+ }
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ anchor = $( event.currentTarget ),
+ tab = anchor.closest( "li" ),
+ clickedIsActive = tab[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : this._getPanelForTab( tab ),
+ toHide = !active.length ? $() : this._getPanelForTab( active ),
+ eventData = {
+ oldTab: active,
+ oldPanel: toHide,
+ newTab: collapsing ? $() : tab,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if ( tab.hasClass( "ui-state-disabled" ) ||
+ // tab is already loading
+ tab.hasClass( "ui-tabs-loading" ) ||
+ // can't switch durning an animation
+ this.running ||
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.tabs.index( tab );
+
+ this.active = clickedIsActive ? $() : tab;
+ if ( this.xhr ) {
+ this.xhr.abort();
+ }
+
+ if ( !toHide.length && !toShow.length ) {
+ $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
+ }
+
+ if ( toShow.length ) {
+ this.load( this.tabs.index( tab ), event );
+ }
+ this._toggle( event, eventData );
+ },
+
+ // handles show/hide for selecting tabs
+ _toggle: function( event, eventData ) {
+ var that = this,
+ toShow = eventData.newPanel,
+ toHide = eventData.oldPanel;
+
+ this.running = true;
+
+ function complete() {
+ that.running = false;
+ that._trigger( "activate", event, eventData );
+ }
+
+ function show() {
+ eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
+
+ if ( toShow.length && that.options.show ) {
+ that._show( toShow, that.options.show, complete );
+ } else {
+ toShow.show();
+ complete();
+ }
+ }
+
+ // start out by hiding, then showing, then completing
+ if ( toHide.length && this.options.hide ) {
+ this._hide( toHide, this.options.hide, function() {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ show();
+ });
+ } else {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ toHide.hide();
+ show();
+ }
+
+ toHide.attr( "aria-hidden", "true" );
+ eventData.oldTab.attr({
+ "aria-selected": "false",
+ "aria-expanded": "false"
+ });
+ // If we're switching tabs, remove the old tab from the tab order.
+ // If we're opening from collapsed state, remove the previous tab from the tab order.
+ // If we're collapsing, then keep the collapsing tab in the tab order.
+ if ( toShow.length && toHide.length ) {
+ eventData.oldTab.attr( "tabIndex", -1 );
+ } else if ( toShow.length ) {
+ this.tabs.filter(function() {
+ return $( this ).attr( "tabIndex" ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow.attr( "aria-hidden", "false" );
+ eventData.newTab.attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ },
+
+ _activate: function( index ) {
+ var anchor,
+ active = this._findActive( index );
+
+ // trying to activate the already active panel
+ if ( active[ 0 ] === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the current active header
+ if ( !active.length ) {
+ active = this.active;
+ }
+
+ anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
+ this._eventHandler({
+ target: anchor,
+ currentTarget: anchor,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( index ) {
+ return index === false ? $() : this.tabs.eq( index );
+ },
+
+ _getIndex: function( index ) {
+ // meta-function to give users option to provide a href string instead of a numerical index.
+ if ( typeof index === "string" ) {
+ index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
+ }
+
+ return index;
+ },
+
+ _destroy: function() {
+ if ( this.xhr ) {
+ this.xhr.abort();
+ }
+
+ this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
+
+ this.tablist
+ .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .removeAttr( "role" );
+
+ this.anchors
+ .removeClass( "ui-tabs-anchor" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
+ .removeUniqueId();
+
+ this.tablist.unbind( this.eventNamespace );
+
+ this.tabs.add( this.panels ).each(function() {
+ if ( $.data( this, "ui-tabs-destroy" ) ) {
+ $( this ).remove();
+ } else {
+ $( this )
+ .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
+ "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-live" )
+ .removeAttr( "aria-busy" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "role" );
+ }
+ });
+
+ this.tabs.each(function() {
+ var li = $( this ),
+ prev = li.data( "ui-tabs-aria-controls" );
+ if ( prev ) {
+ li
+ .attr( "aria-controls", prev )
+ .removeData( "ui-tabs-aria-controls" );
+ } else {
+ li.removeAttr( "aria-controls" );
+ }
+ });
+
+ this.panels.show();
+
+ if ( this.options.heightStyle !== "content" ) {
+ this.panels.css( "height", "" );
+ }
+ },
+
+ enable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === false ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = false;
+ } else {
+ index = this._getIndex( index );
+ if ( $.isArray( disabled ) ) {
+ disabled = $.map( disabled, function( num ) {
+ return num !== index ? num : null;
+ });
+ } else {
+ disabled = $.map( this.tabs, function( li, num ) {
+ return num !== index ? num : null;
+ });
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ disable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === true ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = true;
+ } else {
+ index = this._getIndex( index );
+ if ( $.inArray( index, disabled ) !== -1 ) {
+ return;
+ }
+ if ( $.isArray( disabled ) ) {
+ disabled = $.merge( [ index ], disabled ).sort();
+ } else {
+ disabled = [ index ];
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ load: function( index, event ) {
+ index = this._getIndex( index );
+ var that = this,
+ tab = this.tabs.eq( index ),
+ anchor = tab.find( ".ui-tabs-anchor" ),
+ panel = this._getPanelForTab( tab ),
+ eventData = {
+ tab: tab,
+ panel: panel
+ },
+ complete = function( jqXHR, status ) {
+ if ( status === "abort" ) {
+ that.panels.stop( false, true );
+ }
+
+ tab.removeClass( "ui-tabs-loading" );
+ panel.removeAttr( "aria-busy" );
+
+ if ( jqXHR === that.xhr ) {
+ delete that.xhr;
+ }
+ };
+
+ // not remote
+ if ( this._isLocal( anchor[ 0 ] ) ) {
+ return;
+ }
+
+ this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
+
+ // support: jQuery <1.8
+ // jQuery <1.8 returns false if the request is canceled in beforeSend,
+ // but as of 1.8, $.ajax() always returns a jqXHR object.
+ if ( this.xhr && this.xhr.statusText !== "canceled" ) {
+ tab.addClass( "ui-tabs-loading" );
+ panel.attr( "aria-busy", "true" );
+
+ this.xhr
+ .done(function( response, status, jqXHR ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ panel.html( response );
+ that._trigger( "load", event, eventData );
+
+ complete( jqXHR, status );
+ }, 1 );
+ })
+ .fail(function( jqXHR, status ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ complete( jqXHR, status );
+ }, 1 );
+ });
+ }
+ },
+
+ _ajaxSettings: function( anchor, event, eventData ) {
+ var that = this;
+ return {
+ url: anchor.attr( "href" ),
+ beforeSend: function( jqXHR, settings ) {
+ return that._trigger( "beforeLoad", event,
+ $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
+ }
+ };
+ },
+
+ _getPanelForTab: function( tab ) {
+ var id = $( tab ).attr( "aria-controls" );
+ return this.element.find( this._sanitizeSelector( "#" + id ) );
+ }
+});
+
+
+/*!
+ * jQuery UI Tooltip 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tooltip/
+ */
+
+
+var tooltip = $.widget( "ui.tooltip", {
+ version: "1.11.4",
+ options: {
+ content: function() {
+ // support: IE<9, Opera in jQuery <1.7
+ // .text() can't accept undefined, so coerce to a string
+ var title = $( this ).attr( "title" ) || "";
+ // Escape title, since we're going from an attribute to raw HTML
+ return $( "<a>" ).text( title ).html();
+ },
+ hide: true,
+ // Disabled elements have inconsistent behavior across browsers (#8661)
+ items: "[title]:not([disabled])",
+ position: {
+ my: "left top+15",
+ at: "left bottom",
+ collision: "flipfit flip"
+ },
+ show: true,
+ tooltipClass: null,
+ track: false,
+
+ // callbacks
+ close: null,
+ open: null
+ },
+
+ _addDescribedBy: function( elem, id ) {
+ var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
+ describedby.push( id );
+ elem
+ .data( "ui-tooltip-id", id )
+ .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
+ },
+
+ _removeDescribedBy: function( elem ) {
+ var id = elem.data( "ui-tooltip-id" ),
+ describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
+ index = $.inArray( id, describedby );
+
+ if ( index !== -1 ) {
+ describedby.splice( index, 1 );
+ }
+
+ elem.removeData( "ui-tooltip-id" );
+ describedby = $.trim( describedby.join( " " ) );
+ if ( describedby ) {
+ elem.attr( "aria-describedby", describedby );
+ } else {
+ elem.removeAttr( "aria-describedby" );
+ }
+ },
+
+ _create: function() {
+ this._on({
+ mouseover: "open",
+ focusin: "open"
+ });
+
+ // IDs of generated tooltips, needed for destroy
+ this.tooltips = {};
+
+ // IDs of parent tooltips where we removed the title attribute
+ this.parents = {};
+
+ if ( this.options.disabled ) {
+ this._disable();
+ }
+
+ // Append the aria-live region so tooltips announce correctly
+ this.liveRegion = $( "<div>" )
+ .attr({
+ role: "log",
+ "aria-live": "assertive",
+ "aria-relevant": "additions"
+ })
+ .addClass( "ui-helper-hidden-accessible" )
+ .appendTo( this.document[ 0 ].body );
+ },
+
+ _setOption: function( key, value ) {
+ var that = this;
+
+ if ( key === "disabled" ) {
+ this[ value ? "_disable" : "_enable" ]();
+ this.options[ key ] = value;
+ // disable element style changes
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "content" ) {
+ $.each( this.tooltips, function( id, tooltipData ) {
+ that._updateContent( tooltipData.element );
+ });
+ }
+ },
+
+ _disable: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, tooltipData ) {
+ var event = $.Event( "blur" );
+ event.target = event.currentTarget = tooltipData.element[ 0 ];
+ that.close( event, true );
+ });
+
+ // remove title attributes to prevent native tooltips
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.is( "[title]" ) ) {
+ element
+ .data( "ui-tooltip-title", element.attr( "title" ) )
+ .removeAttr( "title" );
+ }
+ });
+ },
+
+ _enable: function() {
+ // restore title attributes
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.data( "ui-tooltip-title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ }
+ });
+ },
+
+ open: function( event ) {
+ var that = this,
+ target = $( event ? event.target : this.element )
+ // we need closest here due to mouseover bubbling,
+ // but always pointing at the same event target
+ .closest( this.options.items );
+
+ // No element to show a tooltip for or the tooltip is already open
+ if ( !target.length || target.data( "ui-tooltip-id" ) ) {
+ return;
+ }
+
+ if ( target.attr( "title" ) ) {
+ target.data( "ui-tooltip-title", target.attr( "title" ) );
+ }
+
+ target.data( "ui-tooltip-open", true );
+
+ // kill parent tooltips, custom or native, for hover
+ if ( event && event.type === "mouseover" ) {
+ target.parents().each(function() {
+ var parent = $( this ),
+ blurEvent;
+ if ( parent.data( "ui-tooltip-open" ) ) {
+ blurEvent = $.Event( "blur" );
+ blurEvent.target = blurEvent.currentTarget = this;
+ that.close( blurEvent, true );
+ }
+ if ( parent.attr( "title" ) ) {
+ parent.uniqueId();
+ that.parents[ this.id ] = {
+ element: this,
+ title: parent.attr( "title" )
+ };
+ parent.attr( "title", "" );
+ }
+ });
+ }
+
+ this._registerCloseHandlers( event, target );
+ this._updateContent( target, event );
+ },
+
+ _updateContent: function( target, event ) {
+ var content,
+ contentOption = this.options.content,
+ that = this,
+ eventType = event ? event.type : null;
+
+ if ( typeof contentOption === "string" ) {
+ return this._open( event, target, contentOption );
+ }
+
+ content = contentOption.call( target[0], function( response ) {
+
+ // IE may instantly serve a cached response for ajax requests
+ // delay this call to _open so the other call to _open runs first
+ that._delay(function() {
+
+ // Ignore async response if tooltip was closed already
+ if ( !target.data( "ui-tooltip-open" ) ) {
+ return;
+ }
+
+ // jQuery creates a special event for focusin when it doesn't
+ // exist natively. To improve performance, the native event
+ // object is reused and the type is changed. Therefore, we can't
+ // rely on the type being correct after the event finished
+ // bubbling, so we set it back to the previous value. (#8740)
+ if ( event ) {
+ event.type = eventType;
+ }
+ this._open( event, target, response );
+ });
+ });
+ if ( content ) {
+ this._open( event, target, content );
+ }
+ },
+
+ _open: function( event, target, content ) {
+ var tooltipData, tooltip, delayedShow, a11yContent,
+ positionOption = $.extend( {}, this.options.position );
+
+ if ( !content ) {
+ return;
+ }
+
+ // Content can be updated multiple times. If the tooltip already
+ // exists, then just update the content and bail.
+ tooltipData = this._find( target );
+ if ( tooltipData ) {
+ tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
+ return;
+ }
+
+ // if we have a title, clear it to prevent the native tooltip
+ // we have to check first to avoid defining a title if none exists
+ // (we don't want to cause an element to start matching [title])
+ //
+ // We use removeAttr only for key events, to allow IE to export the correct
+ // accessible attributes. For mouse events, set to empty string to avoid
+ // native tooltip showing up (happens only when removing inside mouseover).
+ if ( target.is( "[title]" ) ) {
+ if ( event && event.type === "mouseover" ) {
+ target.attr( "title", "" );
+ } else {
+ target.removeAttr( "title" );
+ }
+ }
+
+ tooltipData = this._tooltip( target );
+ tooltip = tooltipData.tooltip;
+ this._addDescribedBy( target, tooltip.attr( "id" ) );
+ tooltip.find( ".ui-tooltip-content" ).html( content );
+
+ // Support: Voiceover on OS X, JAWS on IE <= 9
+ // JAWS announces deletions even when aria-relevant="additions"
+ // Voiceover will sometimes re-read the entire log region's contents from the beginning
+ this.liveRegion.children().hide();
+ if ( content.clone ) {
+ a11yContent = content.clone();
+ a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
+ } else {
+ a11yContent = content;
+ }
+ $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
+
+ function position( event ) {
+ positionOption.of = event;
+ if ( tooltip.is( ":hidden" ) ) {
+ return;
+ }
+ tooltip.position( positionOption );
+ }
+ if ( this.options.track && event && /^mouse/.test( event.type ) ) {
+ this._on( this.document, {
+ mousemove: position
+ });
+ // trigger once to override element-relative positioning
+ position( event );
+ } else {
+ tooltip.position( $.extend({
+ of: target
+ }, this.options.position ) );
+ }
+
+ tooltip.hide();
+
+ this._show( tooltip, this.options.show );
+ // Handle tracking tooltips that are shown with a delay (#8644). As soon
+ // as the tooltip is visible, position the tooltip using the most recent
+ // event.
+ if ( this.options.show && this.options.show.delay ) {
+ delayedShow = this.delayedShow = setInterval(function() {
+ if ( tooltip.is( ":visible" ) ) {
+ position( positionOption.of );
+ clearInterval( delayedShow );
+ }
+ }, $.fx.interval );
+ }
+
+ this._trigger( "open", event, { tooltip: tooltip } );
+ },
+
+ _registerCloseHandlers: function( event, target ) {
+ var events = {
+ keyup: function( event ) {
+ if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
+ var fakeEvent = $.Event(event);
+ fakeEvent.currentTarget = target[0];
+ this.close( fakeEvent, true );
+ }
+ }
+ };
+
+ // Only bind remove handler for delegated targets. Non-delegated
+ // tooltips will handle this in destroy.
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
+ events.remove = function() {
+ this._removeTooltip( this._find( target ).tooltip );
+ };
+ }
+
+ if ( !event || event.type === "mouseover" ) {
+ events.mouseleave = "close";
+ }
+ if ( !event || event.type === "focusin" ) {
+ events.focusout = "close";
+ }
+ this._on( true, target, events );
+ },
+
+ close: function( event ) {
+ var tooltip,
+ that = this,
+ target = $( event ? event.currentTarget : this.element ),
+ tooltipData = this._find( target );
+
+ // The tooltip may already be closed
+ if ( !tooltipData ) {
+
+ // We set ui-tooltip-open immediately upon open (in open()), but only set the
+ // additional data once there's actually content to show (in _open()). So even if the
+ // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
+ // the period between open() and _open().
+ target.removeData( "ui-tooltip-open" );
+ return;
+ }
+
+ tooltip = tooltipData.tooltip;
+
+ // disabling closes the tooltip, so we need to track when we're closing
+ // to avoid an infinite loop in case the tooltip becomes disabled on close
+ if ( tooltipData.closing ) {
+ return;
+ }
+
+ // Clear the interval for delayed tracking tooltips
+ clearInterval( this.delayedShow );
+
+ // only set title if we had one before (see comment in _open())
+ // If the title attribute has changed since open(), don't restore
+ if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
+ target.attr( "title", target.data( "ui-tooltip-title" ) );
+ }
+
+ this._removeDescribedBy( target );
+
+ tooltipData.hiding = true;
+ tooltip.stop( true );
+ this._hide( tooltip, this.options.hide, function() {
+ that._removeTooltip( $( this ) );
+ });
+
+ target.removeData( "ui-tooltip-open" );
+ this._off( target, "mouseleave focusout keyup" );
+
+ // Remove 'remove' binding only on delegated targets
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
+ this._off( target, "remove" );
+ }
+ this._off( this.document, "mousemove" );
+
+ if ( event && event.type === "mouseleave" ) {
+ $.each( this.parents, function( id, parent ) {
+ $( parent.element ).attr( "title", parent.title );
+ delete that.parents[ id ];
+ });
+ }
+
+ tooltipData.closing = true;
+ this._trigger( "close", event, { tooltip: tooltip } );
+ if ( !tooltipData.hiding ) {
+ tooltipData.closing = false;
+ }
+ },
+
+ _tooltip: function( element ) {
+ var tooltip = $( "<div>" )
+ .attr( "role", "tooltip" )
+ .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
+ ( this.options.tooltipClass || "" ) ),
+ id = tooltip.uniqueId().attr( "id" );
+
+ $( "<div>" )
+ .addClass( "ui-tooltip-content" )
+ .appendTo( tooltip );
+
+ tooltip.appendTo( this.document[0].body );
+
+ return this.tooltips[ id ] = {
+ element: element,
+ tooltip: tooltip
+ };
+ },
+
+ _find: function( target ) {
+ var id = target.data( "ui-tooltip-id" );
+ return id ? this.tooltips[ id ] : null;
+ },
+
+ _removeTooltip: function( tooltip ) {
+ tooltip.remove();
+ delete this.tooltips[ tooltip.attr( "id" ) ];
+ },
+
+ _destroy: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, tooltipData ) {
+ // Delegate to close method to handle common cleanup
+ var event = $.Event( "blur" ),
+ element = tooltipData.element;
+ event.target = event.currentTarget = element[ 0 ];
+ that.close( event, true );
+
+ // Remove immediately; destroying an open tooltip doesn't use the
+ // hide animation
+ $( "#" + id ).remove();
+
+ // Restore the title
+ if ( element.data( "ui-tooltip-title" ) ) {
+ // If the title attribute has changed since open(), don't restore
+ if ( !element.attr( "title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ }
+ element.removeData( "ui-tooltip-title" );
+ }
+ });
+ this.liveRegion.remove();
+ }
+});
+
+
+
+})); \ No newline at end of file
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css
new file mode 100644
index 0000000..6980551
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, spinner.css, tabs.css, tooltip.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=cb842e&bgTextureHeader=glass&bgImgOpacityHeader=25&borderColorHeader=d49768&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=f4f0ec&bgTextureContent=inset_soft&bgImgOpacityContent=100&borderColorContent=e0cfc2&fcContent=1e1b1d&iconColorContent=c47a23&bgColorDefault=ede4d4&bgTextureDefault=glass&bgImgOpacityDefault=70&borderColorDefault=cdc3b7&fcDefault=3f3731&iconColorDefault=f08000&bgColorHover=f5f0e5&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=f5ad66&fcHover=a46313&iconColorHover=f08000&bgColorActive=f4f0ec&bgTextureActive=highlight_hard&bgImgOpacityActive=100&borderColorActive=e0cfc2&fcActive=b85700&iconColorActive=f35f07&bgColorHighlight=f5f5b5&bgTextureHighlight=highlight_hard&bgImgOpacityHighlight=75&borderColorHighlight=d9bb73&fcHighlight=060200&iconColorHighlight=cb672b&bgColorError=fee4bd&bgTextureError=highlight_hard&bgImgOpacityError=65&borderColorError=f8893f&fcError=592003&iconColorError=ff7519&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=75&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Helvetica,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Helvetica,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_inset-soft_100_f4f0ec_1x100.png") 50% bottom repeat-x;color:#1e1b1d}.ui-widget-content a{color:#1e1b1d}.ui-widget-header{border:1px solid #d49768;background:#cb842e url("images/ui-bg_glass_25_cb842e_1x400.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #cdc3b7;background:#ede4d4 url("images/ui-bg_glass_70_ede4d4_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#3f3731}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#3f3731;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #f5ad66;background:#f5f0e5 url("images/ui-bg_glass_100_f5f0e5_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#a46313}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#a46313;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_highlight-hard_100_f4f0ec_1x100.png") 50% 50% repeat-x;font-weight:normal;color:#b85700}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#b85700;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #d9bb73;background:#f5f5b5 url("images/ui-bg_highlight-hard_75_f5f5b5_1x100.png") 50% top repeat-x;color:#060200}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#060200}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f8893f;background:#fee4bd url("images/ui-bg_highlight-hard_65_fee4bd_1x100.png") 50% top repeat-x;color:#592003}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#592003}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#592003}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_c47a23_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_f35f07_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_cb672b_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ff7519_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:6px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:6px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.js b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.js
new file mode 100644
index 0000000..c3a16cb
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.js
@@ -0,0 +1,12 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, spinner.js, tabs.js, tooltip.js
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?N.left-=d:"center"===n.my[0]&&(N.left-=d/2),"bottom"===n.my[1]?N.top-=c:"center"===n.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],a||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}
+},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;
+this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))
+},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:function(event){this.collapseAll(event,true)},"mouseleave .ui-menu":function(event){this.collapseAll(event,true)},focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this
+},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,N,M,C,A,P,I,H,z,F,E,W,O,L,j=new Date,R=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth(),j.getDate())),Y=this._get(e,"isRTL"),J=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),U=this._get(e,"showCurrentAtPos"),q=this._get(e,"stepMonths"),G=1!==V[0]||1!==V[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-U,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-V[0]*V[1]+1,$.getDate())),t=Q&&Q>t?Q:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+q,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:R,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=J?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;V[0]>w;w++){for(k="",this.maxRows=4,T=0;V[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",N="",G){if(N+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:N+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case V[1]-1:N+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:N+=" ui-datepicker-group-middle",S=""}N+="'>"}for(N+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,Q,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,M+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(N+=M+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=G?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._get(arguments[0],"calendarStart") ? this._get(arguments[0],"calendarStart").call(this) : this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(N+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!y||!W[0]||Q&&Q>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);N+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),N+="</tbody></table>"+(G?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=N}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;
+return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}
+},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.css
new file mode 100644
index 0000000..7baf1a0
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.css
@@ -0,0 +1,701 @@
+/*!
+ * jQuery UI CSS Framework 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/theming/
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+ display: none;
+}
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.ui-helper-reset {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ line-height: 1.3;
+ text-decoration: none;
+ font-size: 100%;
+ list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+.ui-helper-clearfix {
+ min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ position: absolute;
+ opacity: 0;
+ filter:Alpha(Opacity=0); /* support: IE8 */
+}
+
+.ui-front {
+ z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+ cursor: default !important;
+}
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ display: block;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-draggable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable {
+ position: relative;
+}
+.ui-resizable-handle {
+ position: absolute;
+ font-size: 0.1px;
+ display: block;
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable-disabled .ui-resizable-handle,
+.ui-resizable-autohide .ui-resizable-handle {
+ display: none;
+}
+.ui-resizable-n {
+ cursor: n-resize;
+ height: 7px;
+ width: 100%;
+ top: -5px;
+ left: 0;
+}
+.ui-resizable-s {
+ cursor: s-resize;
+ height: 7px;
+ width: 100%;
+ bottom: -5px;
+ left: 0;
+}
+.ui-resizable-e {
+ cursor: e-resize;
+ width: 7px;
+ right: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-w {
+ cursor: w-resize;
+ width: 7px;
+ left: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-se {
+ cursor: se-resize;
+ width: 12px;
+ height: 12px;
+ right: 1px;
+ bottom: 1px;
+}
+.ui-resizable-sw {
+ cursor: sw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ bottom: -5px;
+}
+.ui-resizable-nw {
+ cursor: nw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ top: -5px;
+}
+.ui-resizable-ne {
+ cursor: ne-resize;
+ width: 9px;
+ height: 9px;
+ right: -5px;
+ top: -5px;
+}
+.ui-selectable {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-selectable-helper {
+ position: absolute;
+ z-index: 100;
+ border: 1px dotted black;
+}
+.ui-sortable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-accordion .ui-accordion-header {
+ display: block;
+ cursor: pointer;
+ position: relative;
+ margin: 2px 0 0 0;
+ padding: .5em .5em .5em .7em;
+ min-height: 0; /* support: IE7 */
+ font-size: 100%;
+}
+.ui-accordion .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-icons .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
+ position: absolute;
+ left: .5em;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-accordion .ui-accordion-content {
+ padding: 1em 2.2em;
+ border-top: 0;
+ overflow: auto;
+}
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
+.ui-button {
+ display: inline-block;
+ position: relative;
+ padding: 0;
+ line-height: normal;
+ margin-right: .1em;
+ cursor: pointer;
+ vertical-align: middle;
+ text-align: center;
+ overflow: visible; /* removes extra width in IE */
+}
+.ui-button,
+.ui-button:link,
+.ui-button:visited,
+.ui-button:hover,
+.ui-button:active {
+ text-decoration: none;
+}
+/* to make room for the icon, a width needs to be set here */
+.ui-button-icon-only {
+ width: 2.2em;
+}
+/* button elements seem to need a little more width */
+button.ui-button-icon-only {
+ width: 2.4em;
+}
+.ui-button-icons-only {
+ width: 3.4em;
+}
+button.ui-button-icons-only {
+ width: 3.7em;
+}
+
+/* button text element */
+.ui-button .ui-button-text {
+ display: block;
+ line-height: normal;
+}
+.ui-button-text-only .ui-button-text {
+ padding: .4em 1em;
+}
+.ui-button-icon-only .ui-button-text,
+.ui-button-icons-only .ui-button-text {
+ padding: .4em;
+ text-indent: -9999999px;
+}
+.ui-button-text-icon-primary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 1em .4em 2.1em;
+}
+.ui-button-text-icon-secondary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 2.1em .4em 1em;
+}
+.ui-button-text-icons .ui-button-text {
+ padding-left: 2.1em;
+ padding-right: 2.1em;
+}
+/* no icon support for input elements, provide padding by default */
+input.ui-button {
+ padding: .4em 1em;
+}
+
+/* button icon element(s) */
+.ui-button-icon-only .ui-icon,
+.ui-button-text-icon-primary .ui-icon,
+.ui-button-text-icon-secondary .ui-icon,
+.ui-button-text-icons .ui-icon,
+.ui-button-icons-only .ui-icon {
+ position: absolute;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-button-icon-only .ui-icon {
+ left: 50%;
+ margin-left: -8px;
+}
+.ui-button-text-icon-primary .ui-button-icon-primary,
+.ui-button-text-icons .ui-button-icon-primary,
+.ui-button-icons-only .ui-button-icon-primary {
+ left: .5em;
+}
+.ui-button-text-icon-secondary .ui-button-icon-secondary,
+.ui-button-text-icons .ui-button-icon-secondary,
+.ui-button-icons-only .ui-button-icon-secondary {
+ right: .5em;
+}
+
+/* button sets */
+.ui-buttonset {
+ margin-right: 7px;
+}
+.ui-buttonset .ui-button {
+ margin-left: 0;
+ margin-right: -.3em;
+}
+
+/* workarounds */
+/* reset extra padding in Firefox, see h5bp.com/l */
+input.ui-button::-moz-focus-inner,
+button.ui-button::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+.ui-datepicker {
+ width: 17em;
+ padding: .2em .2em 0;
+ display: none;
+}
+.ui-datepicker .ui-datepicker-header {
+ position: relative;
+ padding: .2em 0;
+}
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+ position: absolute;
+ top: 2px;
+ width: 1.8em;
+ height: 1.8em;
+}
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+ top: 1px;
+}
+.ui-datepicker .ui-datepicker-prev {
+ left: 2px;
+}
+.ui-datepicker .ui-datepicker-next {
+ right: 2px;
+}
+.ui-datepicker .ui-datepicker-prev-hover {
+ left: 1px;
+}
+.ui-datepicker .ui-datepicker-next-hover {
+ right: 1px;
+}
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+ display: block;
+ position: absolute;
+ left: 50%;
+ margin-left: -8px;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-datepicker .ui-datepicker-title {
+ margin: 0 2.3em;
+ line-height: 1.8em;
+ text-align: center;
+}
+.ui-datepicker .ui-datepicker-title select {
+ font-size: 1em;
+ margin: 1px 0;
+}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+ width: 45%;
+}
+.ui-datepicker table {
+ width: 100%;
+ font-size: .9em;
+ border-collapse: collapse;
+ margin: 0 0 .4em;
+}
+.ui-datepicker th {
+ padding: .7em .3em;
+ text-align: center;
+ font-weight: bold;
+ border: 0;
+}
+.ui-datepicker td {
+ border: 0;
+ padding: 1px;
+}
+.ui-datepicker td span,
+.ui-datepicker td a {
+ display: block;
+ padding: .2em;
+ text-align: right;
+ text-decoration: none;
+}
+.ui-datepicker .ui-datepicker-buttonpane {
+ background-image: none;
+ margin: .7em 0 0 0;
+ padding: 0 .2em;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 0;
+}
+.ui-datepicker .ui-datepicker-buttonpane button {
+ float: right;
+ margin: .5em .2em .4em;
+ cursor: pointer;
+ padding: .2em .6em .3em .6em;
+ width: auto;
+ overflow: visible;
+}
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+ float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+ width: auto;
+}
+.ui-datepicker-multi .ui-datepicker-group {
+ float: left;
+}
+.ui-datepicker-multi .ui-datepicker-group table {
+ width: 95%;
+ margin: 0 auto .4em;
+}
+.ui-datepicker-multi-2 .ui-datepicker-group {
+ width: 50%;
+}
+.ui-datepicker-multi-3 .ui-datepicker-group {
+ width: 33.3%;
+}
+.ui-datepicker-multi-4 .ui-datepicker-group {
+ width: 25%;
+}
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+ border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+ clear: left;
+}
+.ui-datepicker-row-break {
+ clear: both;
+ width: 100%;
+ font-size: 0;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+ direction: rtl;
+}
+.ui-datepicker-rtl .ui-datepicker-prev {
+ right: 2px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next {
+ left: 2px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+ right: 1px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+ left: 1px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+ clear: right;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+ float: left;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
+.ui-datepicker-rtl .ui-datepicker-group {
+ float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+ border-right-width: 0;
+ border-left-width: 1px;
+}
+.ui-dialog {
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: .2em;
+ outline: 0;
+}
+.ui-dialog .ui-dialog-titlebar {
+ padding: .4em 1em;
+ position: relative;
+}
+.ui-dialog .ui-dialog-title {
+ float: left;
+ margin: .1em 0;
+ white-space: nowrap;
+ width: 90%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.ui-dialog .ui-dialog-titlebar-close {
+ position: absolute;
+ right: .3em;
+ top: 50%;
+ width: 20px;
+ margin: -10px 0 0 0;
+ padding: 1px;
+ height: 20px;
+}
+.ui-dialog .ui-dialog-content {
+ position: relative;
+ border: 0;
+ padding: .5em 1em;
+ background: none;
+ overflow: auto;
+}
+.ui-dialog .ui-dialog-buttonpane {
+ text-align: left;
+ border-width: 1px 0 0 0;
+ background-image: none;
+ margin-top: .5em;
+ padding: .3em 1em .5em .4em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+ float: right;
+}
+.ui-dialog .ui-dialog-buttonpane button {
+ margin: .5em .4em .5em 0;
+ cursor: pointer;
+}
+.ui-dialog .ui-resizable-se {
+ width: 12px;
+ height: 12px;
+ right: -5px;
+ bottom: -5px;
+ background-position: 16px 16px;
+}
+.ui-draggable .ui-dialog-titlebar {
+ cursor: move;
+}
+.ui-menu {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: block;
+ outline: none;
+}
+.ui-menu .ui-menu {
+ position: absolute;
+}
+.ui-menu .ui-menu-item {
+ position: relative;
+ margin: 0;
+ padding: 3px 1em 3px .4em;
+ cursor: pointer;
+ min-height: 0; /* support: IE7 */
+ /* support: IE10, see #8844 */
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+.ui-menu .ui-menu-divider {
+ margin: 5px 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ border-width: 1px 0 0 0;
+}
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
+ margin: -1px;
+}
+
+/* icon support */
+.ui-menu-icons {
+ position: relative;
+}
+.ui-menu-icons .ui-menu-item {
+ padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: .2em;
+ margin: auto 0;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+ left: auto;
+ right: 0;
+}
+.ui-spinner {
+ position: relative;
+ display: inline-block;
+ overflow: hidden;
+ padding: 0;
+ vertical-align: middle;
+}
+.ui-spinner-input {
+ border: none;
+ background: none;
+ color: inherit;
+ padding: 0;
+ margin: .2em 0;
+ vertical-align: middle;
+ margin-left: .4em;
+ margin-right: 22px;
+}
+.ui-spinner-button {
+ width: 16px;
+ height: 50%;
+ font-size: .5em;
+ padding: 0;
+ margin: 0;
+ text-align: center;
+ position: absolute;
+ cursor: default;
+ display: block;
+ overflow: hidden;
+ right: 0;
+}
+/* more specificity required here to override default borders */
+.ui-spinner a.ui-spinner-button {
+ border-top: none;
+ border-bottom: none;
+ border-right: none;
+}
+/* vertically center icon */
+.ui-spinner .ui-icon {
+ position: absolute;
+ margin-top: -8px;
+ top: 50%;
+ left: 0;
+}
+.ui-spinner-up {
+ top: 0;
+}
+.ui-spinner-down {
+ bottom: 0;
+}
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+ /* need to fix icons sprite */
+ background-position: -65px -16px;
+}
+.ui-tabs {
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+ padding: .2em;
+}
+.ui-tabs .ui-tabs-nav {
+ margin: 0;
+ padding: .2em .2em 0;
+}
+.ui-tabs .ui-tabs-nav li {
+ list-style: none;
+ float: left;
+ position: relative;
+ top: 0;
+ margin: 1px .2em 0 0;
+ border-bottom-width: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
+ float: left;
+ padding: .5em 1em;
+ text-decoration: none;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+ margin-bottom: -1px;
+ padding-bottom: 1px;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
+ cursor: text;
+}
+.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
+ cursor: pointer;
+}
+.ui-tabs .ui-tabs-panel {
+ display: block;
+ border-width: 0;
+ padding: 1em 1.4em;
+ background: none;
+}
+.ui-tooltip {
+ padding: 8px;
+ position: absolute;
+ z-index: 9999;
+ max-width: 300px;
+ -webkit-box-shadow: 0 0 5px #aaa;
+ box-shadow: 0 0 5px #aaa;
+}
+body .ui-tooltip {
+ border-width: 2px;
+}
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css
new file mode 100644
index 0000000..cf6d47b
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px} \ No newline at end of file
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.css
new file mode 100644
index 0000000..b1b01c9
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.css
@@ -0,0 +1,410 @@
+/*!
+ * jQuery UI CSS Framework 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/theming/
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=cb842e&bgTextureHeader=glass&bgImgOpacityHeader=25&borderColorHeader=d49768&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=f4f0ec&bgTextureContent=inset_soft&bgImgOpacityContent=100&borderColorContent=e0cfc2&fcContent=1e1b1d&iconColorContent=c47a23&bgColorDefault=ede4d4&bgTextureDefault=glass&bgImgOpacityDefault=70&borderColorDefault=cdc3b7&fcDefault=3f3731&iconColorDefault=f08000&bgColorHover=f5f0e5&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=f5ad66&fcHover=a46313&iconColorHover=f08000&bgColorActive=f4f0ec&bgTextureActive=highlight_hard&bgImgOpacityActive=100&borderColorActive=e0cfc2&fcActive=b85700&iconColorActive=f35f07&bgColorHighlight=f5f5b5&bgTextureHighlight=highlight_hard&bgImgOpacityHighlight=75&borderColorHighlight=d9bb73&fcHighlight=060200&iconColorHighlight=cb672b&bgColorError=fee4bd&bgTextureError=highlight_hard&bgImgOpacityError=65&borderColorError=f8893f&fcError=592003&iconColorError=ff7519&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=75&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Helvetica,Arial,sans-serif;
+ font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Helvetica,Arial,sans-serif;
+ font-size: 1em;
+}
+.ui-widget-content {
+ border: 1px solid #e0cfc2;
+ background: #f4f0ec url("images/ui-bg_inset-soft_100_f4f0ec_1x100.png") 50% bottom repeat-x;
+ color: #1e1b1d;
+}
+.ui-widget-content a {
+ color: #1e1b1d;
+}
+.ui-widget-header {
+ border: 1px solid #d49768;
+ background: #cb842e url("images/ui-bg_glass_25_cb842e_1x400.png") 50% 50% repeat-x;
+ color: #ffffff;
+ font-weight: bold;
+}
+.ui-widget-header a {
+ color: #ffffff;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default {
+ border: 1px solid #cdc3b7;
+ background: #ede4d4 url("images/ui-bg_glass_70_ede4d4_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #3f3731;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited {
+ color: #3f3731;
+ text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus {
+ border: 1px solid #f5ad66;
+ background: #f5f0e5 url("images/ui-bg_glass_100_f5f0e5_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #a46313;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited {
+ color: #a46313;
+ text-decoration: none;
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active {
+ border: 1px solid #e0cfc2;
+ background: #f4f0ec url("images/ui-bg_highlight-hard_100_f4f0ec_1x100.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #b85700;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #b85700;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #d9bb73;
+ background: #f5f5b5 url("images/ui-bg_highlight-hard_75_f5f5b5_1x100.png") 50% top repeat-x;
+ color: #060200;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #060200;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #f8893f;
+ background: #fee4bd url("images/ui-bg_highlight-hard_65_fee4bd_1x100.png") 50% top repeat-x;
+ color: #592003;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #592003;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #592003;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: .7;
+ filter:Alpha(Opacity=70); /* support: IE8 */
+ font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: .35;
+ filter:Alpha(Opacity=35); /* support: IE8 */
+ background-image: none;
+}
+.ui-state-disabled .ui-icon {
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+ background-image: url("images/ui-icons_c47a23_256x240.png");
+}
+.ui-widget-header .ui-icon {
+ background-image: url("images/ui-icons_ffffff_256x240.png");
+}
+.ui-state-default .ui-icon {
+ background-image: url("images/ui-icons_f08000_256x240.png");
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon {
+ background-image: url("images/ui-icons_f08000_256x240.png");
+}
+.ui-state-active .ui-icon {
+ background-image: url("images/ui-icons_f35f07_256x240.png");
+}
+.ui-state-highlight .ui-icon {
+ background-image: url("images/ui-icons_cb672b_256x240.png");
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+ background-image: url("images/ui-icons_ff7519_256x240.png");
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 6px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 6px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #aaaaaa;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+}
+.ui-widget-shadow {
+ margin: -8px 0 0 -8px;
+ padding: 8px;
+ background: #aaaaaa;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+ border-radius: 8px;
+}
diff --git a/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css
new file mode 100644
index 0000000..4ac4bd1
--- /dev/null
+++ b/http/3rdParty/jquery-ui-1.11.4.custom/jquery-ui.theme.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-widget{font-family:Helvetica,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Helvetica,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_inset-soft_100_f4f0ec_1x100.png") 50% bottom repeat-x;color:#1e1b1d}.ui-widget-content a{color:#1e1b1d}.ui-widget-header{border:1px solid #d49768;background:#cb842e url("images/ui-bg_glass_25_cb842e_1x400.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #cdc3b7;background:#ede4d4 url("images/ui-bg_glass_70_ede4d4_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#3f3731}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#3f3731;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #f5ad66;background:#f5f0e5 url("images/ui-bg_glass_100_f5f0e5_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#a46313}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#a46313;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_highlight-hard_100_f4f0ec_1x100.png") 50% 50% repeat-x;font-weight:normal;color:#b85700}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#b85700;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #d9bb73;background:#f5f5b5 url("images/ui-bg_highlight-hard_75_f5f5b5_1x100.png") 50% top repeat-x;color:#060200}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#060200}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f8893f;background:#fee4bd url("images/ui-bg_highlight-hard_65_fee4bd_1x100.png") 50% top repeat-x;color:#592003}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#592003}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#592003}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_c47a23_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_f35f07_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_cb672b_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ff7519_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:6px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:6px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file
diff --git a/http/3rdParty/jquery.ui.touch-punch.min.js b/http/3rdParty/jquery.ui.touch-punch.min.js
new file mode 100644
index 0000000..31272ce
--- /dev/null
+++ b/http/3rdParty/jquery.ui.touch-punch.min.js
@@ -0,0 +1,11 @@
+/*!
+ * jQuery UI Touch Punch 0.2.3
+ *
+ * Copyright 2011–2014, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ */
+!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); \ No newline at end of file
diff --git a/http/3rdParty/jqueryUI-download.txt b/http/3rdParty/jqueryUI-download.txt
new file mode 100644
index 0000000..455174f
--- /dev/null
+++ b/http/3rdParty/jqueryUI-download.txt
@@ -0,0 +1,12 @@
+http://jqueryui.com/download/#!version=1.11.4&components=1111111111111110001110000000000000000&zThemeParams=5d00000100f805000000000000003d8888d844329a8dfe02723de3e5701258a13d5ba490adca99e4a02bf259c3083bccd292fbc7a815b30f470ff7ff674aedf7a1da791f39f6b67854aba07e4d3b035f2fcc64ece2f1ddcf0f4a91922f40d8a367a3035faa9576ca92e366c91b05dc4807579017af05dfa5c41868e7c60f1cf532cb96cbe9d698621440f659cb3a585d6d4167c12192040a316a5d1de44d0356b8ec2bb9a07d37a0d800a019803fb2730f6951bf7f645e03a48012fe5d19fad63654d9c795944977ddc810be4fa969368f2289c193f20c5a888e0a30c5f02db720d801588c71f86fb3b3b5d2bd62798ee31969f327fbf464c15d822a7c4b70c5a6703d8ea31bea23014ec684b5d2230f29a5ab22cc76c46f4cf42f05e6001457338af56b66cd95b70796053b6ae5871a927f8931b0e5fc374db8ee329762a6540ab7a0f53eb517054bdbd4e461668920d9cf2ca72e9bf69e66813cdd77bd75b2a5b6f97583a656413dabe778c8b4bc48efe332ab808ab3d548c59fa24a97e88e3c907f0f3b7851e06f26948e0270787a4c6228e21797c749f97689177c0674c865c8261ecd32045bfc381c9765040874d23de248f84bfb4645d68851ca09e186217902e5f1d1cb34038a0b26a89a74142697d289c3a8bb20dd910129d5615e89ad44a36f506b10752a22888cb9106900dd882372497feab80fd5b1c0107805bb2de33484e58f22d51e116d47d0dff703df9c
+
+Um im datepicker mit dem kleinsten Tag anzufangen, muss in der jquery-ui.min.js folgendes ersetzt werden:
+this.maxRows=(.),(.)=this._daylightSavingAdjust
+durch
+this.maxRows=\1,\2=this._get\(arguments\[0\],"calendarStart"\) ? this._get\(arguments\[0\],"calendarStart"\).call\(this\) : this._daylightSavingAdjust
+
+Um submenus zu schliessen, muss folgender patch rein:
+
+mouseleave: "collapseAll",
+durch
+mouseleave:function(event){this.collapseAll(event,true)}, \ No newline at end of file
diff --git a/http/3rdParty/modernizr.custom.js b/http/3rdParty/modernizr.custom.js
new file mode 100644
index 0000000..9202820
--- /dev/null
+++ b/http/3rdParty/modernizr.custom.js
@@ -0,0 +1,4 @@
+/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
+ * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-webworkers-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
+ */
+;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)t[c[d]]=c[d]in k;return t.list&&(t.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},y=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return x("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e}),r.flexbox=function(){return I("flexWrap")},r.postmessage=function(){return!!a.postMessage},r.indexedDB=function(){return!!I("indexedDB",a)},r.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},r.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},r.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},r.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},r.backgroundsize=function(){return I("backgroundSize")},r.borderimage=function(){return I("borderImage")},r.borderradius=function(){return I("borderRadius")},r.boxshadow=function(){return I("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},r.cssanimations=function(){return I("animationName")},r.csscolumns=function(){return I("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},r.cssreflections=function(){return I("boxReflect")},r.csstransforms=function(){return!!I("transform")},r.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&x("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},r.csstransitions=function(){return I("transition")},r.fontface=function(){var a;return x('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},r.generatedcontent=function(){var a;return x(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},r.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},r.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache};for(var K in r)B(r,K)&&(w=K.toLowerCase(),e[w]=r[K](),u.push((e[w]?"":"no-")+w));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=y,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=x,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; \ No newline at end of file
diff --git a/http/3rdParty/yaMD5/README.md b/http/3rdParty/yaMD5/README.md
new file mode 100644
index 0000000..57ba203
--- /dev/null
+++ b/http/3rdParty/yaMD5/README.md
@@ -0,0 +1,90 @@
+### YaMD5 - Yet another MD5 hasher
+
+I needed an MD5 hasher, and as usual I want small code base, and fast.
+
+Originally found [md5-o-matic](https://github.com/trentmillar/md5-o-matic).
+It was fast but did not work with Unicode strings.
+Also, I eventually realized it was really based on [code from
+Joseph Myers](http://www.myersdaily.org/joseph/javascript/md5-text.html), which
+is itself a javascript adapation of the C language version the reference
+implementation of MD5 in Appendix 3 of
+[RFC 1321](http://www.rfc-editor.org/rfc/rfc1321.txt).
+
+Then I found [SparkMD5](https://github.com/satazor/SparkMD5), which works
+with Unicode strings, but at a steep cost to performance on large input strings.
+Also, glancing at the code I saw avoidable redundancies causing the code base
+to be larger than needed.
+
+So from this point I set out to write my own version, YaMD5 (sorry, I am
+not good with naming projects), of course heavily relying on the [original
+code from Joseph Myers](http://www.myersdaily.org/joseph/javascript/md5-text.html),
+(with modifications to incrementally improve performance as per profiling),
+and bits from [SparkMD5](https://github.com/satazor/SparkMD5) -- I started to
+work from SparkMD5 implementation, so there might be code original to
+SparkMD5 I kept in a few places (like say, code in md5.end() etc.)
+
+### Benefits of YaMD5
+
+- Can handle Unicode strings
+- Natively incremental
+- Small code base
+- Fastest MD5 hasher out there so far **for large input**:
+ * See <http://jsperf.com/md5-shootout/48> (all kind of implementations.)
+ * See <http://jsperf.com/md5-shootout/50> (implementations which supports Unicode strings.)
+ * Notes regarding the above _MD5 shootout_ benchmarks:
+ - Support both ASCII and Unicode strings:
+ * YaMD5
+ * [SparkMD5](https://github.com/satazor/SparkMD5)
+ * [Paul Johnston's MD5 ("Paj's MD5")](http://pajhome.org.uk/crypt/md5/md5.html)
+ * [js-crypto's MD5 ("TinyMD5")](https://github.com/jbt/js-crypto)
+ - Supports only ASCII strings:
+ * [Masanao Izumo's MD5 ("MD5_hexhash")](http://www.onicos.com/staff/iz/amuse/javascript/expert/md5.txt)
+ * [Joseph Myers's MD5 ("jkm MD5"](http://www.myersdaily.org/joseph/javascript/md5-text.html)
+ * [Trent Millar's MD5 ("MD5-o-matic")](https://github.com/trentmillar/md5-o-matic)
+ * [iReal's MD5 ("FastMD5")](https://github.com/iReal/FastMD5)
+ - _valums MD5_ code fails both ASCII and Unicode strings: **Do not use**.
+
+### Usage
+
+One pass:
+
+ YaMD5.hashStr('hello world\n') === "6f5902ac237024bdd0c176cb93063dc4"
+
+Incremental:
+
+ var md5Hasher = new YaMD5();
+ ...
+ md5Hasher.start();
+ md5Hasher.appendStr('hello');
+ md5Hasher.appendStr(' ');
+ md5Hasher.appendStr('world');
+ md5Hasher.appendStr('\n');
+ md5Hasher.end() === '6f5902ac237024bdd0c176cb93063dc4';
+
+### License
+
+I don't know what license covers Joseph Myers' code (need
+to find out). In any case, concerning whatever original code I contributed in
+there:
+
+The MIT License (MIT)
+
+Copyright (C) 2014 Raymond Hill
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/http/3rdParty/yaMD5/test/lib/ireal-md5.js b/http/3rdParty/yaMD5/test/lib/ireal-md5.js
new file mode 100644
index 0000000..ad69af4
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/ireal-md5.js
@@ -0,0 +1,346 @@
+// https://github.com/iReal/FastMD5
+;md5 = /* window.md5 || */ (function(window) {
+ var $0 = [], // res
+ $1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // tail
+ $2 = [], // md5blks
+ $3 = [128, 32768, 8388608, -2147483648], // c4
+ $4 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"], // c16
+ $5 = [0, 8, 16, 24]; // cS
+
+ function encode(s, sLen) {
+ var utf = "", start = end = 0;
+
+ for(var i = 0;i < sLen;i++) {
+ var c1 = s.charCodeAt(i),
+ enc = null;
+
+ if(c1 < 128) {
+ end++;
+ }else if(c1 > 127 && c1 < 2048) {
+ enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);
+ }else{
+ enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);
+ }
+ if(enc != null) {
+ if(end > start) {
+ utf += s.slice(start, end);
+ }
+ utf += enc;
+ start = end = i + 1;
+ }
+ }
+
+ if(end > start) {
+ utf += s.slice(start, sLen);
+ }
+
+ return utf;
+ }
+
+ function md51(s, sLen) {
+ var state,
+ N = sLen,
+ i;
+
+ s += "";
+
+ if(sLen > 63) {
+ md5blk(s.substring(0, 64));
+ state = md5cycle($2[0], $2[1], $2[2], $2[3], $2[4], $2[5], $2[6], $2[7], $2[8], $2[9], $2[10], $2[11], $2[12], $2[13], $2[14], $2[15])
+
+ for(i = 128;i <= sLen;i += 64) {
+ md5blk(s.substring(i - 64, i));
+ state = md5cycleAdd(state[0], state[1], state[2], state[3], $2[0], $2[1], $2[2], $2[3], $2[4], $2[5], $2[6], $2[7], $2[8], $2[9], $2[10], $2[11], $2[12], $2[13], $2[14], $2[15]);
+ }
+
+ s = s.substring(i - 64);
+ N = s.length;
+ }
+
+ for(i = ~~(N / 4);i < 16;i++) {
+ $1[i] = 0;
+ }
+
+ for(i = 0;i < N;i++) {
+ var I = i % 4;
+ if(I == 0) {
+ $1[i >> 2] = s.charCodeAt(i) << $5[I];
+ continue;
+ }
+
+ $1[i >> 2] |= s.charCodeAt(i) << $5[I];
+ }
+ $1[i >> 2] |= $3[i % 4];
+
+ if(i > 55) {
+ state = md5cycleAdd(1732584193, 4023233417, 2562383102, 271733878, $1[0], $1[1], $1[2], $1[3], $1[4], $1[5], $1[6], $1[7], $1[8], $1[9], $1[10], $1[11], $1[12], $1[13], $1[14], $1[15]);
+
+ return md5cycleAdd(state[0], state[1], state[2], state[3], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sLen * 8, 0);
+ }
+
+ return !state ? md5cycle($1[0], $1[1], $1[2], $1[3], $1[4], $1[5], $1[6], $1[7], $1[8], $1[9], $1[10], $1[11], $1[12], $1[13], sLen * 8, $1[15]) : md5cycleAdd(state[0], state[1], state[2], state[3], $1[0], $1[1], $1[2], $1[3], $1[4], $1[5], $1[6], $1[7], $1[8], $1[9], $1[10], $1[11], $1[12], $1[13], sLen * 8, $1[15]);
+ }
+
+ function md5blk(s) {
+ var i = 16;
+ while(i--) {
+ var I = i << 2;
+ $2[i] = s.charCodeAt(I) + (s.charCodeAt(I + 1) << 8) + (s.charCodeAt(I + 2) << 16) + (s.charCodeAt(I + 3) << 24);
+ }
+ }
+
+ function md5_main(s, enc, arr) {
+ var sLen = s.length;
+ if(enc) {
+ s = encode(s, sLen);
+ sLen = s.length;
+ }
+ s = md51(s, sLen);
+
+ var tmp = s[0];$0[1] = $4[tmp & 15];
+ tmp >>= 4;$0[0] = $4[tmp & 15];
+ tmp >>= 4;$0[3] = $4[tmp & 15];
+ tmp >>= 4;$0[2] = $4[tmp & 15];
+ tmp >>= 4;$0[5] = $4[tmp & 15];
+ tmp >>= 4;$0[4] = $4[tmp & 15];
+ tmp >>= 4;$0[7] = $4[tmp & 15];
+ tmp >>= 4;$0[6] = $4[tmp & 15];
+
+ tmp = s[1];$0[9] = $4[tmp & 15];
+ tmp >>= 4;$0[8] = $4[tmp & 15];
+ tmp >>= 4;$0[11] = $4[tmp & 15];
+ tmp >>= 4;$0[10] = $4[tmp & 15];
+ tmp >>= 4;$0[13] = $4[tmp & 15];
+ tmp >>= 4;$0[12] = $4[tmp & 15];
+ tmp >>= 4;$0[15] = $4[tmp & 15];
+ tmp >>= 4;$0[14] = $4[tmp & 15];
+
+ tmp = s[2];$0[17] = $4[tmp & 15];
+ tmp >>= 4;$0[16] = $4[tmp & 15];
+ tmp >>= 4;$0[19] = $4[tmp & 15];
+ tmp >>= 4;$0[18] = $4[tmp & 15];
+ tmp >>= 4;$0[21] = $4[tmp & 15];
+ tmp >>= 4;$0[20] = $4[tmp & 15];
+ tmp >>= 4;$0[23] = $4[tmp & 15];
+ tmp >>= 4;$0[22] = $4[tmp & 15];
+
+ tmp = s[3];$0[25] = $4[tmp & 15];
+ tmp >>= 4;$0[24] = $4[tmp & 15];
+ tmp >>= 4;$0[27] = $4[tmp & 15];
+ tmp >>= 4;$0[26] = $4[tmp & 15];
+ tmp >>= 4;$0[29] = $4[tmp & 15];
+ tmp >>= 4;$0[28] = $4[tmp & 15];
+ tmp >>= 4;$0[31] = $4[tmp & 15];
+ tmp >>= 4;$0[30] = $4[tmp & 15];
+
+ return arr ? $0 : $0[0] + $0[1] + $0[2] + $0[3] + $0[4] + $0[5] + $0[6] + $0[7] + $0[8] + $0[9] + $0[10] + $0[11] + $0[12] + $0[13] + $0[14] + $0[15] + $0[16] + $0[17] + $0[18] + $0[19] + $0[20] + $0[21] + $0[22] + $0[23] + $0[24] + $0[25] + $0[26] + $0[27] + $0[28] + $0[29] + $0[30] + $0[31];
+ }
+
+ var md5_asmjs = (function(std, env, buf) {
+ "use asm";
+
+ var TA = new std.Int32Array(buf);
+
+ function R(q, a, b, x, s1, s2, t) {
+ q = q|0;
+ a = a|0;
+ b = b|0;
+ x = x|0;
+ s1 = s1|0;
+ s2 = s2|0;
+ t = t|0;
+
+ a = a + q + x + t;
+ return ((a << s1 | a >>> s2) + b) << 0;
+ }
+
+ function md5cycle(k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15) {
+ k0 = k0|0;
+ k1 = k1|0;
+ k2 = k2|0;
+ k3 = k3|0;
+ k4 = k4|0;
+ k5 = k5|0;
+ k6 = k6|0;
+ k7 = k7|0;
+ k8 = k8|0;
+ k9 = k9|0;
+ k10 = k10|0;
+ k11 = k11|0;
+ k12 = k12|0;
+ k13 = k13|0;
+ k14 = k14|0;
+ k15 = k15|0;
+
+ md5_rounds(1732584193, -271733879, -1732584194, 271733878, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, 1);
+
+ TA[0] = (TA[0] + 1732584193) << 0;
+ TA[1] = (TA[1] - 271733879) << 0;
+ TA[2] = (TA[2] - 1732584194) << 0;
+ TA[3] = (TA[3] + 271733878) << 0;
+
+ return TA;
+ }
+
+ function md5cycleAdd(x0, x1, x2, x3, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15) {
+ x0 = x0|0;
+ x1 = x1|0;
+ x2 = x2|0;
+ x3 = x3|0;
+ k0 = k0|0;
+ k1 = k1|0;
+ k2 = k2|0;
+ k3 = k3|0;
+ k4 = k4|0;
+ k5 = k5|0;
+ k6 = k6|0;
+ k7 = k7|0;
+ k8 = k8|0;
+ k9 = k9|0;
+ k10 = k10|0;
+ k11 = k11|0;
+ k12 = k12|0;
+ k13 = k13|0;
+ k14 = k14|0;
+ k15 = k15|0;
+
+ md5_rounds(x0, x1, x2, x3, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, 0);
+
+ TA[0] = (TA[0] + x0) << 0;
+ TA[1] = (TA[1] + x1) << 0;
+ TA[2] = (TA[2] + x2) << 0;
+ TA[3] = (TA[3] + x3) << 0;
+
+ return TA;
+ }
+
+ function md5_rounds(a, b, c, d, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, simple) {
+ a = a|0;
+ b = b|0;
+ c = c|0;
+ d = d|0;
+ k0 = k0|0;
+ k1 = k1|0;
+ k2 = k2|0;
+ k3 = k3|0;
+ k4 = k4|0;
+ k5 = k5|0;
+ k6 = k6|0;
+ k7 = k7|0;
+ k8 = k8|0;
+ k9 = k9|0;
+ k10 = k10|0;
+ k11 = k11|0;
+ k12 = k12|0;
+ k13 = k13|0;
+ k14 = k14|0;
+ k15 = k15|0;
+ simple = simple|0;
+ var bc = bc|0;
+ var da = da|0;
+
+ if(simple == 1|0) {
+ a = k0 - 680876937;
+ a = ((a << 7 | a >>> 25) - 271733879) << 0;
+ d = k1 - 117830708 + ((2004318071 & a) ^ -1732584194);
+ d = ((d << 12 | d >>> 20) + a) << 0;
+ c = k2 - 1126478375 + (((a ^ -271733879) & d) ^ -271733879);
+ c = ((c << 17 | c >>> 15) + d) << 0;
+ b = k3 - 1316259209 + (((d ^ a) & c) ^ a);
+ b = ((b << 22 | b >>> 10) + c) << 0;
+ }else{
+ a = R(((c ^ d) & b) ^ d, a, b, k0, 7, 25, -680876936);
+ d = R(((b ^ c) & a) ^ c, d, a, k1, 12, 20, -389564586);
+ c = R(((a ^ b) & d) ^ b, c, d, k2, 17, 15, 606105819);
+ b = R(((d ^ a) & c) ^ a, b, c, k3, 22, 10, -1044525330);
+ }
+
+ a = R(((c ^ d) & b) ^ d, a, b, k4, 7, 25, -176418897);
+ d = R(((b ^ c) & a) ^ c, d, a, k5, 12, 20, 1200080426);
+ c = R(((a ^ b) & d) ^ b, c, d, k6, 17, 15, -1473231341);
+ b = R(((d ^ a) & c) ^ a, b, c, k7, 22, 10, -45705983);
+ a = R(((c ^ d) & b) ^ d, a, b, k8, 7, 25, 1770035416);
+ d = R(((b ^ c) & a) ^ c, d, a, k9, 12, 20, -1958414417);
+ c = R(((a ^ b) & d) ^ b, c, d, k10, 17, 15, -42063);
+ b = R(((d ^ a) & c) ^ a, b, c, k11, 22, 10, -1990404162);
+ a = R(((c ^ d) & b) ^ d, a, b, k12, 7, 25, 1804603682);
+ d = R(((b ^ c) & a) ^ c, d, a, k13, 12, 20, -40341101);
+ c = R(((a ^ b) & d) ^ b, c, d, k14, 17, 15, -1502002290);
+ b = R(((d ^ a) & c) ^ a, b, c, k15, 22, 10, 1236535329);
+
+ a = R(((b ^ c) & d) ^ c, a, b, k1, 5, 27, -165796510);
+ d = R(((a ^ b) & c) ^ b, d, a, k6, 9, 23, -1069501632);
+ c = R(((d ^ a) & b) ^ a, c, d, k11, 14, 18, 643717713);
+ b = R(((c ^ d) & a) ^ d, b, c, k0, 20, 12, -373897302);
+ a = R(((b ^ c) & d) ^ c, a, b, k5, 5, 27, -701558691);
+ d = R(((a ^ b) & c) ^ b, d, a, k10, 9, 23, 38016083);
+ c = R(((d ^ a) & b) ^ a, c, d, k15, 14, 18, -660478335);
+ b = R(((c ^ d) & a) ^ d, b, c, k4, 20, 12, -405537848);
+ a = R(((b ^ c) & d) ^ c, a, b, k9, 5, 27, 568446438);
+ d = R(((a ^ b) & c) ^ b, d, a, k14, 9, 23, -1019803690);
+ c = R(((d ^ a) & b) ^ a, c, d, k3, 14, 18, -187363961);
+ b = R(((c ^ d) & a) ^ d, b, c, k8, 20, 12, 1163531501);
+ a = R(((b ^ c) & d) ^ c, a, b, k13, 5, 27, -1444681467);
+ d = R(((a ^ b) & c) ^ b, d, a, k2, 9, 23, -51403784);
+ c = R(((d ^ a) & b) ^ a, c, d, k7, 14, 18, 1735328473);
+ b = R(((c ^ d) & a) ^ d, b, c, k12, 20, 12, -1926607734);
+
+ bc = b ^ c;
+ a = R(bc ^ d, a, b, k5, 4, 28, -378558);
+ d = R(bc ^ a, d, a, k8, 11, 21, -2022574463);
+ da = d ^ a;
+ c = R(da ^ b, c, d, k11, 16, 16, 1839030562);
+ b = R(da ^ c, b, c, k14, 23, 9, -35309556);
+ bc = b ^ c;
+ a = R(bc ^ d, a, b, k1, 4, 28, -1530992060);
+ d = R(bc ^ a, d, a, k4, 11, 21, 1272893353);
+ da = d ^ a;
+ c = R(da ^ b, c, d, k7, 16, 16, -155497632);
+ b = R(da ^ c, b, c, k10, 23, 9, -1094730640);
+ bc = b ^ c;
+ a = R(bc ^ d, a, b, k13, 4, 28, 681279174);
+ d = R(bc ^ a, d, a, k0, 11, 21, -358537222);
+ da = d ^ a;
+ c = R(da ^ b, c, d, k3, 16, 16, -722521979);
+ b = R(da ^ c, b, c, k6, 23, 9, 76029189);
+ bc = b ^ c;
+ a = R(bc ^ d, a, b, k9, 4, 28, -640364487);
+ d = R(bc ^ a, d, a, k12, 11, 21, -421815835);
+ da = d ^ a;
+ c = R(da ^ b, c, d, k15, 16, 16, 530742520);
+ b = R(da ^ c, b, c, k2, 23, 9, -995338651);
+
+ a = R(c ^ (b | ~d), a, b, k0, 6, 26, -198630844);
+ d = R(b ^ (a | ~c), d, a, k7, 10, 22, 1126891415);
+ c = R(a ^ (d | ~b), c, d, k14, 15, 17, -1416354905);
+ b = R(d ^ (c | ~a), b, c, k5, 21, 11, -57434055);
+ a = R(c ^ (b | ~d), a, b, k12, 6, 26, 1700485571);
+ d = R(b ^ (a | ~c), d, a, k3, 10, 22, -1894986606);
+ c = R(a ^ (d | ~b), c, d, k10, 15, 17, -1051523);
+ b = R(d ^ (c | ~a), b, c, k1, 21, 11, -2054922799);
+ a = R(c ^ (b | ~d), a, b, k8, 6, 26, 1873313359);
+ d = R(b ^ (a | ~c), d, a, k15, 10, 22, -30611744);
+ c = R(a ^ (d | ~b), c, d, k6, 15, 17, -1560198380);
+ b = R(d ^ (c | ~a), b, c, k13, 21, 11, 1309151649);
+ a = R(c ^ (b | ~d), a, b, k4, 6, 26, -145523070);
+ d = R(b ^ (a | ~c), d, a, k11, 10, 22, -1120210379);
+ c = R(a ^ (d | ~b), c, d, k2, 15, 17, 718787259);
+ b = R(d ^ (c | ~a), b, c, k9, 21, 11, -343485551);
+
+ TA[0] = a;
+ TA[1] = b;
+ TA[2] = c;
+ TA[3] = d;
+ }
+
+ return {
+ md5cycle: md5cycle,
+ md5cycleAdd: md5cycleAdd
+ };
+ })(window, null, new ArrayBuffer(16));
+
+ var md5cycle = md5_asmjs.md5cycle,
+ md5cycleAdd = md5_asmjs.md5cycleAdd;
+
+ return md5_main;
+})(window);
diff --git a/http/3rdParty/yaMD5/test/lib/izumo-md5.js b/http/3rdParty/yaMD5/test/lib/izumo-md5.js
new file mode 100644
index 0000000..bf400f6
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/izumo-md5.js
@@ -0,0 +1,206 @@
+// http://www.onicos.com/staff/iz/amuse/javascript/expert/md5.txt
+var izumoMD5 = (function(){
+
+/* md5.js - MD5 Message-Digest
+ * Copyright (C) 1999,2002 Masanao Izumo <iz@onicos.co.jp>
+ * Version: 2.0.0
+ * LastModified: May 13 2002
+ *
+ * This program is free software. You can redistribute it and/or modify
+ * it without any warranty. This library calculates the MD5 based on RFC1321.
+ * See RFC1321 for more information and algorism.
+ */
+
+/* Interface:
+ * md5_128bits = MD5_hash(data);
+ * md5_hexstr = MD5_hexhash(data);
+ */
+
+/* ChangeLog
+ * 2002/05/13: Version 2.0.0 released
+ * NOTICE: API is changed.
+ * 2002/04/15: Bug fix about MD5 length.
+ */
+
+
+// md5_T[i] = parseInt(Math.abs(Math.sin(i)) * 4294967296.0);
+var MD5_T = new Array(0x00000000, 0xd76aa478, 0xe8c7b756, 0x242070db,
+ 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613,
+ 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1,
+ 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e,
+ 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51,
+ 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681,
+ 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87,
+ 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9,
+ 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122,
+ 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60,
+ 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085,
+ 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8,
+ 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7,
+ 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d,
+ 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314,
+ 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb,
+ 0xeb86d391);
+
+var MD5_round1 = new Array(new Array( 0, 7, 1), new Array( 1,12, 2),
+ new Array( 2,17, 3), new Array( 3,22, 4),
+ new Array( 4, 7, 5), new Array( 5,12, 6),
+ new Array( 6,17, 7), new Array( 7,22, 8),
+ new Array( 8, 7, 9), new Array( 9,12,10),
+ new Array(10,17,11), new Array(11,22,12),
+ new Array(12, 7,13), new Array(13,12,14),
+ new Array(14,17,15), new Array(15,22,16));
+
+var MD5_round2 = new Array(new Array( 1, 5,17), new Array( 6, 9,18),
+ new Array(11,14,19), new Array( 0,20,20),
+ new Array( 5, 5,21), new Array(10, 9,22),
+ new Array(15,14,23), new Array( 4,20,24),
+ new Array( 9, 5,25), new Array(14, 9,26),
+ new Array( 3,14,27), new Array( 8,20,28),
+ new Array(13, 5,29), new Array( 2, 9,30),
+ new Array( 7,14,31), new Array(12,20,32));
+
+var MD5_round3 = new Array(new Array( 5, 4,33), new Array( 8,11,34),
+ new Array(11,16,35), new Array(14,23,36),
+ new Array( 1, 4,37), new Array( 4,11,38),
+ new Array( 7,16,39), new Array(10,23,40),
+ new Array(13, 4,41), new Array( 0,11,42),
+ new Array( 3,16,43), new Array( 6,23,44),
+ new Array( 9, 4,45), new Array(12,11,46),
+ new Array(15,16,47), new Array( 2,23,48));
+
+var MD5_round4 = new Array(new Array( 0, 6,49), new Array( 7,10,50),
+ new Array(14,15,51), new Array( 5,21,52),
+ new Array(12, 6,53), new Array( 3,10,54),
+ new Array(10,15,55), new Array( 1,21,56),
+ new Array( 8, 6,57), new Array(15,10,58),
+ new Array( 6,15,59), new Array(13,21,60),
+ new Array( 4, 6,61), new Array(11,10,62),
+ new Array( 2,15,63), new Array( 9,21,64));
+
+function MD5_F(x, y, z) { return (x & y) | (~x & z); }
+function MD5_G(x, y, z) { return (x & z) | (y & ~z); }
+function MD5_H(x, y, z) { return x ^ y ^ z; }
+function MD5_I(x, y, z) { return y ^ (x | ~z); }
+
+var MD5_round = new Array(new Array(MD5_F, MD5_round1),
+ new Array(MD5_G, MD5_round2),
+ new Array(MD5_H, MD5_round3),
+ new Array(MD5_I, MD5_round4));
+
+function MD5_pack(n32) {
+ return String.fromCharCode(n32 & 0xff) +
+ String.fromCharCode((n32 >>> 8) & 0xff) +
+ String.fromCharCode((n32 >>> 16) & 0xff) +
+ String.fromCharCode((n32 >>> 24) & 0xff);
+}
+
+function MD5_unpack(s4) {
+ return s4.charCodeAt(0) |
+ (s4.charCodeAt(1) << 8) |
+ (s4.charCodeAt(2) << 16) |
+ (s4.charCodeAt(3) << 24);
+}
+
+function MD5_number(n) {
+ while (n < 0)
+ n += 4294967296;
+ while (n > 4294967295)
+ n -= 4294967296;
+ return n;
+}
+
+function MD5_apply_round(x, s, f, abcd, r) {
+ var a, b, c, d;
+ var kk, ss, ii;
+ var t, u;
+
+ a = abcd[0];
+ b = abcd[1];
+ c = abcd[2];
+ d = abcd[3];
+ kk = r[0];
+ ss = r[1];
+ ii = r[2];
+
+ u = f(s[b], s[c], s[d]);
+ t = s[a] + u + x[kk] + MD5_T[ii];
+ t = MD5_number(t);
+ t = ((t<<ss) | (t>>>(32-ss)));
+ t += s[b];
+ s[a] = MD5_number(t);
+}
+
+function MD5_hash(data) {
+ var abcd, x, state, s;
+ var len, index, padLen, f, r;
+ var i, j, k;
+ var tmp;
+
+ state = new Array(0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476);
+ len = data.length;
+ index = len & 0x3f;
+ padLen = (index < 56) ? (56 - index) : (120 - index);
+ if(padLen > 0) {
+ data += "\x80";
+ for(i = 0; i < padLen - 1; i++)
+ data += "\x00";
+ }
+ data += MD5_pack(len * 8);
+ data += MD5_pack(0);
+ len += padLen + 8;
+ abcd = new Array(0, 1, 2, 3);
+ x = new Array(16);
+ s = new Array(4);
+
+ for(k = 0; k < len; k += 64) {
+ for(i = 0, j = k; i < 16; i++, j += 4) {
+ x[i] = data.charCodeAt(j) |
+ (data.charCodeAt(j + 1) << 8) |
+ (data.charCodeAt(j + 2) << 16) |
+ (data.charCodeAt(j + 3) << 24);
+ }
+ for(i = 0; i < 4; i++)
+ s[i] = state[i];
+ for(i = 0; i < 4; i++) {
+ f = MD5_round[i][0];
+ r = MD5_round[i][1];
+ for(j = 0; j < 16; j++) {
+ MD5_apply_round(x, s, f, abcd, r[j]);
+ tmp = abcd[0];
+ abcd[0] = abcd[3];
+ abcd[3] = abcd[2];
+ abcd[2] = abcd[1];
+ abcd[1] = tmp;
+ }
+ }
+
+ for(i = 0; i < 4; i++) {
+ state[i] += s[i];
+ state[i] = MD5_number(state[i]);
+ }
+ }
+
+ return MD5_pack(state[0]) +
+ MD5_pack(state[1]) +
+ MD5_pack(state[2]) +
+ MD5_pack(state[3]);
+}
+
+function MD5_hexhash(data) {
+ var i, out, c;
+ var bit128;
+
+ bit128 = MD5_hash(data);
+ out = "";
+ for(i = 0; i < 16; i++) {
+ c = bit128.charCodeAt(i);
+ out += "0123456789abcdef".charAt((c>>4) & 0xf);
+ out += "0123456789abcdef".charAt(c & 0xf);
+ }
+ return out;
+}
+
+return MD5_hexhash;
+
+})();
diff --git a/http/3rdParty/yaMD5/test/lib/jbt-md5.js b/http/3rdParty/yaMD5/test/lib/jbt-md5.js
new file mode 100644
index 0000000..4738877
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/jbt-md5.js
@@ -0,0 +1,74 @@
+// https://github.com/jbt/js-crypto
+md5 = function(sixteen){
+
+ var k = [],i=0;
+
+ for(;i<64;){
+ k[i] = 0|(Math.abs(Math.sin(++i)) * 4294967296);
+ }
+
+ function add(x, y){
+ return (((x>>1)+(y>>1))<<1)+(x&1)+(y&1) ;
+ //var msw = (x >> sixteen) + (y >> sixteen) + ((y=(x & ffff) + (y & ffff)) >> sixteen);
+ //return (msw << sixteen) | (y & ffff);
+ }
+
+ var calcMD5 = function(str){
+ var b,c,d,j,
+ x = [],
+ str2 = unescape(encodeURI(str)),
+ a = str2.length,
+ h = [b=1732584193,c=-271733879,~b,~c],
+ i=0;
+
+ for(;i<=a;) x[i >> 2] |= (str2.charCodeAt(i)||128) << 8*(i++ % 4);
+ x[str=(a+8 >> 6)*sixteen+14] = a * 8;
+ i = 0;
+
+ for(; i < str; i += sixteen){
+ a = h,j=0;
+ for(;j<64;){
+ a = [
+ d = a[3],
+ add(
+ b = a[1] ,
+ (d = add(
+ add(
+ a[0],
+ [
+ b&(c=a[2]) | ~b&d,
+ d&b | ~d&c,
+ b^c^d,
+ c^(b|~d)
+ ][a=j>>4]
+ ),
+ add(
+ k[j],
+ x[[
+ j,
+ 5*j+1,
+ 3*j+5,
+ 7*j
+ ][a]%sixteen+i]
+ )
+ )) << (a =[
+ 7, 12, 17, 22,
+ 5, 9, 14, 20,
+ 4, 11, sixteen, 23,
+ 6, 10, 15, 21
+ ][4*a+j++%4]) | d >>> 32-a
+ ),
+ b,
+ c
+ ];
+ }
+ for(j=4;j;) h[--j] = add(h[j], a[j]);
+ }
+
+ str = '';
+ for(;j<32;) str += ((h[j>>3] >> ((1^j++&7)*4)) & 15).toString(sixteen);
+
+ return str;
+ };
+ return calcMD5;
+}(16);
diff --git a/http/3rdParty/yaMD5/test/lib/jkm-md5.js b/http/3rdParty/yaMD5/test/lib/jkm-md5.js
new file mode 100644
index 0000000..69ed9fe
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/jkm-md5.js
@@ -0,0 +1,191 @@
+// http://www.myersdaily.org/joseph/javascript/md5-text.html
+var jkmMD5 = (function(){
+
+function md5cycle(x, k) {
+var a = x[0], b = x[1], c = x[2], d = x[3];
+
+a = ff(a, b, c, d, k[0], 7, -680876936);
+d = ff(d, a, b, c, k[1], 12, -389564586);
+c = ff(c, d, a, b, k[2], 17, 606105819);
+b = ff(b, c, d, a, k[3], 22, -1044525330);
+a = ff(a, b, c, d, k[4], 7, -176418897);
+d = ff(d, a, b, c, k[5], 12, 1200080426);
+c = ff(c, d, a, b, k[6], 17, -1473231341);
+b = ff(b, c, d, a, k[7], 22, -45705983);
+a = ff(a, b, c, d, k[8], 7, 1770035416);
+d = ff(d, a, b, c, k[9], 12, -1958414417);
+c = ff(c, d, a, b, k[10], 17, -42063);
+b = ff(b, c, d, a, k[11], 22, -1990404162);
+a = ff(a, b, c, d, k[12], 7, 1804603682);
+d = ff(d, a, b, c, k[13], 12, -40341101);
+c = ff(c, d, a, b, k[14], 17, -1502002290);
+b = ff(b, c, d, a, k[15], 22, 1236535329);
+
+a = gg(a, b, c, d, k[1], 5, -165796510);
+d = gg(d, a, b, c, k[6], 9, -1069501632);
+c = gg(c, d, a, b, k[11], 14, 643717713);
+b = gg(b, c, d, a, k[0], 20, -373897302);
+a = gg(a, b, c, d, k[5], 5, -701558691);
+d = gg(d, a, b, c, k[10], 9, 38016083);
+c = gg(c, d, a, b, k[15], 14, -660478335);
+b = gg(b, c, d, a, k[4], 20, -405537848);
+a = gg(a, b, c, d, k[9], 5, 568446438);
+d = gg(d, a, b, c, k[14], 9, -1019803690);
+c = gg(c, d, a, b, k[3], 14, -187363961);
+b = gg(b, c, d, a, k[8], 20, 1163531501);
+a = gg(a, b, c, d, k[13], 5, -1444681467);
+d = gg(d, a, b, c, k[2], 9, -51403784);
+c = gg(c, d, a, b, k[7], 14, 1735328473);
+b = gg(b, c, d, a, k[12], 20, -1926607734);
+
+a = hh(a, b, c, d, k[5], 4, -378558);
+d = hh(d, a, b, c, k[8], 11, -2022574463);
+c = hh(c, d, a, b, k[11], 16, 1839030562);
+b = hh(b, c, d, a, k[14], 23, -35309556);
+a = hh(a, b, c, d, k[1], 4, -1530992060);
+d = hh(d, a, b, c, k[4], 11, 1272893353);
+c = hh(c, d, a, b, k[7], 16, -155497632);
+b = hh(b, c, d, a, k[10], 23, -1094730640);
+a = hh(a, b, c, d, k[13], 4, 681279174);
+d = hh(d, a, b, c, k[0], 11, -358537222);
+c = hh(c, d, a, b, k[3], 16, -722521979);
+b = hh(b, c, d, a, k[6], 23, 76029189);
+a = hh(a, b, c, d, k[9], 4, -640364487);
+d = hh(d, a, b, c, k[12], 11, -421815835);
+c = hh(c, d, a, b, k[15], 16, 530742520);
+b = hh(b, c, d, a, k[2], 23, -995338651);
+
+a = ii(a, b, c, d, k[0], 6, -198630844);
+d = ii(d, a, b, c, k[7], 10, 1126891415);
+c = ii(c, d, a, b, k[14], 15, -1416354905);
+b = ii(b, c, d, a, k[5], 21, -57434055);
+a = ii(a, b, c, d, k[12], 6, 1700485571);
+d = ii(d, a, b, c, k[3], 10, -1894986606);
+c = ii(c, d, a, b, k[10], 15, -1051523);
+b = ii(b, c, d, a, k[1], 21, -2054922799);
+a = ii(a, b, c, d, k[8], 6, 1873313359);
+d = ii(d, a, b, c, k[15], 10, -30611744);
+c = ii(c, d, a, b, k[6], 15, -1560198380);
+b = ii(b, c, d, a, k[13], 21, 1309151649);
+a = ii(a, b, c, d, k[4], 6, -145523070);
+d = ii(d, a, b, c, k[11], 10, -1120210379);
+c = ii(c, d, a, b, k[2], 15, 718787259);
+b = ii(b, c, d, a, k[9], 21, -343485551);
+
+x[0] = add32(a, x[0]);
+x[1] = add32(b, x[1]);
+x[2] = add32(c, x[2]);
+x[3] = add32(d, x[3]);
+
+}
+
+function cmn(q, a, b, x, s, t) {
+a = add32(add32(a, q), add32(x, t));
+return add32((a << s) | (a >>> (32 - s)), b);
+}
+
+function ff(a, b, c, d, x, s, t) {
+return cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+
+function gg(a, b, c, d, x, s, t) {
+return cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+
+function hh(a, b, c, d, x, s, t) {
+return cmn(b ^ c ^ d, a, b, x, s, t);
+}
+
+function ii(a, b, c, d, x, s, t) {
+return cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+function md51(s) {
+txt = '';
+var n = s.length,
+state = [1732584193, -271733879, -1732584194, 271733878], i;
+for (i=64; i<=s.length; i+=64) {
+md5cycle(state, md5blk(s.substring(i-64, i)));
+}
+s = s.substring(i-64);
+var tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];
+for (i=0; i<s.length; i++)
+tail[i>>2] |= s.charCodeAt(i) << ((i%4) << 3);
+tail[i>>2] |= 0x80 << ((i%4) << 3);
+if (i > 55) {
+md5cycle(state, tail);
+for (i=0; i<16; i++) tail[i] = 0;
+}
+tail[14] = n*8;
+md5cycle(state, tail);
+return state;
+}
+
+/* there needs to be support for Unicode here,
+ * unless we pretend that we can redefine the MD-5
+ * algorithm for multi-byte characters (perhaps
+ * by adding every four 16-bit characters and
+ * shortening the sum to 32 bits). Otherwise
+ * I suggest performing MD-5 as if every character
+ * was two bytes--e.g., 0040 0025 = @%--but then
+ * how will an ordinary MD-5 sum be matched?
+ * There is no way to standardize text to something
+ * like UTF-8 before transformation; speed cost is
+ * utterly prohibitive. The JavaScript standard
+ * itself needs to look at this: it should start
+ * providing access to strings as preformed UTF-8
+ * 8-bit unsigned value arrays.
+ */
+function md5blk(s) { /* I figured global was faster. */
+var md5blks = [], i; /* Andy King said do it this way. */
+for (i=0; i<64; i+=4) {
+md5blks[i>>2] = s.charCodeAt(i)
++ (s.charCodeAt(i+1) << 8)
++ (s.charCodeAt(i+2) << 16)
++ (s.charCodeAt(i+3) << 24);
+}
+return md5blks;
+}
+
+var hex_chr = '0123456789abcdef'.split('');
+
+function rhex(n)
+{
+var s='', j=0;
+for(; j<4; j++)
+s += hex_chr[(n >> (j * 8 + 4)) & 0x0F]
++ hex_chr[(n >> (j * 8)) & 0x0F];
+return s;
+}
+
+function hex(x) {
+for (var i=0; i<x.length; i++)
+x[i] = rhex(x[i]);
+return x.join('');
+}
+
+function md5(s) {
+return hex(md51(s));
+}
+
+/* this function is much faster,
+so if possible we use it. Some IEs
+are the only ones I know of that
+need the idiotic second function,
+generated by an if clause. */
+
+function add32(a, b) {
+return (a + b) & 0xFFFFFFFF;
+}
+
+if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {
+function add32(x, y) {
+var lsw = (x & 0xFFFF) + (y & 0xFFFF),
+msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+return (msw << 16) | (lsw & 0xFFFF);
+}
+}
+
+return md5;
+
+})();
diff --git a/http/3rdParty/yaMD5/test/lib/paj-md5.js b/http/3rdParty/yaMD5/test/lib/paj-md5.js
new file mode 100644
index 0000000..1c4ce4b
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/paj-md5.js
@@ -0,0 +1,360 @@
+// http://pajhome.org.uk/crypt/md5/md5.html
+var pajMD5 = (function(){
+ /*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+ /*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+ var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+ var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+
+ /*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+
+ function hex_md5(s) {
+ return rstr2hex(rstr_md5(str2rstr_utf8(s)));
+ }
+
+ function b64_md5(s) {
+ return rstr2b64(rstr_md5(str2rstr_utf8(s)));
+ }
+
+ function any_md5(s, e) {
+ return rstr2any(rstr_md5(str2rstr_utf8(s)), e);
+ }
+
+ function hex_hmac_md5(k, d) {
+ return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)));
+ }
+
+ function b64_hmac_md5(k, d) {
+ return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)));
+ }
+
+ function any_hmac_md5(k, d, e) {
+ return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e);
+ }
+
+ /*
+ * Perform a simple self-test to see if the VM is working
+ */
+
+ function md5_vm_test() {
+ return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
+ }
+
+ /*
+ * Calculate the MD5 of a raw string
+ */
+
+ function rstr_md5(s) {
+ return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
+ }
+
+ /*
+ * Calculate the HMAC-MD5, of a key and some data (raw strings)
+ */
+
+ function rstr_hmac_md5(key, data) {
+ var bkey = rstr2binl(key);
+ if (bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
+
+ var ipad = Array(16),
+ opad = Array(16);
+ for (var i = 0; i < 16; i++) {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
+ return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
+ }
+
+ /*
+ * Convert a raw string to a hex string
+ */
+
+ function rstr2hex(input) {
+ try {
+ hexcase
+ } catch (e) {
+ hexcase = 0;
+ }
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var output = "";
+ var x;
+ for (var i = 0; i < input.length; i++) {
+ x = input.charCodeAt(i);
+ output += hex_tab.charAt((x >>> 4) & 0x0F) + hex_tab.charAt(x & 0x0F);
+ }
+ return output;
+ }
+
+ /*
+ * Convert a raw string to a base-64 string
+ */
+
+ function rstr2b64(input) {
+ try {
+ b64pad
+ } catch (e) {
+ b64pad = '';
+ }
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var output = "";
+ var len = input.length;
+ for (var i = 0; i < len; i += 3) {
+ var triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);
+ for (var j = 0; j < 4; j++) {
+ if (i * 8 + j * 6 > input.length * 8) output += b64pad;
+ else output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);
+ }
+ }
+ return output;
+ }
+
+ /*
+ * Convert a raw string to an arbitrary string encoding
+ */
+
+ function rstr2any(input, encoding) {
+ var divisor = encoding.length;
+ var i, j, q, x, quotient;
+
+ /* Convert to an array of 16-bit big-endian values, forming the dividend */
+ var dividend = Array(Math.ceil(input.length / 2));
+ for (i = 0; i < dividend.length; i++) {
+ dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
+ }
+
+ /*
+ * Repeatedly perform a long division. The binary array forms the dividend,
+ * the length of the encoding is the divisor. Once computed, the quotient
+ * forms the dividend for the next step. All remainders are stored for later
+ * use.
+ */
+ var full_length = Math.ceil(input.length * 8 / (Math.log(encoding.length) / Math.log(2)));
+ var remainders = Array(full_length);
+ for (j = 0; j < full_length; j++) {
+ quotient = Array();
+ x = 0;
+ for (i = 0; i < dividend.length; i++) {
+ x = (x << 16) + dividend[i];
+ q = Math.floor(x / divisor);
+ x -= q * divisor;
+ if (quotient.length > 0 || q > 0) quotient[quotient.length] = q;
+ }
+ remainders[j] = x;
+ dividend = quotient;
+ }
+
+ /* Convert the remainders to the output string */
+ var output = "";
+ for (i = remainders.length - 1; i >= 0; i--)
+ output += encoding.charAt(remainders[i]);
+
+ return output;
+ }
+
+ /*
+ * Encode a string as utf-8.
+ * For efficiency, this assumes the input is valid utf-16.
+ */
+
+ function str2rstr_utf8(input) {
+ return unescape(encodeURI(input));
+ }
+
+ /*
+ * Encode a string as utf-16
+ */
+
+ function str2rstr_utf16le(input) {
+ var output = "";
+ for (var i = 0; i < input.length; i++)
+ output += String.fromCharCode(input.charCodeAt(i) & 0xFF, (input.charCodeAt(i) >>> 8) & 0xFF);
+ return output;
+ }
+
+ function str2rstr_utf16be(input) {
+ var output = "";
+ for (var i = 0; i < input.length; i++)
+ output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF, input.charCodeAt(i) & 0xFF);
+ return output;
+ }
+
+ /*
+ * Convert a raw string to an array of little-endian words
+ * Characters >255 have their high-byte silently ignored.
+ */
+
+ function rstr2binl(input) {
+ var output = Array(input.length >> 2);
+ for (var i = 0; i < output.length; i++)
+ output[i] = 0;
+ for (var i = 0; i < input.length * 8; i += 8)
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
+ return output;
+ }
+
+ /*
+ * Convert an array of little-endian words to a string
+ */
+
+ function binl2rstr(input) {
+ var output = "";
+ for (var i = 0; i < input.length * 32; i += 8)
+ output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
+ return output;
+ }
+
+ /*
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
+ */
+
+ function binl_md5(x, len) { /* append padding */
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for (var i = 0; i < x.length; i += 16) {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+
+ a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
+ d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
+ d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
+ d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
+ d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
+
+ a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
+ d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
+ c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
+ d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
+ c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
+ d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
+ c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
+ d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
+ c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
+
+ a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
+ d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
+ d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
+ d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
+ d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
+
+ a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
+ d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
+ d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
+ d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
+ d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return Array(a, b, c, d);
+ }
+
+ /*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+
+ function md5_cmn(q, a, b, x, s, t) {
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
+ }
+
+ function md5_ff(a, b, c, d, x, s, t) {
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+ }
+
+ function md5_gg(a, b, c, d, x, s, t) {
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+ }
+
+ function md5_hh(a, b, c, d, x, s, t) {
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+ }
+
+ function md5_ii(a, b, c, d, x, s, t) {
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+ }
+
+ /*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+
+ function safe_add(x, y) {
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+ }
+
+ /*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+
+ function bit_rol(num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt));
+ }
+
+ return hex_md5;
+})();
diff --git a/http/3rdParty/yaMD5/test/lib/satazor-md5.js b/http/3rdParty/yaMD5/test/lib/satazor-md5.js
new file mode 100644
index 0000000..db606b3
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/satazor-md5.js
@@ -0,0 +1,600 @@
+// https://raw.githubusercontent.com/satazor/SparkMD5/master/spark-md5.js
+/*jshint bitwise:false*/
+/*global unescape*/
+
+(function (factory) {
+ if (typeof exports === 'object') {
+ // Node/CommonJS
+ module.exports = factory();
+ } else if (typeof define === 'function' && define.amd) {
+ // AMD
+ define(factory);
+ } else {
+ // Browser globals (with support for web workers)
+ var glob;
+ try {
+ glob = window;
+ } catch (e) {
+ glob = self;
+ }
+
+ glob.SparkMD5 = factory();
+ }
+}(function (undefined) {
+
+ 'use strict';
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ /*
+ * Fastest md5 implementation around (JKM md5)
+ * Credits: Joseph Myers
+ *
+ * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
+ * @see http://jsperf.com/md5-shootout/7
+ */
+
+ /* this function is much faster,
+ so if possible we use it. Some IEs
+ are the only ones I know of that
+ need the idiotic second function,
+ generated by an if clause. */
+ var add32 = function (a, b) {
+ return (a + b) & 0xFFFFFFFF;
+ },
+
+ cmn = function (q, a, b, x, s, t) {
+ a = add32(add32(a, q), add32(x, t));
+ return add32((a << s) | (a >>> (32 - s)), b);
+ },
+
+ ff = function (a, b, c, d, x, s, t) {
+ return cmn((b & c) | ((~b) & d), a, b, x, s, t);
+ },
+
+ gg = function (a, b, c, d, x, s, t) {
+ return cmn((b & d) | (c & (~d)), a, b, x, s, t);
+ },
+
+ hh = function (a, b, c, d, x, s, t) {
+ return cmn(b ^ c ^ d, a, b, x, s, t);
+ },
+
+ ii = function (a, b, c, d, x, s, t) {
+ return cmn(c ^ (b | (~d)), a, b, x, s, t);
+ },
+
+ md5cycle = function (x, k) {
+ var a = x[0],
+ b = x[1],
+ c = x[2],
+ d = x[3];
+
+ a = ff(a, b, c, d, k[0], 7, -680876936);
+ d = ff(d, a, b, c, k[1], 12, -389564586);
+ c = ff(c, d, a, b, k[2], 17, 606105819);
+ b = ff(b, c, d, a, k[3], 22, -1044525330);
+ a = ff(a, b, c, d, k[4], 7, -176418897);
+ d = ff(d, a, b, c, k[5], 12, 1200080426);
+ c = ff(c, d, a, b, k[6], 17, -1473231341);
+ b = ff(b, c, d, a, k[7], 22, -45705983);
+ a = ff(a, b, c, d, k[8], 7, 1770035416);
+ d = ff(d, a, b, c, k[9], 12, -1958414417);
+ c = ff(c, d, a, b, k[10], 17, -42063);
+ b = ff(b, c, d, a, k[11], 22, -1990404162);
+ a = ff(a, b, c, d, k[12], 7, 1804603682);
+ d = ff(d, a, b, c, k[13], 12, -40341101);
+ c = ff(c, d, a, b, k[14], 17, -1502002290);
+ b = ff(b, c, d, a, k[15], 22, 1236535329);
+
+ a = gg(a, b, c, d, k[1], 5, -165796510);
+ d = gg(d, a, b, c, k[6], 9, -1069501632);
+ c = gg(c, d, a, b, k[11], 14, 643717713);
+ b = gg(b, c, d, a, k[0], 20, -373897302);
+ a = gg(a, b, c, d, k[5], 5, -701558691);
+ d = gg(d, a, b, c, k[10], 9, 38016083);
+ c = gg(c, d, a, b, k[15], 14, -660478335);
+ b = gg(b, c, d, a, k[4], 20, -405537848);
+ a = gg(a, b, c, d, k[9], 5, 568446438);
+ d = gg(d, a, b, c, k[14], 9, -1019803690);
+ c = gg(c, d, a, b, k[3], 14, -187363961);
+ b = gg(b, c, d, a, k[8], 20, 1163531501);
+ a = gg(a, b, c, d, k[13], 5, -1444681467);
+ d = gg(d, a, b, c, k[2], 9, -51403784);
+ c = gg(c, d, a, b, k[7], 14, 1735328473);
+ b = gg(b, c, d, a, k[12], 20, -1926607734);
+
+ a = hh(a, b, c, d, k[5], 4, -378558);
+ d = hh(d, a, b, c, k[8], 11, -2022574463);
+ c = hh(c, d, a, b, k[11], 16, 1839030562);
+ b = hh(b, c, d, a, k[14], 23, -35309556);
+ a = hh(a, b, c, d, k[1], 4, -1530992060);
+ d = hh(d, a, b, c, k[4], 11, 1272893353);
+ c = hh(c, d, a, b, k[7], 16, -155497632);
+ b = hh(b, c, d, a, k[10], 23, -1094730640);
+ a = hh(a, b, c, d, k[13], 4, 681279174);
+ d = hh(d, a, b, c, k[0], 11, -358537222);
+ c = hh(c, d, a, b, k[3], 16, -722521979);
+ b = hh(b, c, d, a, k[6], 23, 76029189);
+ a = hh(a, b, c, d, k[9], 4, -640364487);
+ d = hh(d, a, b, c, k[12], 11, -421815835);
+ c = hh(c, d, a, b, k[15], 16, 530742520);
+ b = hh(b, c, d, a, k[2], 23, -995338651);
+
+ a = ii(a, b, c, d, k[0], 6, -198630844);
+ d = ii(d, a, b, c, k[7], 10, 1126891415);
+ c = ii(c, d, a, b, k[14], 15, -1416354905);
+ b = ii(b, c, d, a, k[5], 21, -57434055);
+ a = ii(a, b, c, d, k[12], 6, 1700485571);
+ d = ii(d, a, b, c, k[3], 10, -1894986606);
+ c = ii(c, d, a, b, k[10], 15, -1051523);
+ b = ii(b, c, d, a, k[1], 21, -2054922799);
+ a = ii(a, b, c, d, k[8], 6, 1873313359);
+ d = ii(d, a, b, c, k[15], 10, -30611744);
+ c = ii(c, d, a, b, k[6], 15, -1560198380);
+ b = ii(b, c, d, a, k[13], 21, 1309151649);
+ a = ii(a, b, c, d, k[4], 6, -145523070);
+ d = ii(d, a, b, c, k[11], 10, -1120210379);
+ c = ii(c, d, a, b, k[2], 15, 718787259);
+ b = ii(b, c, d, a, k[9], 21, -343485551);
+
+ x[0] = add32(a, x[0]);
+ x[1] = add32(b, x[1]);
+ x[2] = add32(c, x[2]);
+ x[3] = add32(d, x[3]);
+ },
+
+ /* there needs to be support for Unicode here,
+ * unless we pretend that we can redefine the MD-5
+ * algorithm for multi-byte characters (perhaps
+ * by adding every four 16-bit characters and
+ * shortening the sum to 32 bits). Otherwise
+ * I suggest performing MD-5 as if every character
+ * was two bytes--e.g., 0040 0025 = @%--but then
+ * how will an ordinary MD-5 sum be matched?
+ * There is no way to standardize text to something
+ * like UTF-8 before transformation; speed cost is
+ * utterly prohibitive. The JavaScript standard
+ * itself needs to look at this: it should start
+ * providing access to strings as preformed UTF-8
+ * 8-bit unsigned value arrays.
+ */
+ md5blk = function (s) {
+ var md5blks = [],
+ i; /* Andy King said do it this way. */
+
+ for (i = 0; i < 64; i += 4) {
+ md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
+ }
+ return md5blks;
+ },
+
+ md5blk_array = function (a) {
+ var md5blks = [],
+ i; /* Andy King said do it this way. */
+
+ for (i = 0; i < 64; i += 4) {
+ md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
+ }
+ return md5blks;
+ },
+
+ md51 = function (s) {
+ var n = s.length,
+ state = [1732584193, -271733879, -1732584194, 271733878],
+ i,
+ length,
+ tail,
+ tmp,
+ lo,
+ hi;
+
+ for (i = 64; i <= n; i += 64) {
+ md5cycle(state, md5blk(s.substring(i - 64, i)));
+ }
+ s = s.substring(i - 64);
+ length = s.length;
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ for (i = 0; i < length; i += 1) {
+ tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);
+ }
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
+ if (i > 55) {
+ md5cycle(state, tail);
+ for (i = 0; i < 16; i += 1) {
+ tail[i] = 0;
+ }
+ }
+
+ // Beware that the final length might not fit in 32 bits so we take care of that
+ tmp = n * 8;
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
+ lo = parseInt(tmp[2], 16);
+ hi = parseInt(tmp[1], 16) || 0;
+
+ tail[14] = lo;
+ tail[15] = hi;
+
+ md5cycle(state, tail);
+ return state;
+ },
+
+ md51_array = function (a) {
+ var n = a.length,
+ state = [1732584193, -271733879, -1732584194, 271733878],
+ i,
+ length,
+ tail,
+ tmp,
+ lo,
+ hi;
+
+ for (i = 64; i <= n; i += 64) {
+ md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
+ }
+
+ // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
+ // containing the last element of the parent array if the sub array specified starts
+ // beyond the length of the parent array - weird.
+ // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
+ a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);
+
+ length = a.length;
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ for (i = 0; i < length; i += 1) {
+ tail[i >> 2] |= a[i] << ((i % 4) << 3);
+ }
+
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
+ if (i > 55) {
+ md5cycle(state, tail);
+ for (i = 0; i < 16; i += 1) {
+ tail[i] = 0;
+ }
+ }
+
+ // Beware that the final length might not fit in 32 bits so we take care of that
+ tmp = n * 8;
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
+ lo = parseInt(tmp[2], 16);
+ hi = parseInt(tmp[1], 16) || 0;
+
+ tail[14] = lo;
+ tail[15] = hi;
+
+ md5cycle(state, tail);
+
+ return state;
+ },
+
+ hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'],
+
+ rhex = function (n) {
+ var s = '',
+ j;
+ for (j = 0; j < 4; j += 1) {
+ s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];
+ }
+ return s;
+ },
+
+ hex = function (x) {
+ var i;
+ for (i = 0; i < x.length; i += 1) {
+ x[i] = rhex(x[i]);
+ }
+ return x.join('');
+ },
+
+ md5 = function (s) {
+ return hex(md51(s));
+ },
+
+
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * SparkMD5 OOP implementation.
+ *
+ * Use this class to perform an incremental md5, otherwise use the
+ * static methods instead.
+ */
+ SparkMD5 = function () {
+ // call reset to init the instance
+ this.reset();
+ };
+
+
+ // In some cases the fast add32 function cannot be used..
+ if (md5('hello') !== '5d41402abc4b2a76b9719d911017c592') {
+ add32 = function (x, y) {
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF),
+ msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+ };
+ }
+
+
+ /**
+ * Appends a string.
+ * A conversion will be applied if an utf8 string is detected.
+ *
+ * @param {String} str The string to be appended
+ *
+ * @return {SparkMD5} The instance itself
+ */
+ SparkMD5.prototype.append = function (str) {
+ // converts the string to utf8 bytes if necessary
+ if (/[\u0080-\uFFFF]/.test(str)) {
+ str = unescape(encodeURIComponent(str));
+ }
+
+ // then append as binary
+ this.appendBinary(str);
+
+ return this;
+ };
+
+ /**
+ * Appends a binary string.
+ *
+ * @param {String} contents The binary string to be appended
+ *
+ * @return {SparkMD5} The instance itself
+ */
+ SparkMD5.prototype.appendBinary = function (contents) {
+ this._buff += contents;
+ this._length += contents.length;
+
+ var length = this._buff.length,
+ i;
+
+ for (i = 64; i <= length; i += 64) {
+ md5cycle(this._state, md5blk(this._buff.substring(i - 64, i)));
+ }
+
+ this._buff = this._buff.substr(i - 64);
+
+ return this;
+ };
+
+ /**
+ * Finishes the incremental computation, reseting the internal state and
+ * returning the result.
+ * Use the raw parameter to obtain the raw result instead of the hex one.
+ *
+ * @param {Boolean} raw True to get the raw result, false to get the hex result
+ *
+ * @return {String|Array} The result
+ */
+ SparkMD5.prototype.end = function (raw) {
+ var buff = this._buff,
+ length = buff.length,
+ i,
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ret;
+
+ for (i = 0; i < length; i += 1) {
+ tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);
+ }
+
+ this._finish(tail, length);
+ ret = !!raw ? this._state : hex(this._state);
+
+ this.reset();
+
+ return ret;
+ };
+
+ /**
+ * Finish the final calculation based on the tail.
+ *
+ * @param {Array} tail The tail (will be modified)
+ * @param {Number} length The length of the remaining buffer
+ */
+ SparkMD5.prototype._finish = function (tail, length) {
+ var i = length,
+ tmp,
+ lo,
+ hi;
+
+ tail[i >> 2] |= 0x80 << ((i % 4) << 3);
+ if (i > 55) {
+ md5cycle(this._state, tail);
+ for (i = 0; i < 16; i += 1) {
+ tail[i] = 0;
+ }
+ }
+
+ // Do the final computation based on the tail and length
+ // Beware that the final length may not fit in 32 bits so we take care of that
+ tmp = this._length * 8;
+ tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
+ lo = parseInt(tmp[2], 16);
+ hi = parseInt(tmp[1], 16) || 0;
+
+ tail[14] = lo;
+ tail[15] = hi;
+ md5cycle(this._state, tail);
+ };
+
+ /**
+ * Resets the internal state of the computation.
+ *
+ * @return {SparkMD5} The instance itself
+ */
+ SparkMD5.prototype.reset = function () {
+ this._buff = "";
+ this._length = 0;
+ this._state = [1732584193, -271733879, -1732584194, 271733878];
+
+ return this;
+ };
+
+ /**
+ * Releases memory used by the incremental buffer and other aditional
+ * resources. If you plan to use the instance again, use reset instead.
+ */
+ SparkMD5.prototype.destroy = function () {
+ delete this._state;
+ delete this._buff;
+ delete this._length;
+ };
+
+
+ /**
+ * Performs the md5 hash on a string.
+ * A conversion will be applied if utf8 string is detected.
+ *
+ * @param {String} str The string
+ * @param {Boolean} raw True to get the raw result, false to get the hex result
+ *
+ * @return {String|Array} The result
+ */
+ SparkMD5.hash = function (str, raw) {
+ // converts the string to utf8 bytes if necessary
+ if (/[\u0080-\uFFFF]/.test(str)) {
+ str = unescape(encodeURIComponent(str));
+ }
+
+ var hash = md51(str);
+
+ return !!raw ? hash : hex(hash);
+ };
+
+ /**
+ * Performs the md5 hash on a binary string.
+ *
+ * @param {String} content The binary string
+ * @param {Boolean} raw True to get the raw result, false to get the hex result
+ *
+ * @return {String|Array} The result
+ */
+ SparkMD5.hashBinary = function (content, raw) {
+ var hash = md51(content);
+
+ return !!raw ? hash : hex(hash);
+ };
+
+ /**
+ * SparkMD5 OOP implementation for array buffers.
+ *
+ * Use this class to perform an incremental md5 ONLY for array buffers.
+ */
+ SparkMD5.ArrayBuffer = function () {
+ // call reset to init the instance
+ this.reset();
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Appends an array buffer.
+ *
+ * @param {ArrayBuffer} arr The array to be appended
+ *
+ * @return {SparkMD5.ArrayBuffer} The instance itself
+ */
+ SparkMD5.ArrayBuffer.prototype.append = function (arr) {
+ // TODO: we could avoid the concatenation here but the algorithm would be more complex
+ // if you find yourself needing extra performance, please make a PR.
+ var buff = this._concatArrayBuffer(this._buff, arr),
+ length = buff.length,
+ i;
+
+ this._length += arr.byteLength;
+
+ for (i = 64; i <= length; i += 64) {
+ md5cycle(this._state, md5blk_array(buff.subarray(i - 64, i)));
+ }
+
+ // Avoids IE10 weirdness (documented above)
+ this._buff = (i - 64) < length ? buff.subarray(i - 64) : new Uint8Array(0);
+
+ return this;
+ };
+
+ /**
+ * Finishes the incremental computation, reseting the internal state and
+ * returning the result.
+ * Use the raw parameter to obtain the raw result instead of the hex one.
+ *
+ * @param {Boolean} raw True to get the raw result, false to get the hex result
+ *
+ * @return {String|Array} The result
+ */
+ SparkMD5.ArrayBuffer.prototype.end = function (raw) {
+ var buff = this._buff,
+ length = buff.length,
+ tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ i,
+ ret;
+
+ for (i = 0; i < length; i += 1) {
+ tail[i >> 2] |= buff[i] << ((i % 4) << 3);
+ }
+
+ this._finish(tail, length);
+ ret = !!raw ? this._state : hex(this._state);
+
+ this.reset();
+
+ return ret;
+ };
+
+ SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
+
+ /**
+ * Resets the internal state of the computation.
+ *
+ * @return {SparkMD5.ArrayBuffer} The instance itself
+ */
+ SparkMD5.ArrayBuffer.prototype.reset = function () {
+ this._buff = new Uint8Array(0);
+ this._length = 0;
+ this._state = [1732584193, -271733879, -1732584194, 271733878];
+
+ return this;
+ };
+
+ /**
+ * Releases memory used by the incremental buffer and other aditional
+ * resources. If you plan to use the instance again, use reset instead.
+ */
+ SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
+
+ /**
+ * Concats two array buffers, returning a new one.
+ *
+ * @param {ArrayBuffer} first The first array buffer
+ * @param {ArrayBuffer} second The second array buffer
+ *
+ * @return {ArrayBuffer} The new array buffer
+ */
+ SparkMD5.ArrayBuffer.prototype._concatArrayBuffer = function (first, second) {
+ var firstLength = first.length,
+ result = new Uint8Array(firstLength + second.byteLength);
+
+ result.set(first);
+ result.set(new Uint8Array(second), firstLength);
+
+ return result;
+ };
+
+ /**
+ * Performs the md5 hash on an array buffer.
+ *
+ * @param {ArrayBuffer} arr The array buffer
+ * @param {Boolean} raw True to get the raw result, false to get the hex result
+ *
+ * @return {String|Array} The result
+ */
+ SparkMD5.ArrayBuffer.hash = function (arr, raw) {
+ var hash = md51_array(new Uint8Array(arr));
+
+ return !!raw ? hash : hex(hash);
+ };
+
+ return SparkMD5;
+}));
diff --git a/http/3rdParty/yaMD5/test/lib/valums-md5.js b/http/3rdParty/yaMD5/test/lib/valums-md5.js
new file mode 100644
index 0000000..865d626
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/lib/valums-md5.js
@@ -0,0 +1,218 @@
+/**
+* Namespace for hashing and other cryptographic functions
+* Copyright (c) Andrew Valums
+* Licensed under the MIT license, http://valums.com/mit-license/
+*/
+
+var V = V || {};
+V.Security = V.Security || {};
+
+(function() {
+ // for faster access
+ var S = V.Security;
+
+ /**
+ * The highest integer value a number can go to without losing precision.
+ */
+ S.maxExactInt = Math.pow(2, 53);
+
+ /**
+ * Converts string from internal UTF-16 to UTF-8
+ * and saves it using array of numbers (bytes), 0-255 per cell
+ * @param {String} str
+ * @return {Array}
+ */
+ S.toUtf8ByteArr = function(str) {
+ var arr = [],
+ code;
+
+ for (var i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+
+ /*
+ Note that charCodeAt will always return a value that is less than 65,536.
+ This is because the higher code points are represented by a pair of (lower valued)
+ "surrogate" pseudo-characters which are used to comprise the real character.
+ Because of this, in order to examine or reproduce the full character for
+ individual characters of value 65,536 and above, for such characters,
+ it is necessary to retrieve not only charCodeAt(0), but also charCodeAt(1).
+ */
+ if (0xD800 <= code && code <= 0xDBFF) {
+ // UTF-16 high surrogate
+ var hi = code,
+ low = str.charCodeAt(i + 1);
+
+ code = ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;
+
+ i++;
+ }
+
+ if (code <= 127) {
+ arr[arr.length] = code;
+ } else if (code <= 2047) {
+ arr[arr.length] = (code >>> 6) + 0xC0;
+ arr[arr.length] = code & 0x3F | 0x80;
+ } else if (code <= 65535) {
+ arr[arr.length] = (code >>> 12) + 0xE0;
+ arr[arr.length] = (code >>> 6 & 0x3F) | 0x80;
+ arr[arr.length] = (code & 0x3F) | 0x80;
+ } else if (code <= 1114111) {
+ arr[arr.length] = (code >>> 18) + 0xF0;
+ arr[arr.length] = (code >>> 12 & 0x3F) | 0x80;
+ arr[arr.length] = (code >>> 6 & 0x3F) | 0x80;
+ arr[arr.length] = (code & 0x3F) | 0x80;
+ } else {
+ throw 'Unicode standart supports code points up-to U+10FFFF';
+ }
+ }
+
+ return arr;
+ };
+
+ /**
+ * Outputs 32 integer bits of a number in hex format.
+ * Preserves leading zeros.
+ * @param {Number} num
+ */
+ S.toHex32 = function(num) {
+ // if negative
+ if (num & 0x80000000) {
+ // convert to positive number
+ num = num & (~0x80000000);
+ num += Math.pow(2, 31);
+ }
+
+ var str = num.toString(16);
+
+ while (str.length < 8) {
+ str = '0' + str;
+ }
+
+ return str;
+ };
+
+ /**
+ * Changes the order of 4 bytes in integer representation of number.
+ * From 1234 to 4321.
+ * @param {Number} num Only 32 int bits are used.
+ */
+ S.reverseBytes = function(num) {
+ var res = 0;
+ res += ((num >>> 24) & 0xff);
+ res += ((num >>> 16) & 0xff) << 8;
+ res += ((num >>> 8) & 0xff) << 16;
+ res += (num & 0xff) << 24;
+ return res;
+ };
+
+ S.leftRotate = function(x, c) {
+ return (x << c) | (x >>> (32 - c));
+ };
+
+ /**
+ * RSA Data Security, Inc. MD5 Message-Digest Algorithm
+ * http://tools.ietf.org/html/rfc1321
+ * http://en.wikipedia.org/wiki/MD5
+ * @param {String} message
+ */
+ S.md5 = function(message) {
+ // r specifies the per-round shift amounts
+ var r = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21];
+
+ // Use binary integer part of the sines of integers (Radians) as constants:
+ var k = [];
+ for (var i = 0; i <= 63; i++) {
+ k[i] = (Math.abs(Math.sin(i + 1)) * Math.pow(2, 32)) << 0;
+ }
+
+ var h0 = 0x67452301,
+ h1 = 0xEFCDAB89,
+ h2 = 0x98BADCFE,
+ h3 = 0x10325476,
+ bytes, unpadded;
+
+ //Pre-processing:
+ bytes = S.toUtf8ByteArr(message);
+ message = null;
+ unpadded = bytes.length;
+
+ //append "1" bit to message
+ //append "0" bits until message length in bits ≡ 448 (mod 512)
+ bytes.push(0x80);
+ var zeroBytes = Math.abs(448 - (bytes.length * 8) % 512) / 8;
+
+ while (zeroBytes--) {
+ bytes.push(0);
+ }
+
+ //append bit length of unpadded message as 64-bit little-endian integer to message
+ bytes.push(unpadded * 8 & 0xff, unpadded * 8 >> 8 & 0xff, unpadded * 8 >> 16 & 0xff, unpadded * 8 >> 24 & 0xff);
+
+ var i = 4;
+ while (i--) {
+ bytes.push(0);
+ }
+
+ var leftRotate = S.leftRotate;
+
+ //Process the message in successive 512-bit chunks:
+ var i = 0,
+ w = [];
+ while (i < bytes.length) {
+
+ //break chunk into sixteen 32-bit words w[i], 0 ≤ i ≤ 15
+ for (var j = 0; j <= 15; j++) {
+ w[j] = (bytes[i + 4 * j] << 0) + (bytes[i + 4 * j + 1] << 8) + (bytes[i + 4 * j + 2] << 16) + (bytes[i + 4 * j + 3] << 24);
+ }
+
+ //Initialize hash value for this chunk:
+ var a = h0,
+ b = h1,
+ c = h2,
+ d = h3,
+ f, g;
+
+ //Main loop:
+ for (var j = 0; j <= 63; j++) {
+
+ if (j <= 15) {
+ f = (b & c) | ((~b) & d);
+ g = j;
+ } else if (j <= 31) {
+ f = (d & b) | ((~d) & c);
+ g = (5 * j + 1) % 16;
+ } else if (j <= 47) {
+ f = b ^ c ^ d;
+ g = (3 * j + 5) % 16;
+ } else {
+ f = c ^ (b | (~d));
+ g = (7 * j) % 16;
+ }
+
+ var temp = d;
+
+ d = c;
+ c = b;
+ b = b + leftRotate((a + f + k[j] + w[g]), r[j]);
+ a = temp;
+ }
+
+ //Add this chunk's hash to result so far:
+ h0 = (h0 + a) << 0;
+ h1 = (h1 + b) << 0;
+ h2 = (h2 + c) << 0;
+ h3 = (h3 + d) << 0;
+
+ i += 512 / 8;
+ }
+
+ // fix when starting with 0
+ var res = out(h0) + out(h1) + out(h2) + out(h3);
+
+ function out(h) {
+ return S.toHex32(S.reverseBytes(h));
+ }
+
+ return res;
+ };
+})();
diff --git a/http/3rdParty/yaMD5/test/test.html b/http/3rdParty/yaMD5/test/test.html
new file mode 100644
index 0000000..ce2659f
--- /dev/null
+++ b/http/3rdParty/yaMD5/test/test.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+body {
+ font: 13px mono;
+ }
+.good {
+ color: green;
+ }
+.bad {
+ color: red;
+ }
+</style>
+</head>
+<body>
+<script>
+var test = function(md5Name, md5Func) {
+ // Add tests here
+ // A test is a pair of strings: hash then data
+ var tests = [
+
+ // from Appendix 5 of http://www.ietf.org/rfc/rfc1321.txt
+ 'd41d8cd98f00b204e9800998ecf8427e', '',
+ '0cc175b9c0f1b6a831c399e269772661', 'a',
+ '900150983cd24fb0d6963f7d28e17f72', 'abc',
+ 'f96b697d7cb7938d525a2f31aaf161d0', 'message digest',
+ 'c3fcd3d76192e4007dfb496cca67e13b', 'abcdefghijklmnopqrstuvwxyz',
+ 'd174ab98d277d9f5a5611c2c9f419d9f', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
+ '57edf4a22be3c955ac49da2e2107b67a', '12345678901234567890123456789012345678901234567890123456789012345678901234567890',
+
+ // Unicode strings taken from http://en.wikipedia.org/wiki/List_of_pangrams
+ // Then I ran them through md5sum
+ 'b69cf1b7b6888f1f8928e2e2b74da8bc', 'Voix ambiguë d\'un cœur qui au zéphyr préfère les jattes de kiwis',
+ 'd1ea7e7792c50a0386b1064ab220da0c', 'Жълтата дюля беше щастлива, че пухът, който цъфна, замръзна като гьон',
+ 'b6071a4fc17e44a7d0246e5b4c939a70', 'Hyvän lorun sangen pieneksi hyödyksi jäi suomen kirjaimet',
+ '47ee7efa5573066d43ab5f9ae1830cf8', 'Ταχίστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός',
+ '7e626d44cd9610f2fef198156730e7d9', '色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず',
+ 'ae5f9c6b87f4e50e68eb20c10e21733a', 'นายสังฆภัณฑ์ เฮงพิทักษ์ฝั่ง ผู้เฒ่าซึ่งมีอาชีพเป็นฅนขายฃวด ถูกตำรวจปฏิบัติการจับฟ้องศาล ฐานลักนาฬิกาคุณหญิงฉัตรชฎา ฌานสมาธิ'
+ ];
+ var templateSuccess = '<span class="good">Success: "{{hash}}" === md5("{{data}}")</span><br>';
+ var templateFailure = '<span class="bad">Failure: "{{hash}}" !== md5("{{data}}")</span><br>';
+
+ document.write('<h1>'+ md5Name + '</h1>');
+
+ var hash, data, template, output;
+ for ( var i = 0; i < tests.length; i += 2 ) {
+ hash = tests[i+0];
+ data = tests[i+1];
+ if ( md5Func(data) === hash ) {
+ template = templateSuccess;
+ } else {
+ template = templateFailure;
+ }
+ document.write(template.replace('{{data}}', data).replace('{{hash}}', hash));
+ }
+};
+
+var module = module || {};
+</script>
+
+<script src="../yamd5.js"></script>
+<script>test('github.com/gorhill/yamd5.js', YaMD5.hashStr);</script>
+<p>Project home: <a href="https://github.com/gorhill/yamd5.js">https://github.com/gorhill/yamd5.js</a></p>
+
+<script src="./lib/satazor-md5.js"></script>
+<script>test('github.com/satazor/SparkMD5', SparkMD5.hash);</script>
+<p>Project home: <a href="https://github.com/satazor/SparkMD5">https://github.com/satazor/SparkMD5</a></p>
+
+<script src="./lib/paj-md5.js"></script>
+<script>test('Paul Johnston', pajMD5);</script>
+<p>Project home: <a href="http://pajhome.org.uk/crypt/md5/md5.html">http://pajhome.org.uk/crypt/md5/md5.html</a></p>
+
+<script src="./lib/jbt-md5.js"></script>
+<script>test('github.com/jbt/js-crypto', md5);</script>
+<p>Project home: <a href="https://github.com/jbt/js-crypto">https://github.com/jbt/js-crypto</a></p>
+
+<script src="./lib/izumo-md5.js"></script>
+<script>test('Masanao Izumo', izumoMD5);</script>
+<p>Project home: <a href="http://www.onicos.com/staff/iz/amuse/javascript/expert/md5.txt">http://www.onicos.com/staff/iz/amuse/javascript/expert/md5.txt</a></p>
+
+<script src="./lib/jkm-md5.js"></script>
+<script>test('Joseph Myers', jkmMD5);</script>
+<p>Project home: <a href="http://www.myersdaily.org/joseph/javascript/md5-text.html">http://www.myersdaily.org/joseph/javascript/md5-text.html</a></p>
+
+<script src="https://rawgit.com/trentmillar/md5-o-matic/master/lib/md5omatic.js"></script>
+<script>test('github.com/trentmillar/md5-o-matic', module.exports);</script>
+<p>Project home: <a href="https://github.com/trentmillar/md5-o-matic">https://github.com/trentmillar/md5-o-matic</a></p>
+
+<script src="./lib/ireal-md5.js"></script>
+<script>test('github.com/iReal/FastMD5', function(s) { return md5(s, true); });</script>
+<p>Project home: <a href="https://github.com/iReal/FastMD5">https://github.com/iReal/FastMD5</a></p>
+
+<script src="./lib/valums-md5.js"></script>
+<script>test('valums', V.Security.md5);</script>
+<p>Code taken from: <a href="http://jsperf.com/md5-shootout/48">http://jsperf.com/md5-shootout/48</a></p>
+
+</body>
+</html>
diff --git a/http/3rdParty/yaMD5/yamd5.js b/http/3rdParty/yaMD5/yamd5.js
new file mode 100644
index 0000000..582b576
--- /dev/null
+++ b/http/3rdParty/yaMD5/yamd5.js
@@ -0,0 +1,402 @@
+/*******************************************************************************
+
+YaMD5 - Yet another MD5 hasher.
+home: https://github.com/gorhill/yamd5.js
+
+I needed an MD5 hasher, and as usual I want small code base, and fast.
+
+Originally found md5-o-matic [1]. It was fast but did not work with Unicode
+strings. Also, eventually realized it was really based on code from
+Joseph Myers [2] with no proper credits given (not nice).
+
+Then I found SparkMD5 [3], which works with Unicode strings, but at a steep
+cost to performance. Also, glancing at the code I saw avoidable redundancies
+causing the code base to be much larger than needed.
+
+So from this point I set out to write my own version, YaMD5 (sorry, I am
+not good with naming projects), of course heavily relying on the original
+code from Joseph Myers [2], and bits from SparkMD5 -- I started to work from
+SparkMD5 implementation, so there might be bits of code original to SparkMD5
+code left in a few places (like say, MD5.end()).
+
+Advantages of YaMD5:
+
+- Can handle Unicode strings
+- Natively incremental
+- Small code base
+- Fastest MD5 hasher out there so far for large input [4]
+- Even faster than versions supporting only simpler ascii strings
+
+
+ [1] https://github.com/trentmillar/md5-o-matic
+ [2] http://www.myersdaily.org/joseph/javascript/md5-text.html
+ [3] https://github.com/satazor/SparkMD5
+ [4] http://jsperf.com/md5-shootout/75
+
+So with that said, I don't know what license covers Joseph Myers' code (need
+to find out). In any case, concerning whatever original code I contributed in
+there:
+
+The MIT License (MIT)
+
+Copyright (C) 2014 Raymond Hill
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+**/
+
+/* jshint bitwise: false */
+
+(function(root) {
+
+ 'use strict';
+
+ /*
+ * Fastest md5 implementation around (JKM md5)
+ * Credits: Joseph Myers
+ *
+ * @see http://www.myersdaily.org/joseph/javascript/md5-text.html
+ * @see http://jsperf.com/md5-shootout/7
+ */
+
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
+
+ var md5cycle = function(x, k) {
+ var a = x[0],
+ b = x[1],
+ c = x[2],
+ d = x[3];
+ // ff()
+ a += (b & c | ~b & d) + k[0] - 680876936 | 0;
+ a = (a << 7 | a >>> 25) + b | 0;
+ d += (a & b | ~a & c) + k[1] - 389564586 | 0;
+ d = (d << 12 | d >>> 20) + a | 0;
+ c += (d & a | ~d & b) + k[2] + 606105819 | 0;
+ c = (c << 17 | c >>> 15) + d | 0;
+ b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
+ b = (b << 22 | b >>> 10) + c | 0;
+ a += (b & c | ~b & d) + k[4] - 176418897 | 0;
+ a = (a << 7 | a >>> 25) + b | 0;
+ d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
+ d = (d << 12 | d >>> 20) + a | 0;
+ c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
+ c = (c << 17 | c >>> 15) + d | 0;
+ b += (c & d | ~c & a) + k[7] - 45705983 | 0;
+ b = (b << 22 | b >>> 10) + c | 0;
+ a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
+ a = (a << 7 | a >>> 25) + b | 0;
+ d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
+ d = (d << 12 | d >>> 20) + a | 0;
+ c += (d & a | ~d & b) + k[10] - 42063 | 0;
+ c = (c << 17 | c >>> 15) + d | 0;
+ b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
+ b = (b << 22 | b >>> 10) + c | 0;
+ a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
+ a = (a << 7 | a >>> 25) + b | 0;
+ d += (a & b | ~a & c) + k[13] - 40341101 | 0;
+ d = (d << 12 | d >>> 20) + a | 0;
+ c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
+ c = (c << 17 | c >>> 15) + d | 0;
+ b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
+ b = (b << 22 | b >>> 10) + c | 0;
+ // gg()
+ a += (b & d | c & ~d) + k[1] - 165796510 | 0;
+ a = (a << 5 | a >>> 27) + b | 0;
+ d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
+ d = (d << 9 | d >>> 23) + a | 0;
+ c += (d & b | a & ~b) + k[11] + 643717713 | 0;
+ c = (c << 14 | c >>> 18) + d | 0;
+ b += (c & a | d & ~a) + k[0] - 373897302 | 0;
+ b = (b << 20 | b >>> 12) + c | 0;
+ a += (b & d | c & ~d) + k[5] - 701558691 | 0;
+ a = (a << 5 | a >>> 27) + b | 0;
+ d += (a & c | b & ~c) + k[10] + 38016083 | 0;
+ d = (d << 9 | d >>> 23) + a | 0;
+ c += (d & b | a & ~b) + k[15] - 660478335 | 0;
+ c = (c << 14 | c >>> 18) + d | 0;
+ b += (c & a | d & ~a) + k[4] - 405537848 | 0;
+ b = (b << 20 | b >>> 12) + c | 0;
+ a += (b & d | c & ~d) + k[9] + 568446438 | 0;
+ a = (a << 5 | a >>> 27) + b | 0;
+ d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
+ d = (d << 9 | d >>> 23) + a | 0;
+ c += (d & b | a & ~b) + k[3] - 187363961 | 0;
+ c = (c << 14 | c >>> 18) + d | 0;
+ b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
+ b = (b << 20 | b >>> 12) + c | 0;
+ a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
+ a = (a << 5 | a >>> 27) + b | 0;
+ d += (a & c | b & ~c) + k[2] - 51403784 | 0;
+ d = (d << 9 | d >>> 23) + a | 0;
+ c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
+ c = (c << 14 | c >>> 18) + d | 0;
+ b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
+ b = (b << 20 | b >>> 12) + c | 0;
+ // hh()
+ a += (b ^ c ^ d) + k[5] - 378558 | 0;
+ a = (a << 4 | a >>> 28) + b | 0;
+ d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
+ d = (d << 11 | d >>> 21) + a | 0;
+ c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
+ c = (c << 16 | c >>> 16) + d | 0;
+ b += (c ^ d ^ a) + k[14] - 35309556 | 0;
+ b = (b << 23 | b >>> 9) + c | 0;
+ a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
+ a = (a << 4 | a >>> 28) + b | 0;
+ d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
+ d = (d << 11 | d >>> 21) + a | 0;
+ c += (d ^ a ^ b) + k[7] - 155497632 | 0;
+ c = (c << 16 | c >>> 16) + d | 0;
+ b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
+ b = (b << 23 | b >>> 9) + c | 0;
+ a += (b ^ c ^ d) + k[13] + 681279174 | 0;
+ a = (a << 4 | a >>> 28) + b | 0;
+ d += (a ^ b ^ c) + k[0] - 358537222 | 0;
+ d = (d << 11 | d >>> 21) + a | 0;
+ c += (d ^ a ^ b) + k[3] - 722521979 | 0;
+ c = (c << 16 | c >>> 16) + d | 0;
+ b += (c ^ d ^ a) + k[6] + 76029189 | 0;
+ b = (b << 23 | b >>> 9) + c | 0;
+ a += (b ^ c ^ d) + k[9] - 640364487 | 0;
+ a = (a << 4 | a >>> 28) + b | 0;
+ d += (a ^ b ^ c) + k[12] - 421815835 | 0;
+ d = (d << 11 | d >>> 21) + a | 0;
+ c += (d ^ a ^ b) + k[15] + 530742520 | 0;
+ c = (c << 16 | c >>> 16) + d | 0;
+ b += (c ^ d ^ a) + k[2] - 995338651 | 0;
+ b = (b << 23 | b >>> 9) + c | 0;
+ // ii()
+ a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
+ a = (a << 6 | a >>> 26) + b | 0;
+ d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
+ d = (d << 10 | d >>> 22) + a | 0;
+ c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
+ c = (c << 15 | c >>> 17) + d | 0;
+ b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
+ b = (b << 21 |b >>> 11) + c | 0;
+ a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
+ a = (a << 6 | a >>> 26) + b | 0;
+ d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
+ d = (d << 10 | d >>> 22) + a | 0;
+ c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
+ c = (c << 15 | c >>> 17) + d | 0;
+ b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
+ b = (b << 21 |b >>> 11) + c | 0;
+ a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
+ a = (a << 6 | a >>> 26) + b | 0;
+ d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
+ d = (d << 10 | d >>> 22) + a | 0;
+ c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
+ c = (c << 15 | c >>> 17) + d | 0;
+ b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
+ b = (b << 21 |b >>> 11) + c | 0;
+ a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
+ a = (a << 6 | a >>> 26) + b | 0;
+ d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
+ d = (d << 10 | d >>> 22) + a | 0;
+ c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
+ c = (c << 15 | c >>> 17) + d | 0;
+ b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
+ b = (b << 21 | b >>> 11) + c | 0;
+
+ x[0] = a + x[0] | 0;
+ x[1] = b + x[1] | 0;
+ x[2] = c + x[2] | 0;
+ x[3] = d + x[3] | 0;
+ };
+
+ var hexChars = '0123456789abcdef';
+ var hexOut = [];
+
+ var hex = function(x) {
+ var hc = hexChars;
+ var ho = hexOut;
+ var n, offset, j;
+ for (var i = 0; i < 4; i++) {
+ offset = i * 8;
+ n = x[i];
+ for ( j = 0; j < 8; j += 2 ) {
+ ho[offset+1+j] = hc.charAt(n & 0x0F);
+ n >>>= 4;
+ ho[offset+0+j] = hc.charAt(n & 0x0F);
+ n >>>= 4;
+ }
+ }
+ return ho.join('');
+ };
+
+ var MD5 = function() {
+ this._dataLength = 0;
+ this._state = new Int32Array(4);
+ this._buffer = new ArrayBuffer(68);
+ this._bufferLength = 0;
+ this._buffer8 = new Uint8Array(this._buffer, 0, 68);
+ this._buffer32 = new Uint32Array(this._buffer, 0, 17);
+ this.start();
+ };
+
+ var stateIdentity = new Int32Array([1732584193, -271733879, -1732584194, 271733878]);
+ var buffer32Identity = new Int32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+
+ // Char to code point to to array conversion:
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt#Example.3A_Fixing_charCodeAt_to_handle_non-Basic-Multilingual-Plane_characters_if_their_presence_earlier_in_the_string_is_unknown
+ MD5.prototype.appendStr = function(str) {
+ var buf8 = this._buffer8;
+ var buf32 = this._buffer32;
+ var bufLen = this._bufferLength;
+ var code;
+ for ( var i = 0; i < str.length; i++ ) {
+ code = str.charCodeAt(i);
+ if ( code < 128 ) {
+ buf8[bufLen++] = code;
+ } else if ( code < 0x800 ) {
+ buf8[bufLen++] = (code >>> 6) + 0xC0;
+ buf8[bufLen++] = code & 0x3F | 0x80;
+ } else if ( code < 0xD800 || code > 0xDBFF ) {
+ buf8[bufLen++] = (code >>> 12) + 0xE0;
+ buf8[bufLen++] = (code >>> 6 & 0x3F) | 0x80;
+ buf8[bufLen++] = (code & 0x3F) | 0x80;
+ } else {
+ code = ((code - 0xD800) * 0x400) + (str.charCodeAt(++i) - 0xDC00) + 0x10000;
+ if ( code > 0x10FFFF ) {
+ throw 'Unicode standard supports code points up to U+10FFFF';
+ }
+ buf8[bufLen++] = (code >>> 18) + 0xF0;
+ buf8[bufLen++] = (code >>> 12 & 0x3F) | 0x80;
+ buf8[bufLen++] = (code >>> 6 & 0x3F) | 0x80;
+ buf8[bufLen++] = (code & 0x3F) | 0x80;
+ }
+ if ( bufLen >= 64 ) {
+ this._dataLength += 64;
+ md5cycle(this._state, buf32);
+ bufLen -= 64;
+ buf32[0] = buf32[16];
+ }
+ }
+ this._bufferLength = bufLen;
+ return this;
+ };
+
+ MD5.prototype.appendAsciiStr = function(str) {
+ var buf8 = this._buffer8;
+ var buf32 = this._buffer32;
+ var bufLen = this._bufferLength;
+ var i, j = 0;
+ for (;;) {
+ i = Math.min(str.length-j, 64-bufLen);
+ while ( i-- ) {
+ buf8[bufLen++] = str.charCodeAt(j++);
+ }
+ if ( bufLen < 64 ) {
+ break;
+ }
+ this._dataLength += 64;
+ md5cycle(this._state, buf32);
+ bufLen = 0;
+ }
+ this._bufferLength = bufLen;
+ return this;
+ };
+
+ MD5.prototype.appendByteArray = function(input) {
+ var buf8 = this._buffer8;
+ var buf32 = this._buffer32;
+ var bufLen = this._bufferLength;
+ var i, j = 0;
+ for (;;) {
+ i = Math.min(input.length-j, 64-bufLen);
+ while ( i-- ) {
+ buf8[bufLen++] = input[j++];
+ }
+ if ( bufLen < 64 ) {
+ break;
+ }
+ this._dataLength += 64;
+ md5cycle(this._state, buf32);
+ bufLen = 0;
+ }
+ this._bufferLength = bufLen;
+ return this;
+ };
+
+ MD5.prototype.start = function() {
+ this._dataLength = 0;
+ this._bufferLength = 0;
+ this._state.set(stateIdentity);
+ return this;
+ };
+
+ MD5.prototype.end = function(raw) {
+ var bufLen = this._bufferLength;
+ this._dataLength += bufLen;
+ var buf8 = this._buffer8;
+ buf8[bufLen] = 0x80;
+ buf8[bufLen+1] = buf8[bufLen+2] = buf8[bufLen+3] = 0;
+ var buf32 = this._buffer32;
+ var i = (bufLen >> 2) + 1;
+ buf32.set(buffer32Identity.subarray(i), i);
+ if (bufLen > 55) {
+ md5cycle(this._state, buf32);
+ buf32.set(buffer32Identity);
+ }
+ // Do the final computation based on the tail and length
+ // Beware that the final length may not fit in 32 bits so we take care of that
+ var dataBitsLen = this._dataLength * 8;
+ if ( dataBitsLen <= 0xFFFFFFFF ) {
+ buf32[14] = dataBitsLen;
+ } else {
+ var matches = dataBitsLen.toString(16).match(/(.*?)(.{0,8})$/);
+ var lo = parseInt(matches[2], 16);
+ var hi = parseInt(matches[1], 16) || 0;
+ buf32[14] = lo;
+ buf32[15] = hi;
+ }
+ md5cycle(this._state, buf32);
+
+ return !!raw ? this._state : hex(this._state);
+ };
+
+ // This permanent instance is to use for one-call hashing
+ var onePassHasher = new MD5();
+
+ MD5.hashStr = function(str, raw) {
+ return onePassHasher
+ .start()
+ .appendStr(str)
+ .end(raw);
+ };
+
+ MD5.hashAsciiStr = function(str, raw) {
+ return onePassHasher
+ .start()
+ .appendAsciiStr(str)
+ .end(raw);
+ };
+
+ // Self-test
+ // In some cases the fast add32 function cannot be used..
+ if ( MD5.hashStr('hello') !== '5d41402abc4b2a76b9719d911017c592' ) {
+ console.error('YaMD5> this javascript engine does not support YaMD5. Sorry.');
+ }
+
+ if ( typeof root === 'object' ) {
+ root.YaMD5 = MD5;
+ }
+ return MD5;
+})(this);
diff --git a/http/3rdParty/yaMD5/yamd5.min.js b/http/3rdParty/yaMD5/yamd5.min.js
new file mode 100644
index 0000000..653d511
--- /dev/null
+++ b/http/3rdParty/yaMD5/yamd5.min.js
@@ -0,0 +1,46 @@
+// project home: https://github.com/gorhill/yamd5.js
+// minified using http://refresh-sf.com/yui/
+;(function(g){var b=function(l,n){var m=l[0],j=l[1],p=l[2],o=l[3];m+=(j&p|~j&o)+n[0]-680876936|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[1]-389564586|0;
+o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[2]+606105819|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[3]-1044525330|0;j=(j<<22|j>>>10)+p|0;
+m+=(j&p|~j&o)+n[4]-176418897|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[5]+1200080426|0;o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[6]-1473231341|0;
+p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[7]-45705983|0;j=(j<<22|j>>>10)+p|0;m+=(j&p|~j&o)+n[8]+1770035416|0;m=(m<<7|m>>>25)+j|0;
+o+=(m&j|~m&p)+n[9]-1958414417|0;o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[10]-42063|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[11]-1990404162|0;
+j=(j<<22|j>>>10)+p|0;m+=(j&p|~j&o)+n[12]+1804603682|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[13]-40341101|0;o=(o<<12|o>>>20)+m|0;
+p+=(o&m|~o&j)+n[14]-1502002290|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[15]+1236535329|0;j=(j<<22|j>>>10)+p|0;m+=(j&o|p&~o)+n[1]-165796510|0;
+m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[6]-1069501632|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[11]+643717713|0;p=(p<<14|p>>>18)+o|0;
+j+=(p&m|o&~m)+n[0]-373897302|0;j=(j<<20|j>>>12)+p|0;m+=(j&o|p&~o)+n[5]-701558691|0;m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[10]+38016083|0;
+o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[15]-660478335|0;p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[4]-405537848|0;j=(j<<20|j>>>12)+p|0;
+m+=(j&o|p&~o)+n[9]+568446438|0;m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[14]-1019803690|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[3]-187363961|0;
+p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[8]+1163531501|0;j=(j<<20|j>>>12)+p|0;m+=(j&o|p&~o)+n[13]-1444681467|0;m=(m<<5|m>>>27)+j|0;
+o+=(m&p|j&~p)+n[2]-51403784|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[7]+1735328473|0;p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[12]-1926607734|0;
+j=(j<<20|j>>>12)+p|0;m+=(j^p^o)+n[5]-378558|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[8]-2022574463|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[11]+1839030562|0;
+p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[14]-35309556|0;j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[1]-1530992060|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[4]+1272893353|0;
+o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[7]-155497632|0;p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[10]-1094730640|0;j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[13]+681279174|0;
+m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[0]-358537222|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[3]-722521979|0;p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[6]+76029189|0;
+j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[9]-640364487|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[12]-421815835|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[15]+530742520|0;
+p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[2]-995338651|0;j=(j<<23|j>>>9)+p|0;m+=(p^(j|~o))+n[0]-198630844|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[7]+1126891415|0;
+o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[14]-1416354905|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[5]-57434055|0;j=(j<<21|j>>>11)+p|0;
+m+=(p^(j|~o))+n[12]+1700485571|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[3]-1894986606|0;o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[10]-1051523|0;
+p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[1]-2054922799|0;j=(j<<21|j>>>11)+p|0;m+=(p^(j|~o))+n[8]+1873313359|0;m=(m<<6|m>>>26)+j|0;
+o+=(j^(m|~p))+n[15]-30611744|0;o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[6]-1560198380|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[13]+1309151649|0;
+j=(j<<21|j>>>11)+p|0;m+=(p^(j|~o))+n[4]-145523070|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[11]-1120210379|0;o=(o<<10|o>>>22)+m|0;
+p+=(m^(o|~j))+n[2]+718787259|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[9]-343485551|0;j=(j<<21|j>>>11)+p|0;l[0]=m+l[0]|0;l[1]=j+l[1]|0;
+l[2]=p+l[2]|0;l[3]=o+l[3]|0};var e="0123456789abcdef";var d=[];var c=function(k){var q=e;var o=d;var r,p,l;for(var m=0;m<4;
+m++){p=m*8;r=k[m];for(l=0;l<8;l+=2){o[p+1+l]=q.charAt(r&15);r>>>=4;o[p+0+l]=q.charAt(r&15);r>>>=4}}return o.join("")};var i=function(){this._dataLength=0;
+this._state=new Int32Array(4);this._buffer=new ArrayBuffer(68);this._bufferLength=0;this._buffer8=new Uint8Array(this._buffer,0,68);
+this._buffer32=new Uint32Array(this._buffer,0,17);this.start()};var a=new Int32Array([1732584193,-271733879,-1732584194,271733878]);
+var h=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);i.prototype.appendStr=function(n){var k=this._buffer8;var j=this._buffer32;
+var o=this._bufferLength;var m;for(var l=0;l<n.length;l++){m=n.charCodeAt(l);if(m<128){k[o++]=m}else{if(m<2048){k[o++]=(m>>>6)+192;
+k[o++]=m&63|128}else{if(m<55296||m>56319){k[o++]=(m>>>12)+224;k[o++]=(m>>>6&63)|128;k[o++]=(m&63)|128}else{m=((m-55296)*1024)+(n.charCodeAt(++l)-56320)+65536;
+if(m>1114111){throw"Unicode standard supports code points up to U+10FFFF"}k[o++]=(m>>>18)+240;k[o++]=(m>>>12&63)|128;k[o++]=(m>>>6&63)|128;
+k[o++]=(m&63)|128}}}if(o>=64){this._dataLength+=64;b(this._state,j);o-=64;j[0]=j[16]}}this._bufferLength=o;return this};i.prototype.appendAsciiStr=function(o){var l=this._buffer8;
+var k=this._buffer32;var p=this._bufferLength;var n,m=0;for(;;){n=Math.min(o.length-m,64-p);while(n--){l[p++]=o.charCodeAt(m++)
+}if(p<64){break}this._dataLength+=64;b(this._state,k);p=0}this._bufferLength=p;return this};i.prototype.appendByteArray=function(m){var l=this._buffer8;
+var k=this._buffer32;var p=this._bufferLength;var o,n=0;for(;;){o=Math.min(m.length-n,64-p);while(o--){l[p++]=m[n++]}if(p<64){break
+}this._dataLength+=64;b(this._state,k);p=0}this._bufferLength=p;return this};i.prototype.start=function(){this._dataLength=0;
+this._bufferLength=0;this._state.set(a);return this};i.prototype.end=function(p){var q=this._bufferLength;this._dataLength+=q;
+var r=this._buffer8;r[q]=128;r[q+1]=r[q+2]=r[q+3]=0;var k=this._buffer32;var m=(q>>2)+1;k.set(h.subarray(m),m);if(q>55){b(this._state,k);
+k.set(h)}var j=this._dataLength*8;if(j<=4294967295){k[14]=j}else{var n=j.toString(16).match(/(.*?)(.{0,8})$/);var o=parseInt(n[2],16);
+var l=parseInt(n[1],16)||0;k[14]=o;k[15]=l}b(this._state,k);return !!p?this._state:c(this._state)};var f=new i();i.hashStr=function(k,j){return f.start().appendStr(k).end(j)
+};i.hashAsciiStr=function(k,j){return f.start().appendAsciiStr(k).end(j)};if(i.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"){console.error("YaMD5> this javascript engine does not support YaMD5. Sorry.")
+}if(typeof g==="object"){g.YaMD5=i}return i})(this); \ No newline at end of file
diff --git a/http/Makefile b/http/Makefile
new file mode 100644
index 0000000..ae1ec10
--- /dev/null
+++ b/http/Makefile
@@ -0,0 +1,84 @@
+#
+# Makefile
+#
+# See the README file for copyright information and how to reach the author.
+#
+#
+
+include ../Make.config
+LESS_Compiler=/usr/bin/rhino
+DEFAULT_LANG=de
+VERSION = $(shell grep 'define _VERSION ' ../HISTORY.h | awk '{ print $$3 }' | sed -e 's/[";]//g')
+
+all: core common lang style
+
+# baut aus allen JS-Files innerhalb von src/js/ eine gesamt Javascriptdatei -> www/epgd.js
+core:
+ @echo "var epgd = {};" > ./epgd.full.js
+ @cat ./src/lang/$(DEFAULT_LANG).js >> ./epgd.full.js
+ @cat ./src/js/*.js >> ./epgd.full.js
+ @java -jar tools/yuicompressor-2.4.8.jar ./epgd.full.js -o ./www/epgd.js -v
+
+# baut aus allen benötigten 3rdParty-scripten eine gesamt Javascriptdatei -> www/common.js
+common:
+# cat ./3rdParty/modernizr.custom.js > ./www/common.js
+ cat ./3rdParty/jquery-2.2.3.min.js > ./www/common.js
+ cat ./3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.js >> ./www/common.js
+ cat ./3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.js >> ./www/common.js
+# cat ./3rdParty/jQuery-jQuery-UI-Plugin-For-Simle-Tokenized-Autocomplete-Autocomplete-Multiselect/src/jquery.autocomplete.multiselect.js >> ./www/common.js
+ cat ./3rdParty/jquery.ui.touch-punch.min.js >> ./www/common.js
+ cat ./3rdParty/jquery-scrollstop-master/jquery.scrollstop.min.js >> ./www/common.js
+ cat ./3rdParty/yaMD5/yamd5.min.js >> ./www/common.js
+
+ cp ./3rdParty/fontello/font/* ./www/font/
+ cp ./3rdParty/fontello/LICENSE.txt ./www/font/
+
+# kopiert alle Sprachrelevanten Dateien nach www/lang
+lang:
+ cp -ua ./src/lang/* ./www/lang/
+
+# baut das default-theme und hinter dann auch ggf. weitere themes
+style:
+ $(LESS_Compiler) -f ./tools/less-rhino-1.7.0.js ./tools/lessc-rhino-1.7.0.js --ru ./src/css/theme/default.less ./www/epgd.css
+
+
+
+install: install-env install-core install-lang install-font install-images
+
+install-core:
+ $(shell sed "s/%VERSION%/$(VERSION)/g" ./www/index.html > $(HTTPDEST)/index.html)
+ cp -u ./www/epgd.js ./www/common.js ./www/favicon.ico $(HTTPDEST)/
+ cp ./www/epgd.css $(HTTPDEST)/
+ if test -f ./custom.css; then \
+ cat ./custom.css >> $(HTTPDEST)/epgd.css; \
+ fi
+ cp -u ../HISTORY.h $(HTTPDEST)/
+ cp -u ../TODO $(HTTPDEST)/
+
+install-lang:
+ cp -ua ./www/lang/* $(HTTPDEST)/lang
+
+install-font:
+ cp -ua ./www/font/* $(HTTPDEST)/font
+
+install-images:
+ cp -ua ./www/images/* $(HTTPDEST)/images
+
+install-env:
+ @if ! test -d $(HTTPDEST); then \
+ mkdir -p "$(HTTPDEST)"; \
+ chmod a+rx $(HTTPDEST)/; \
+ fi
+ @if ! test -d $(HTTPDEST)/lang/; then \
+ mkdir -p "$(HTTPDEST)/lang/"; \
+ chmod a+rx $(HTTPDEST)/lang/; \
+ fi
+ @if ! test -d $(HTTPDEST)/font/; then \
+ mkdir -p "$(HTTPDEST)/font/"; \
+ chmod a+rx $(HTTPDEST)/font/; \
+ fi
+ @if ! test -d $(HTTPDEST)/images/; then \
+ mkdir -p "$(HTTPDEST)/images/"; \
+ chmod a+rx $(HTTPDEST)/images/; \
+ fi
+
diff --git a/http/README b/http/README
new file mode 100644
index 0000000..806822c
--- /dev/null
+++ b/http/README
@@ -0,0 +1,77 @@
+WebInterface für VDR, basierend auf vdr-epg-daemon
+
+Autor: Dirk Hermes
+
+====================================================================================================================================
+das webIf basiert aktuell auf folgenden Frameworks und ist eine sogenannte Single Page Application
+ boilerplate5 https://html5boilerplate.com/
+ modernizr http://modernizr.com
+ jQuery 2.1.4 http://jquery.com/
+ jquery-autocomplete-multiselect http://www.jqueryscript.net/form/jQuery-jQuery-UI-Plugin-For-Simle-Tokenized-Autocomplete-Autocomplete-Multiselect.html
+ jquery-scrollstop-master https://github.com/ssorallen/jquery-scrollstop
+ jQuery-Timepicker-Addon-master http://trentrichardson.com/examples/timepicker/
+ jQueryUI 1.11.4 http://jqueryui.com/
+ jquery.ui.touch-punch http://touchpunch.furf.com/
+ yaMD5 https://github.com/gorhill/yamd5.js
+ fontello http://fontello.com/
+
+Ordnerstruktur:
+http/
+ 3rdParty/ Framework und Plugins von anderen Entwicklern
+ tools/ Werkzeuge zum compilieren von css und JS
+ src/ Die Quelldateien für das WebIf
+
+ css/
+ theme/ Hier können verschiedene themes definiert werden
+ default.less Diese Datei ist der Startpunkt für ein theme und ist eine import-list von mehreren Stylesheetdateien,
+ die per less zu eine gesamt-css-datei compiliert werden
+ epgd.less Das ist das eigentliche css für das webIf
+
+ js/
+ 0_translate.js default-ressourcendatei; diese kann dann mal in mehreren Sprachen übersetzt werden und sollte dann
+ unter www/lang abgelegt werden. Zur Zeit aber noch nicht implementiert
+ main.js Haupdatei, die allgemeine Funktionen bereitstellt und die Seite initialisiert
+ pages.editChannels.js Bearbeiten der Kanallisten usw.
+ pages.help.js die Hilfeseite
+ pages.magazine.js stellt das aktuelle Programm als Magazin dar
+ pages.now.js zeigt alle aktuell laufenden Sendungen an
+ pages.profile.js Bearbeiten von Benutzerprofilen
+ pages.search.js Suchseite
+ pages.timer.js Timer erstellen und bearbeiten
+ vdr.js Funktionen für den/die VDR
+
+ lang/ Hier liegen für jede Sprache die Sprach-Ressourcendateien (de.js), die dann hinter her mal währen der Laufzeit
+ gewechselt werden kann(noch nicht implementiert).
+ Zusätzlich gibt es dann noch die Hilfe-Dateien (hilfe.html) pro Sprache.
+
+ build.sh baut aus allen Files innerhalb von js/ eine gesamt Javascriptdatei -> www/epgd.js
+ build-common.sh baut aus allen benötigten 3rdParty-scripten eine gesamt Javascriptdatei -> www/common.js
+
+ www/ Diese Verzeichnis wird durch make normalerweise nach /var/epgd/www kopiert
+ images/ Bilder, die für das webIf benötigt werden, teilweise auch aus jquery-ui
+ font/ Font-dateien für die Icons
+ lang/ Sprachabhängige Dateien
+ hilfe.html deutsche Hilfe Datei
+ de.js deutsche Sprach-Ressourcendatei
+
+ common.js gemergte Datei aus 3rdParty-Scripten
+ epgd.css compilierte Stylesheet-Datei
+ epgd.js gemergte Datei aus allen src-js-scripten
+ favicon.ico
+ index.html Hauptdatei für das WebIf
+
+ custom.css optional, wenn diese Datei existiert, wird sie an die epgd.css angehangen. Darin kann dann css überschrieben werden.
+ Achtung, bitte darauf achten, dass die Datei UTF OHNE BOM kodiert ist.
+ dev-watch.sh Kann zum Entwickeln aufgerufen werden. Diese Datei überwacht per inotifywait die sourcen-Dateien auf Änderunegn
+ und compiliert/builded bei Änderungen die Dateien und kopiert die Dateien nach /var/epgd/www.
+ Vorraussetzung dafür ist ein installiertes Rhino.
+
+Entwicklung:
+============================================================================================================================
+Wenn Änderungen an den src/js Dateien gemacht werden, muss anschliessend immer "make core" aufgerufen werden
+und dann die erstellte Datei www/epgd.js nach /var/epgd/www kopiert werden.
+Bei Änderungen an den less Dateien müssen diese compiliert werden "make style" und die dann die erstellte Datei www/epgd.css nach /var/epgd/www kopiert werden.
+Um den Entwicklungsprozess zu erleichtern, gibt es die Datei dev-watch.sh die man in einer Konsole aufrufen kann.
+
+
+
diff --git a/http/custom.sample.css b/http/custom.sample.css
new file mode 100644
index 0000000..c503a2c
--- /dev/null
+++ b/http/custom.sample.css
@@ -0,0 +1 @@
+/* Here you can enter your custom css. It will be append to epgd.css. Rename custom.sample.css to custom.css */ \ No newline at end of file
diff --git a/http/dev-watch.sh b/http/dev-watch.sh
new file mode 100644
index 0000000..7c4ece8
--- /dev/null
+++ b/http/dev-watch.sh
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+HTTPDEST='/var/epgd/www'
+
+inotifywait -mrq -e modify,moved_to ./src | while read x op f; do\
+ if ! [[ "$f" == *"~"* ]]; then
+ if [[ "$f" == *".less" ]]; then
+ make style
+ cp ./www/epgd.css $HTTPDEST/
+ elif [[ "$f" == *".js" ]]; then
+ echo -------------------------------------------------------------------------------------------------------------------
+ make core
+ cp ./epgd.full.js $HTTPDEST/epgd.full.js
+ cp ./www/epgd.js $HTTPDEST/epgd.js
+ fi
+ if [[ "$x" == "./src/lang/" ]]; then
+ cp ./src/lang/$f $HTTPDEST/lang/
+ cp ./src/lang/$f ./www/lang/
+ fi
+ fi
+done
+exit
diff --git a/http/src/css/epgd.less b/http/src/css/epgd.less
new file mode 100644
index 0000000..51a9c90
--- /dev/null
+++ b/http/src/css/epgd.less
@@ -0,0 +1,1724 @@
+/* Hier sind Variablen aus Jquery-ui. Sie werden folgendermass erstellt:
+ aus 3rdParty\jquery-ui-x:x.custom\development-bundle\themes\humanity\jquery-ui.css den Link kopieren und hier einfgen.
+ Dann diesen Link (nur Auswahl) per regulren Ausdruck
+ suchen "$([^=]+)=([^&]+)" und ersetzen "@$1: $2; "
+ suchen " ([a-f0-9]{6})" und ersetzen " #$1"
+*/
+@ui-fwDefault: normal;
+@ui-fsDefault: 1.1em;
+@ui-cornerRadius: 6px;
+@ui-bgColorHeader: #cb842e;
+@ui-bgTextureHeader: glass;
+@ui-bgImgOpacityHeader: 25;
+@ui-borderColorHeader: #d49768;
+@ui-fcHeader: #ffffff;
+@ui-iconColorHeader: #ffffff;
+@ui-bgColorContent: #f4f0ec;
+@ui-bgTextureContent: inset_soft;
+@ui-bgImgOpacityContent: 100;
+@ui-borderColorContent: #e0cfc2;
+@ui-fcContent: #1e1b1d;
+@ui-iconColorContent: #c47a23;
+@ui-bgColorDefault: #ede4d4;
+@ui-bgTextureDefault: glass;
+@ui-bgImgOpacityDefault: 70;
+@ui-borderColorDefault: #cdc3b7;
+@ui-fcDefault: #3f3731;
+@ui-iconColorDefault: #f08000;
+@ui-bgColorHover: #f5f0e5;
+@ui-bgTextureHover: glass;
+@ui-bgImgOpacityHover: 100;
+@ui-borderColorHover: #f5ad66;
+@ui-fcHover: #a46313;
+@ui-iconColorHover: #f08000;
+@ui-bgColorActive: #f4f0ec;
+@ui-bgTextureActive: highlight_hard;
+@ui-bgImgOpacityActive: 100;
+@ui-borderColorActive: #e0cfc2;
+@ui-fcActive: #b85700;
+@ui-iconColorActive: #f35f07;
+@ui-bgColorHighlight: #f5f5b5;
+@ui-bgTextureHighlight: highlight_hard;
+@ui-bgImgOpacityHighlight: 75;
+@ui-borderColorHighlight: #d9bb73;
+@ui-fcHighlight: #060200;
+@ui-iconColorHighlight: #cb672b;
+@ui-bgColorError: #fee4bd;
+@ui-bgTextureError: highlight_hard;
+@ui-bgImgOpacityError: 65;
+@ui-borderColorError: #f8893f;
+@ui-fcError: #592003;
+@ui-iconColorError: #ff7519;
+@ui-bgColorOverlay: #aaaaaa;
+@ui-bgTextureOverlay: flat;
+@ui-bgImgOpacityOverlay: 75;
+@ui-opacityOverlay: 30;
+@ui-bgColorShadow: #aaaaaa;
+@ui-bgTextureShadow: flat;
+@ui-bgImgOpacityShadow: 75;
+@ui-opacityShadow: 30;
+@ui-thicknessShadow: 8px;
+@ui-offsetTopShadow: -8px;
+@ui-offsetLeftShadow: -8px;
+@ui-cornerRadiusShadow: 8px;
+
+h5 {
+ margin-bottom: 5px;
+}
+
+.ui-autocomplete-multiselect {
+ display: inline-block;
+ background: #fff !important;
+ border: 1px solid @ui-borderColorContent;
+ border-radius: 6px;
+ padding: 1px 3px 0 3px;
+ overflow: hidden;
+ cursor: text;
+ font-size: 0.8em;
+ vertical-align: bottom;
+}
+
+.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item .ui-icon {
+ float: right;
+ cursor: pointer;
+}
+
+.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item {
+ display: inline-block;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ padding: 1px 3px;
+ margin-right: 2px;
+ margin-bottom: 1px;
+ background-color: @ui-bgColorContent;
+ font-size: 0.8em;
+}
+
+.ui-autocomplete-multiselect input {
+ display: inline-block;
+ border: none;
+ outline: none;
+ height: auto;
+ margin: 2px;
+ overflow: visible;
+ margin-bottom: 5px;
+ text-align: left;
+ background: #fff !important;
+}
+
+.ui-autocomplete {
+ max-height: 120px;
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+
+.ui-autocomplete-category {
+ font-weight: bold;
+ padding: .2em .4em;
+ margin: .8em 0 .2em;
+ line-height: 1.5;
+}
+
+.placeholders {
+ position: absolute;
+ max-height: 120px;
+ overflow: auto;
+}
+.ui-dialog{position:fixed}
+
+
+.iAsButton {
+ border: 1px solid @ui-borderColorDefault;
+ background-color: @ui-bgColorDefault;
+ color: @ui-iconColorContent;
+ border-radius: @ui-cornerRadius;
+ text-align: center;
+ padding: 3px;
+ display: inline-block;
+ text-decoration: none;
+ cursor: pointer;
+ margin: 3px;
+ white-space: nowrap;
+
+ &[disabled] {
+ opacity: .35;
+ }
+}
+
+.iAsIcon {
+ text-align: center;
+ display: inline-block;
+ text-decoration: none;
+ cursor: pointer;
+ margin: 3px;
+ white-space: nowrap;
+ padding: 0;
+ font-size: 0.9em;
+ vertical-align: 6px;
+ margin-top: -6px;
+ border: 1px solid @ui-borderColorDefault;
+ background-color: @ui-bgColorDefault;
+ color: @ui-iconColorContent;
+ border-radius: 50%;
+ font-size: 0.8em;
+}
+
+.i-ok {
+ color: green;
+}
+
+.i-warning {
+ color: #f2e339;
+}
+.i-error {
+ color: #f16241;
+}
+.i-flash-outline {
+ color: #f90000;
+}
+.i-progress {
+ color: #c47a23;
+}
+
+
+/* ==========================================================================
+ EPGd
+ ========================================================================== */
+@epgdSprite: url(images/epg_icons_24x24_orange.png);
+
+html{
+ width:100%;
+}
+body {
+ margin: 0;
+ padding: 30px 0 0 0;
+ font-size: 0.8em;
+ width:100%;
+ overflow:auto;
+}
+
+input, select {
+ padding: 2px;
+ border: 1px solid @ui-borderColorContent;
+ border-radius: 6px;
+ vertical-align: middle;
+ font-weight:normal;
+}
+
+select {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ // border-right:none;
+}
+
+.full {
+ width: 98%;
+}
+
+.quickInfo {
+ max-width: 80%;
+ max-height: 80%;
+ overflow-y: auto;
+}
+
+#menu-top {
+ //min-width: 320px;
+ width: 100%;
+ margin:0 auto;
+ white-space:normal;
+ //overflow: hidden;
+ position: fixed;
+ z-index: 99;
+ top: 0;
+ left: 0;
+ //border: 5px solid white;
+ //border-width: 0px 0px 5px 0px;
+ background-color: #fff;
+
+ span.maxi {
+ display:none;
+ }
+
+ .iAsButton {
+ padding: 0 2px;
+ line-height: 21px;
+ margin-top: 0;
+ }
+
+ &.mini{
+ span.maxi {
+ display: block;
+ position: absolute;
+ padding:0 10px;
+ right:0;
+ top: 2px;
+ font-size: 1.3em;
+ }
+ > ul {
+ padding-right: 40px;
+// overflow-y:visible;
+
+ > li {
+ display: none;
+ float: left;
+ max-width:95%;
+ }
+ }
+ }
+ &.open {
+ z-index: 9999;
+
+ > ul {
+ padding: 10px 0 10px 10px;
+
+ > li {
+ display: block;
+ float: left;
+ min-width: 90%;
+ min-height: 25px;
+ > a {
+ width:100%;
+ }
+ }
+ }
+ .ui-datepicker {display:none}
+ }
+}
+
+#ui-menu-top {
+ overflow: hidden;
+ min-height:30px;
+
+ .ui-menu {
+ position:fixed;
+ overflow: visible !important;
+ padding-top: 5px;
+ z-index: 99;
+ }
+
+ > li {
+ float: left;
+ display: block;
+ width: auto !important;
+ border: 1px solid transparent;
+ margin: 1px 5px !important;
+ padding: 0 0 !important;
+ line-height: 24px;
+ outline: none;
+
+ > a {
+ float: left;
+ display: block;
+ clear: both;
+ overflow: hidden;
+ text-decoration: none;
+ }
+
+ span.ui-menu-icon {
+ display:none;
+ }
+ }
+ .menu-active {
+ display: block !important;
+
+ > a {
+ color: @ui-fcActive;
+ font-weight: bold;
+ min-height: 25px;
+ }
+ }
+
+ ul li {
+ display: block;
+ float: none;
+
+ ul {
+ left: 120px !important;
+ width: 100%;
+
+ li {
+ width: auto;
+
+ a {
+ float: left;
+ }
+ }
+ }
+ }
+
+/*
+
+ #ui-menu-top .ui-menu li {
+ float: left;
+ display: block;
+ }
+*/
+ input, select {
+ display: none;
+ float: left;
+ font-size: 1em;
+ margin: 0 0 0 5px;
+ }
+ input, select {
+ padding:3px;
+ }
+}
+
+#menu_login {
+ float: right;
+ margin-right: 20px !important;
+}
+
+.menu-active input, .menu-active select {
+ display: block;
+ visibility: visible;
+}
+
+.ui-tabs {
+ position: static;
+ border: 1px solid @ui-borderColorContent;
+}
+
+#tabCon {
+ padding: 10px;
+}
+
+table.ui-datepicker-calendar {
+ width: 40%;
+ float: left;
+ margin: 10px 2% 5px 0;
+ font-size: 1em;
+}
+
+.ui-datepicker {
+ width: auto;
+}
+
+.ui-timepicker-div {
+ width: 53%;
+ min-width: 230px;
+ float: left;
+ margin: 3px 0 0 0;
+
+ dl dd {
+ margin: 0 10px 0 4px;
+ }
+
+ dt {
+ float: none !important;
+ font-weight: bold;
+ }
+
+ span {
+ float: left;
+ line-height: 0.8;
+ margin-bottom: 10px;
+ }
+ u {
+ margin: 0px 0px 10px 10px;
+ text-align: right;
+ //font-size: 0.9em;
+ min-width: 16px;
+ cursor: pointer;
+ display: inline-block;
+ }
+ i {
+ padding-right: 17px;
+ background: url(images/epg_icons_24x24_orange.png) no-repeat 45px -1831px;
+ display:inline-block;
+ }
+}
+
+.channel {
+ width:80px;
+ overflow: hidden;
+ font-weight: bold;
+ font-size: 10px;
+ line-height: 1;
+ color: #4d4949;
+ padding: 3px 5px 0 3px;
+ img {
+ max-width: 70px;
+ max-height: 50px;
+ margin-right: 5px;
+ margin-bottom: 5px;
+ display:block;
+ }
+ .i-tv {
+ font-size: 1.8em;
+ line-height: 1.3em;
+ margin-left: -4px;
+ cursor: pointer;
+ }
+}
+
+.popup {
+ z-index: 8888;
+}
+
+.topInfo {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ height: 36px;
+ padding: 6px 0.7em;
+ z-index: 100000;
+ position: fixed;
+ top: 0;
+ right: 30px;
+
+ button {
+ margin: -4px 0 0 10px;
+ }
+}
+
+#content {
+ text-align: center;
+ width: 96%;
+ padding: 0;
+ margin: 0 auto;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+
+ > * {
+ text-align: left;
+ }
+}
+
+.teaserList {
+ padding: 0px;
+ margin: 0px auto;
+ list-style: none;
+ display: block;
+
+ li {
+ padding: 1px 3px 3px 3px;
+ margin: 0.5% 1%;
+ overflow: hidden;
+ width: 98%;
+ min-height: 70px;
+ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
+ -moz-box-sizing: border-box; /* Firefox, other Gecko */
+ box-sizing: border-box; /* Opera/IE 8+ */
+
+ }
+ .desc {
+ height: 72px;
+ overflow: hidden;
+ &:hover{
+ min-height: 72px;
+ height:auto;
+ overflow-y:visible;
+ }
+ }
+
+ .desc img {
+ float: right;
+ margin: 0px 0px 2px 5px;
+ }
+
+ .time {
+ float: left;
+ font-size: 0.9em;
+ }
+ .date {
+ float: right;
+ font-size: 0.9em;
+ }
+ .tipp {
+ margin:1px 5px 0 0;
+ }
+
+ .title {
+ font-weight: bold;
+ margin-top: 8px;
+ //font-size: 1.1em;
+ }
+
+}
+
+#pageNow {
+ li {
+ padding-left: 90px;
+ }
+
+ .channel {
+ float: left;
+ margin-left: -87px;
+ cursor: pointer;
+ img {max-height:70px}
+ }
+}
+
+#magazine-nav{
+
+// overflow:hidden;
+ width:100%;
+ left:-27px;
+ position:relative;
+
+ .left, .right {
+ width: 50px;
+ height:54px;
+ border-top: none;
+ border-bottom: none;
+ position: absolute;
+ z-index: 98;
+ top:0;
+
+ .ui-widget-content {
+ width: 50px;
+ margin: 0 -1px;
+ text-align: center;
+ padding-top: 1px;
+ border-bottom: none;
+ }
+
+ span {
+ margin: 0px auto 1px auto;
+ }
+ }
+ .left {
+ left:0;
+ //border-right: 5px solid white;
+ }
+ .right {
+ right: 0;
+ //border-left: 5px solid white;
+ }
+
+}
+
+
+#magazine-head {
+ margin: 0 0 0 -2%;
+ height: 55px;
+ padding: 0 0 0 54px;
+ overflow:hidden;
+
+ .ui-widget-content {
+ margin: 0 3px;
+ width: 200px;
+ height: 55px;
+ float: left;
+
+ .channel {
+ height: 55px;
+ width:auto;
+ img {
+ max-width:100px;
+ float:left;
+ }
+ }
+ }
+}
+
+
+
+#magazine {
+ padding: 0 0 0 54px;
+ margin: 0 0 0 -2%;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ position: relative;
+ clear: left;
+
+ .timeNow {
+ position: absolute;
+ border-top: 2px solid red;
+ z-index: 99;
+ left: 0;
+ color: red;
+ font-weight: bold;
+ padding: 0 0 0 8px;
+ margin: 0;
+ opacity: 0.5;
+ }
+
+ > div {
+ margin: 0;
+ padding: 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+
+ > div {
+ float: left;
+ width: 200px;
+ min-height: 90%;
+ margin: 0 3px;
+
+ &.timeLine {
+ width: 50px;
+ //font-size: 0.8em;
+ margin: 0 0 0 -1px;
+ left: 0;
+ position: absolute;
+ z-index: 99;
+
+ p {
+ position: absolute;
+ pointer-events:none;
+ width: 5000px;
+ height: 180px;
+ background-color: red !important;
+ opacity: 0.1;
+ }
+
+ &.tlr{
+ p{display:none}
+ }
+ dfn {
+ height: 120px;
+ text-align: center;
+ box-sizing: border-box;
+ padding-top: 10px;
+ display: block;
+
+ &:nth-of-type(2n+1) {
+ background-color: #ddd;
+ }
+ }
+ }
+ }
+
+
+ dt {
+ //border-top: 2px solid @ui-borderColorContent;
+ //border-left: 4px solid transparent;
+ //padding: 4px 4px 4px 1px;
+ border: 2px solid transparent;
+ border-top-color: @ui-borderColorContent;
+ padding: 1px 4px;
+ width: 200px;
+ margin: 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ overflow: hidden;
+
+ &:hover {
+ overflow-y: visible;
+ height: auto !important;
+ }
+
+ .time {
+ font-size: 0.9em;
+ float: left;
+
+ * {
+ display: block;
+ float: left;
+ width: 40px;
+ }
+ //b { text-align: center; }
+ }
+
+ img {
+ float: right;
+ }
+
+ .title {
+ font-size: 0.9em;
+ font-weight: bold;
+ clear: both;
+ }
+
+ .desc {
+ margin-top: 5px;
+ border: none;
+ clear:both;
+ }
+ }
+ }
+}
+
+.desc {
+ font-size: 0.9em;
+ border: 1px solid @ui-borderColorContent;
+ border-width: 1px 0 0 0;
+ margin-top: 20px;
+
+ span {
+ font-weight: bold;
+ color: #ae0a0a;
+ margin-right: 5px;
+ }
+}
+
+.progress {
+ border: 1px solid @ui-borderColorContent;
+ float: right;
+ margin-top: 3px;
+ width: 100px;
+ height: 10px;
+
+ > div {
+ background-color: @ui-bgColorHeader;
+ height: 8px;
+ margin-top: 1px;
+ }
+}
+
+#eventDetail {
+ position: fixed;
+ display: none;
+ z-index: 100;
+ min-width: 320px;
+ width: 432px;
+ height: 80%;
+ min-height: 440px;
+ padding: 0;
+
+ .ui-accordion-content {
+ padding: 0;
+
+ a {
+ margin-right: 5px;
+ }
+ }
+
+ .toolbar {
+ text-align: center;
+ float: left;
+ width: 100%;
+ padding: 2px;
+ box-sizing: border-box;
+
+ button {
+ font-size: 1.2em;
+ }
+ }
+
+ .title {
+ display: inline-block;
+ margin-left: 10px;
+ overflow: hidden;
+ text-align: center;
+ width: 100px;
+ //height: 18px;
+ }
+
+ h3 {
+ cursor: auto;
+ vertical-align: top;
+ text-align: center;
+ font-size: 0.8em;
+ padding: 3px 140px 0;
+ overflow: hidden;
+ height: 18px;
+ clear:both;
+
+ div {
+ position: absolute;
+ top: 3px;
+ display: inline-block;
+ //background:@ui-bgColorContent;
+ padding: 0 5px;
+
+ &.date {
+ left: 20px;
+ }
+
+ &.time {
+ right: 0;
+ }
+ }
+ }
+
+ .imgBox {
+ //margin: 10px 0 0 10px;
+ padding: 4px;
+ display: table-cell;
+ position: relative;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ width: 270px;
+ float: left;
+ min-height: 120px;
+
+ img {
+ display: block;
+ margin: auto;
+ }
+ }
+
+ .chPrFl {
+ width: 105px;
+ margin: -5px 0 0 10px;
+ float: left;
+ font-size: 0.8em;
+
+ > div {
+ width: 100px;
+ float: left;
+ margin-top: 5px;
+ }
+
+ .channel {
+ text-align: center;
+ //height: 75px;
+ font-size: 12px;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ img {
+ margin: 0 auto 5px auto;
+ }
+ }
+
+ .audio {
+ span {
+ height: 16px;
+ min-width: 25px;
+ margin: 0 8px 0 0;
+ background-image: @epgdSprite;
+ background-repeat: no-repeat;
+ display: inline-block;
+ }
+ }
+ }
+
+ .info {
+ float: left;
+ margin: 10px 10px 0 0;
+ min-width: 135px;
+ font-size: 0.9em;
+
+ b {
+ margin-left: 5px;
+ }
+ }
+
+ .col2 {
+ float: left;
+ width: 280px;
+ margin: 10px 10px 0 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+
+ .rate {
+ background-size: 25px;
+ min-height:40px;
+ padding-left: 30px;
+ > span {
+ display: block;
+ font-size: 1.2em;
+ }
+ }
+ .tipp{
+ margin:0 5px 0 0;
+ }
+
+ .stars {
+ div {
+ height: 16px;
+ width: 80px;
+ margin: 2px 0 5px 0;
+ background-image: @epgdSprite;
+ background-repeat: no-repeat;
+ }
+ }
+
+ div.stars {
+ font-size: 0.9em;
+ float: right;
+ margin: 10px 10px 0 0;
+ text-align: center;
+ clear: both;
+ }
+
+ td.stars {
+ div {
+ float: left;
+ margin-right: 20px;
+ }
+ }
+
+ .colFull {
+ float: left;
+ width: 405px;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ margin: 10px 0 0 10px;
+
+ > img {
+ margin: 10px 0 0 0;
+ vertical-align: top;
+ }
+ }
+
+ .desc {
+ padding: 5px 10px 5px 0px;
+ }
+
+ table {
+ //font-size: 0.8em;
+ border-collapse: collapse;
+ //margin: 10px 0 0 10px;
+ th, td {
+ text-align: left;
+ border: 1px solid @ui-borderColorContent;
+ padding: 2px 3px;
+ }
+ }
+
+ .poster {
+ float: left;
+ margin: 10px 10px 0 10px;
+ }
+
+ .actors {
+ font-size: 0.9em;
+ //padding-left: 10px;
+ h5 {
+ margin: 10px 0 0;
+ font-size: 1.1em;
+ }
+
+ div {
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 10px 10px 0 65px;
+ width: 195px;
+ min-height: 100px;
+
+ a {
+ display: block;
+ font-weight: bold;
+ }
+
+ img {
+ max-width: 60px;
+ max-height: 90px;
+ float: left;
+ margin-left: -65px;
+ }
+ }
+ }
+ .rec {
+ font-size:0.9em;
+ }
+}
+
+.hasTimer {
+ color: red;
+ font-weight: bold;
+}
+
+.stars1 {
+ background-position: 0 -465px;
+}
+.stars2 {
+ background-position: 0 -491px;
+}
+.stars3 {
+ background-position: 0 -517px;
+}
+.stars4 {
+ background-position: 0 -543px;
+}
+.stars5 {
+ background-position: 0 -570px;
+}
+.a-169 {
+ background-position: 0 -784px;
+}
+.a-dd {
+ background-position: 0 -712px;
+}
+
+.parRate6 {
+ background: @epgdSprite no-repeat 0 -1558px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate12 {
+ background: @epgdSprite no-repeat 0 -1520px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate16 {
+ background: @epgdSprite no-repeat 0 -1634px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate18 {
+ background: @epgdSprite no-repeat 0 -1596px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+
+.rate {
+ background: url() no-repeat left top;
+ background-size: 18px;
+ min-height:35px;
+ padding-left: 25px;
+ margin: 5px 0;
+ float: left;
+ clear:left;
+ display:block;
+}
+
+.rate1{ background-image: url('images/thumb-rate1.svg');}
+.rate2{ background-image: url('images/thumb-rate2.svg'); background-size:25px}
+.rate3{ background-image: url('images/thumb-rate3.svg');}
+.rate4{ background-image: url('images/thumb-rate4.svg');}
+.rate5{ background-image: url('images/thumb-rate5.svg');}
+.rate0{ background:none; height:auto;padding-left:inherit}
+
+.tipp{
+ display:block;
+ float: left;
+ margin:5px 0;
+ background-color: rgb(245, 126, 126);
+ color: white;
+ border-radius: @ui-cornerRadius;
+ padding: 1px 3px;
+ font-size: 0.9em;
+ font-weight: normal;
+}
+
+#searchResult {
+ overflow-y: auto;
+ overflow-x: visible;
+ border-top: 1px solid @ui-bgColorHeader;
+ box-sizing: border-box;
+ padding-right:1px;
+}
+
+.timerTable {
+ min-width: 400px;
+ width:100%;
+
+ &.sub {
+ background-color: white;
+ border: 3px double @ui-borderColorContent;
+ }
+
+ td {
+ border: 1px solid @ui-borderColorContent;
+ padding: 2px 5px;
+ vertical-align: top;
+
+ .channel {
+ img {
+ max-height:30px;
+ }
+ }
+ }
+
+ /* p {
+ border-top: 1px solid #ccc;
+ height: 18px;
+ margin: 0;
+ overflow-y: hidden;
+
+ &:hover {
+ overflow-y: visible;
+ height: auto !important;
+ }
+ }
+ }*/
+
+ th {
+ text-align: left;
+ vertical-align: top;
+ padding: 2px 5px;
+ display: table-cell;
+ }
+
+ span {
+ float: right;
+ }
+
+ .i-sort-name-up {
+ margin-right: 0;
+ }
+
+ .i-sort-name-down {
+ margin-left: 0;
+ }
+}
+
+#timerList {
+ td {
+ &:nth-child(6) {
+ cursor: pointer;
+ }
+ }
+}
+#timerSearchList {
+ max-width:750px;
+}
+.searchDialog {
+ min-width: 320px;
+ //max-width: 650px;
+ position: relative;
+
+ #tTitle {
+ cursor: pointer;
+ text-align: center;
+ text-decoration: underline;
+ }
+
+ >form{
+ >div{
+ margin-bottom:5px;
+ margin-top: 5px;
+ }
+ &.noAdv{
+ >div + div {display: none}
+ }
+ }
+
+ label {
+ //display: block;
+ margin: 5px 5px 0 0;
+ font-weight: bold;
+ color: #666;
+ cursor: pointer;
+ }
+
+ input.hasDatepicker[disabled] {
+ border: none;
+ background-color: transparent;
+ width: 20px;
+ }
+
+ .week {
+ border: 1px solid @ui-borderColorContent;
+ margin: 5px 0;
+ padding: 5px 0;
+ width: 99%;
+
+ > input[type=checkbox], > span {
+ width: auto;
+ margin-left: 2%;
+ margin-right: 2px;
+ line-height: 2em;
+ }
+ }
+
+ .colBlock {
+ width:100%;
+ float: left;
+ div {
+ float: left;
+ margin-right: 10px;
+
+ label {
+ display: block;
+ }
+ }
+ }
+ form.typeS {
+ .noTypeS, .onlyTypeR {display:none}
+ }
+ form.typeV {
+ .onlyTypeR, .onlyTypeS {display:none}
+ }
+ form.typeR {
+ .onlyTypeS {display:none}
+ }
+}
+
+.selMarkBlock {
+ display: inline-block;
+ text-align: center;
+ width: 34px;
+ float: left;
+ font-size: 0.8em;
+
+ b {
+ border: 1px solid #CCCCCC;
+ border-radius: 6px;
+ float: left;
+ margin: 5px 3px 0 0;
+ padding-left: 5px;
+ height: 13px;
+ width: 20px;
+
+ b {
+ border: medium none;
+ border-radius: 6px 0 0 6px;
+ margin: 0 0 0 -5px;
+ width: 7px;
+ height: 13px;
+ }
+ }
+}
+
+#records {
+ margin-left: -20px;
+/* 23.11.16 brauchen wir das noch???
+ .ui-menu li {
+ padding: 2px 5px;
+
+ &:hover {
+ border: 1px solid @ui-borderColorHover;
+ }
+ }*/
+
+ .folder {
+ //clear: left;
+ padding: 0 0 0 20px;
+
+ h4 {
+ margin: 3px 0;
+ display: inline-block;
+ span {
+ font-weight: normal;
+ padding-right: 3px;
+ }
+ }
+
+ div, m {
+ display: none;
+ }
+
+ &.open,&.tmp-open {
+ > h4 {
+ > span:before {
+ content: '\e80a'; // folder open
+ }
+
+ > m {
+ display: inline;
+ }
+
+ > m:before {
+ content: '\e80b'; // menu
+ }
+ // menu
+ }
+
+ > div {
+ display: block;
+ }
+ }
+
+ }
+
+}
+.rec {
+ border: 1px solid @ui-borderColorDefault;
+ border-radius: 6px;
+ margin: 2px 20px;
+ //clear: left;
+ //width: 80%;
+ padding: 0 140px 0 70px;
+ background-color: @ui-bgColorContent;
+ position: relative;
+
+ u {
+ display: block;
+ position: absolute;
+ margin-left: -60px;
+ padding: 2px 0;
+ }
+
+ b {
+ display: block;
+ background-color: white;
+ padding: 2px 5px;
+
+ i {
+ display: block;
+ font-weight: normal;
+ }
+ }
+
+ em {
+ display: block;
+ position: absolute;
+ right: 10px;
+ top: 0;
+ padding: 2px 0;
+ }
+}
+ #recBar{
+ font-size:0.9em;
+ display:inline-block;
+ }
+
+ body.dd-open{
+ #ui-menu-top, #recBar{
+ display:none !important;
+ }
+ #records{
+ .folder {
+ display:block;
+ }
+ div.rec{
+ display:none;
+ }
+ }
+
+ }
+
+.pageEditChannels > li {
+ border: 1px solid #CCCCCC;
+ border-radius: 6px;
+ clear: left;
+ float: left;
+ margin-top: 5px;
+ padding-left: 5px;
+ width: 96%;
+
+ &.filterHide {
+ height:0;
+ overflow:hidden;
+ margin:0;
+ border:none;
+ }
+
+}
+
+
+#pageEditChannelsHead {
+ border-bottom: 3px double #CCCCCC;
+ font-size: 0.9em;
+ margin: 10px 0 0 10px;
+ width: 600px;
+ float: none;
+
+ em {
+ padding: 3px;
+ line-height: 0;
+ }
+}
+
+.pageEditChannels {
+ font-size: 0.9em;
+ margin: 0;
+ width: 600px;
+ overflow-y: auto;
+ float: left;
+
+ em {
+ cursor: pointer;
+ float: left;
+ margin: 3px 10px 0 0;
+ font-size: 1.2em;
+ }
+
+ span {
+ display: inline-block;
+ float: left;
+ padding: 5px 10px 5px 0;
+ width: 180px;
+ }
+
+ > li > input {
+ float: left;
+ margin-top: 3px;
+ width: 180px;
+ }
+
+ ol {
+ background: none repeat scroll 0 0 #EEEEEE;
+ border-radius: 6px;
+ display: inline-block;
+ float: left;
+ margin: 3px 10px;
+ padding: 2px 5px 2px 20px;
+ min-height: 15px;
+ font-size: 0.7em;
+
+ input {
+ margin-top: 3px;
+ width: 40px;
+ }
+ }
+}
+
+#pageEditChannels {
+ border-bottom: 1px solid #CCCCCC;
+}
+
+#pageEditChannelsSource {
+ width: 350px;
+ margin-top: 5px;
+
+ i {
+ padding: 5px 10px 5px 0;
+ float: left;
+ }
+}
+
+.selected {
+ background-color: #F39814;
+}
+
+#page_profile {
+ td {
+ padding: 5px;
+ vertical-align: top;
+ }
+}
+
+#page_editUser {
+ >div {
+ float:left;
+ height:350px;
+ padding-right:20px;
+ margin-right:20px;
+ border-right:2px solid #ccc;
+ }
+ h2 {
+ margin: 5px 0 2px 0;
+ font-size:1em
+ }
+ form {float:left}
+ select{
+ overflow:auto; height:200px
+ }
+}
+
+/* ==========================================================================
+ Media Queries
+ ========================================================================== */
+@media only screen and (max-width: 420px) {
+ body {
+ font-size: 1em;
+ }
+
+ ui-icon {
+ margin: 6px;
+ }
+
+ .ui-timepicker-div {
+
+ u {
+ min-width: 21px;
+ }
+ i {
+ background-position: 53px -1828px;
+ }
+ }
+
+ .teaserList .desc img, #eventDetail .ui-widget-shadow {
+ display: none;
+ }
+
+ .teaserList {
+ .time,.date {font-size: 0.8em;}
+ .tipp {font-size: 0.7em;margin-top:2px}
+ .progress {width:40px}
+ }
+
+ #eventDetail {
+ width: 100%;
+ height: 60%;
+ position: fixed;
+
+ .colFull {
+ width: 100%;
+ margin: 0;
+ }
+
+ .imgBox:empty {
+ display: none;
+ }
+
+ .col2 {
+ width: 165px;
+ }
+
+ .info:nth-child(2n+1) {
+ clear: both;
+ }
+
+ .stars {
+ clear: none !important;
+ float: left;
+ margin-left: 10px;
+ }
+
+
+ .desc {
+ width: 300px;
+ }
+ }
+
+ .searchDialog {
+ width: 320px;
+ }
+
+ #magazine-nav {
+ top:-10px;
+ .left{margin-left:-1px;}
+ .right{margin-right:-1px;}
+ }
+
+ #magazine-head {
+ .ui-widget-content {
+ height: 65px;
+ }
+ .prev {height:auto}
+ }
+ #magazine .tlr {display:none}
+
+ #records {
+ margin-left:-5px;
+
+
+ .folder {
+ padding: 0 0 0 5px;
+ }
+ }
+ .rec {
+ margin: 2px;
+ padding: 0;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+
+ u {
+ position: inherit;
+ margin-left: 2px;
+ }
+ }
+}
+
+@media only screen and (min-width: 768px) and (max-width:1139px) {
+ #pageNow li {
+ float: left;
+ width: 48%;
+ }
+
+ #pageNow li:nth-child(2n+1) {
+ clear: left;
+ }
+
+ #eventDetail {
+ width: 700px;
+
+ h3 {
+ font-size: 1em;
+ padding: 3px 170px 0;
+ height: 20px;
+ }
+
+ .desc {
+ border-width: 0 0 0 1px;
+ height: 100%;
+ margin-top: 0;
+ //margin-left: 10px;
+ padding: 5px 10px;
+ }
+
+ .desc, .actors {
+ width: 270px;
+ }
+
+ .poster, table.colFull, table.colFull img {
+ width: 320px;
+ }
+ }
+}
+
+@media only screen and (min-width: 900px) {
+ #eventDetail {
+ width: 850px;
+
+ h3 {
+ font-size: 1em;
+ padding: 3px 170px 0;
+ height: 20px;
+ }
+
+ .desc {
+ border-width: 0 0 0 1px;
+ height: 100%;
+ margin-top: 0;
+ //margin-left: 10px;
+ padding: 5px 10px;
+ }
+
+ .desc, .actors {
+ width: 405px;
+ }
+
+ .poster {
+ float: right;
+ }
+ }
+}
+
+@media only screen and (min-width: 1140px) {
+ .content {
+ width: 1026px; /* 1140px - 10% for margins */
+ margin: 0 auto;
+ }
+
+ #pageNow li {
+ float: left;
+ width: 31%;
+ }
+
+ #pageNow li:nth-child(3n+1) {
+ clear: left;
+ }
+}
+
+
+/*
+
+@media (min-width: 1696px) {
+ #pageNow li:nth-child(4n+1) {
+ clear: left;
+ }
+}
+@media (max-width: 1695px) {
+ #pageNow li:nth-child(3n+1) {
+ clear: left;
+ }
+}
+
+@media (max-width: 1275px) {
+ #pageNow li {
+ width:46%;
+ }
+ #pageNow li:nth-child(2n+1) {
+ c_lear: left;
+ }
+}
+@media (max-width: 865px) {
+ #pageNow li {
+ width:96%;
+ }
+}
+@media (max-width: 420px) {
+ #pageNow img, #eventDetail .ui-widget-shadow{
+ display:none;
+ }
+ #pageNow li {
+ width:310px;
+ margin-left:0px;
+ margin-right:0px;
+ }
+ #pageNow .desc {
+ width:220px;
+ }
+ #eventDetail {
+ width:320px;
+ height:100%;
+ position:fixed;
+ }
+}
+*/
diff --git a/http/src/css/theme/default.less b/http/src/css/theme/default.less
new file mode 100644
index 0000000..d55a291
--- /dev/null
+++ b/http/src/css/theme/default.less
@@ -0,0 +1,7 @@
+@import (inline) "../../../3rdParty/boilerplate5/css/normalize.min.css";
+@import (inline) "../../../3rdParty/boilerplate5/css/main_pre.min.css";
+@import (inline) "../../../3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css";
+@import (inline) "../../../3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css";
+@import (inline) "../../../3rdParty/fontello/css/epgd.css";
+@import "../epgd.less";
+@import (inline ) "../../../3rdParty/boilerplate5/css/main_post.min.css";
diff --git a/http/src/js/1_main.js b/http/src/js/1_main.js
new file mode 100644
index 0000000..3a8251a
--- /dev/null
+++ b/http/src/js/1_main.js
@@ -0,0 +1,714 @@
+
+epgd.profile = {
+ needLogin: -1,
+ channelLogoPath: "data/channellogo",
+ eventImgPath: "data/eventimg",
+ movieMediaPath: "data/moviemedia",
+ serieImgPath: "data/seriesmedia",
+ movieActorPath: "http://www.themoviedb.org/person/",
+ serieSeasonPath: "http://www.thetvdb.com/?tab=seasonall&id=",
+ constabelEditPath: "https://www.eplists.de/eplist.cgi?action=edit&back=&file=",
+ constabelLinkPath: "https://www.eplists.de/eplist.cgi?action=show_form_redir&linkname=",
+ minEventTime: 0,
+ maxEventTime: 0,
+ logoShowName: 0
+};
+epgd.userProfile_defaults = {
+ defaultVDRuuid: '',
+ constabelLoginPath: false,
+ pickerFirstDay: '6',
+ quickTimes: '',
+ startWithSched: 0,
+ startPage: "menu_options",
+ namingModeSerie: "0",
+ namingModeSearchSerie: "0",
+ namingModeMovie: "0",
+ namingModeSearchMovie: "0",
+ namingModeSerieTemplate: "",
+ namingModeSearchSerieTemplate: "",
+ namingModeMovieTemplate: "",
+ namingModeSearchMovieTemplate: "",
+ chFormat: "",
+ timerDefaultVDRuuid: '',
+ searchAdv: "0",
+ mailReceiver: "",
+ messageMailTypes: "",
+ magazinePan: 10,
+ magazinePanDelay: 400,
+ maxListEntries: 100,
+ ratings: "",
+ recordSubFolderSort: 1
+};
+epgd.profile_load = function (doNotCache) {
+ var profile = $.extend(epgd.profile, epgd.userProfile_defaults);
+ epgd.ajax({ url: epgd.login.url + "data/parameters", async: false, cache: false, dataType: "json" },function (data) {
+ var p,i,k,
+ oldVal, now,
+ changes = {};
+ for (i in data.parameters) {
+ p = data.parameters[i];
+ oldVal = profile[p.name];
+ if (oldVal != undefined && oldVal != p.value) {
+ profile[p.name] = p.type === 0 ? parseInt(p.value, 10) : p.value;
+ changes[p.name] = oldVal;
+ if (p.name.indexOf('logo') == 0)
+ epgd.channels.isDirty = true;
+ }
+ }
+ if (epgd.utils.timeOffset == null) {
+ epgd.utils.timeOffset = (data.timezone - new Date().getTimezoneOffset() * 60) * 1000;
+ now = epgd.utils.now();
+ epgd.$dtPicker.datetimepicker('setDate', new Date(now.setMinutes(parseInt(now.getMinutes() / 15, 10) * 15)));
+ }
+ if (!profile.minEventTime) {
+ now = epgd.utils.now();
+ profile.minEventTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0).getTime() / 1000;
+ changes["minEventTime"] = 0;
+ }
+ if (!profile.maxEventTime) {
+ profile.maxEventTime = profile.minEventTime + 8 * 24 * 60 * 60 - 60;
+ changes["maxEventTime"] = 0;
+ }
+ for (k in changes) {
+ $(window).trigger("profile_updated", changes);
+ break;
+ }
+ epgd.channels.isDirty && epgd.channels.load();
+ });
+}
+
+epgd.pages = {};
+
+epgd.login = {
+ user: '',
+ session: '',
+ rights:-1,
+ url: ''
+}
+epgd.rights = { // userMask
+ umConfig: 2,
+ umConfigEdit: 4 + 2,
+ umConfigUsers: 8,
+ umTimer: 64,
+ umTimerEdit: 128 + 64,
+ umSearchTimer: 256 + 64,
+ umSearchTimerEdit: 512 + 256 + 128 + 64,
+ umFsk: 4096,
+ umRecordings: 32768,
+ umRecordingsEdit: 65536 + 32768
+}
+epgd.utils = {
+ timeOffset: null,
+ now: function () {return new Date(new Date().getTime() - this.timeOffset);},
+ date: function (unixTime) { return new Date(unixTime * 1000 - this.timeOffset); },
+ unixTime: function (date) { return date ? parseInt((date.getTime() + this.timeOffset) / 1000, 10) : 0; },
+ formatTime: function (unixTime) {
+ var d = new Date(unixTime * 1000 - this.timeOffset);
+ return new String(100 + d.getHours()).slice(1) + ':' + new String(100 + d.getMinutes()).slice(1);
+ },
+ formatDateTime: function (unixTime, dateFormat) {
+ var d = new Date(unixTime * 1000 - this.timeOffset);
+ return $.datepicker.formatDate((dateFormat || epgd.tr.dateTimePicker.dateFormat), d) + ' ' + new String(100 + d.getHours()).slice(1) + ':' + new String(100 + d.getMinutes()).slice(1);
+ },
+ formatDate: function (unixTime, dateFormat) {
+ var d = new Date(unixTime * 1000 - this.timeOffset);
+ return $.datepicker.formatDate((dateFormat || epgd.tr.dateTimePicker.dateFormat), d);
+ },
+ popup: function (txt, options) {
+ var $w = $(window),
+ $dlg;
+ options = $.extend({
+ autoOpen: true,
+ dialogClass: 'popup',
+ show: {
+ effect: "blind",
+ duration: 1000
+ },
+ hide: {
+ effect: "explode",
+ duration: 1000
+ },
+ width: 400,
+ height:200,
+ maxWidth: $w.width() * 0.8,
+ maxHeight: $w.height() * 0.7,
+ }, options);
+ $dlg = $('<div class="epgPopUp"><p>' + txt + '</p></div>').dialog(options);
+ options.autoClose && window.setTimeout(function () { $dlg.dialog('close').dialog('destroy'); }, options.autoClose);
+ return $dlg;
+ },
+ confirm: function (message, callback) {
+ var o = {
+ modal: true,
+ buttons: {}
+ };
+ o.buttons[epgd.tr.yes]= function () { $(this).dialog('close'); callback(true);};
+ o.buttons[epgd.tr.no]= function () { $(this).dialog('close'); callback(false);};
+ this.popup(message, o);
+ },
+ topInfo: function (txt, options) {
+ var isError = options && options.isError,
+ $info,
+ dura;
+ options = $.extend({
+ autoClose: isError ? 0 : 3000,
+ className: "ui-state-" + (isError ? 'error' : 'highlight')
+ },options);
+ dura = (options.autoClose || 3000) / 2;
+ $info = $('<div class="topInfo ui-corner-all ' + options.className + '">' + txt
+ + '<button onclick="$(this).parent().remove();" class="iAsButton i-cancel" title="' + epgd.tr.close
+ + '"></button></div>')
+ .appendTo(epgd.$menu)
+ .animate({ 'opacity': 0.4 }, dura, function () { $info.animate({ 'opacity': 1 }, dura); });
+ options.autoClose && window.setTimeout(function () { $info.remove() }, options.autoClose);
+ },
+ sendMail: function (subject, body, mimetype, receiver) {
+ epgd.ajax({
+ url: epgd.login.url + 'data/sendmail',
+ type: 'post',
+ data: JSON.stringify({ "receiver": (receiver || epgd.profile.mailReceiver), "subject": subject, "body": body, "mimetype": mimetype })
+ }, function (data) {
+ data = data.result;
+ if (data && data.state == 200)
+ epgd.utils.topInfo(epgd.tr.dataSend);
+ else
+ epgd.utils.topInfo(data.message, { isError: 1 });
+ epgd.profile_load();
+ });
+ },
+ loader: {
+ $win: $('<div style="position:absolute;z-index:9999;width:100%;height:100%;position:fixed;left:0px;top:0px;background:url(images/loader.png) no-repeat 50% 50%"></div>'),
+ cnt: 0,
+ process: function (actionFunc, doNotRemove) {
+ var loader = this;
+ this.cnt++;
+ this.$win.appendTo(document.body).stop().animate({ opacity: 0.7}, {
+ always: function () {
+ try{
+ actionFunc();
+ } catch (e) {
+ epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''),0);
+ loader.close();
+ }
+ !doNotRemove && loader.close();
+ }
+ }, 200);
+ },
+ close: function () {
+ if (this.cnt > 0) {
+ this.cnt--;
+ this.cnt == 0 && this.$win.remove();
+ }
+ }
+ },
+ addAutoComplete: function (inputSelector, options) {
+ var $sel = $(inputSelector),
+ cn = $sel[0].className,
+ w = $sel[0].style.width || "";
+ $(inputSelector).autocomplete($.extend({
+ minLength: 0,
+ multiselect: false,
+ create: function (event, ui) { // based on http://jsfiddle.net/mekwall/sgxKJ/
+ var inst = $(this).autocomplete('instance'),
+ o = inst.options,
+ fontSize, kc;
+
+ inst.selectedItems = {};
+ if (o.multiselect) {
+ inst.multiselect = $("<div></div>")
+ .addClass("ui-autocomplete-multiselect ui-state-default ui-widget " + cn)
+ .css("width", w)
+ .insertBefore(inst.element)
+ .append(inst.element)
+ .bind("click.autocomplete", function () {
+ inst.element.focus();
+ });
+ inst.menu.element.css({ "height": "300px", "overflow-y": "auto" });
+ fontSize = parseInt(inst.element.css("fontSize") || 10, 10);
+ function autoSize(e) {
+ // Hackish autosizing
+ var $this = $(this);
+ $this.width(1).width(this.scrollWidth + fontSize - 1);
+ };
+ kc = $.ui.keyCode;
+ inst.element.bind({
+ "keydown.autocomplete": function (e) {
+ if ((this.value === "") && (e.keyCode == kc.BACKSPACE)) {
+ var prev = inst.element.prev();
+ delete inst.selectedItems[prev.text()];
+ prev.remove();
+ }
+ },
+ // TODO: Implement outline of container
+ "focus.autocomplete blur.autocomplete": function () {
+ inst.multiselect.toggleClass("ui-state-active");
+ },
+ "keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete": autoSize
+ }).trigger("change");
+ o.select = o.select || function (e, ui) {
+ if (!inst.selectedItems[ui.item.label]) {
+ $("<div></div>")
+ .addClass("ui-autocomplete-multiselect-item")
+ .text(ui.item.label)
+ .append(
+ $("<span></span>")
+ .addClass("ui-icon ui-icon-close")
+ .click(function () {
+ var item = $(this).parent();
+ delete inst.selectedItems[item.text()];
+ item.remove();
+ })
+ )
+ .insertBefore(inst.element);
+ inst.selectedItems[ui.item.label] = ui.item;
+ }
+ inst._value("");
+ return false;
+ }
+ } else {
+ o.select = o.select || function (e, ui) {
+ inst.selectedItems[0] = ui.item;
+ inst._value(ui.item.label);
+ return false;
+ }
+ };
+ }
+ }, options)).focus(function () {
+ $(this).autocomplete("search", "");
+ });/*.bind("keydown", function (event) {
+ if (event.keyCode === $.ui.keyCode.TAB &&
+ $(this).autocomplete("instance").menu.active) {
+ event.preventDefault();
+ }
+ });*/
+ },
+ getAutoCompleteValues: function (inputSelector, quot) {
+ quot = quot || '';
+ var values = '',
+ del= ',' + quot,
+ ac,key;
+ try {
+ ac = $(inputSelector).autocomplete("instance").selectedItems;
+ for (key in ac)
+ values += del + ac[key].value + quot;
+ } catch (e) { }
+ return values.slice(1);
+ },
+ setAutoCompleteValues: function (inputSelector, values ) {
+ var ac = $(inputSelector).autocomplete("instance"),
+ item,i,
+ matcher;
+ ac.multiselect && ac.multiselect.find(">div").remove();
+ ac.selectedItems = {};
+ if (values) {
+ for (i = 0; i < values.length; i++) {
+ item = null;
+ matcher = new RegExp($.ui.autocomplete.escapeRegex(values[i]), "i");
+ $.each(ac.options.source, function () {
+ if (matcher.test(this.value || this.label || this))
+ return !(item = this);
+ });
+ if (item)
+ ac._trigger("select", null, { item: item.label ? item : {label:item,value:item} });
+ }
+ }
+ },
+ addPlaceholders: function (inputSelector, key, placeholders) {
+ var input = $(inputSelector)[0],
+ html = '<ul class="placeholders ui-menu ui-widget ui-widget-content">',
+ p;
+ for (p in placeholders)
+ html += '<li class="ui-menu-item"><b>' + p + '</b>' + placeholders[p] + '</li>';
+ input.$placeholders = $(html + '</ul>').hide().insertAfter(input).click(function (ev) {
+ var placeholder = ev.target.nodeName == 'B' ? $(ev.target).text() : ev.target.nodeName == 'LI' ? $(ev.target.firstChild).text() : null,
+ cursorPos = $(input).prop('selectionStart'),
+ v = $(input).val();
+ if (placeholder) {
+ $(input).val(v.substring(0, cursorPos) + placeholder + v.substring(cursorPos, v.length)).focus();
+ cursorPos += placeholder.length;
+ if (input.setSelectionRange) {
+ input.setSelectionRange(cursorPos, cursorPos);
+ }
+ else if (input.createTextRange) {
+ v = input.createTextRange();
+ v.collapse(true);
+ v.moveEnd('character', cursorPos);
+ v.moveStart('character', cursorPos);
+ v.select();
+ }
+ }
+ $(this).hide();
+ });
+ $(input).keydown(function (ev) {
+ if (ev.key == key) {
+ $(document).one("click", function () { input.$placeholders.hide(); })
+ input.blur();
+ return !input.$placeholders.show().position({
+ my: "left top",
+ at: "left bottom",
+ of: input
+ });
+ }
+ });
+ },
+ inherits : function (childClass, parentClass) {
+ var tempClass = function () { };
+ tempClass.prototype = parentClass.prototype;
+ childClass.prototype = new tempClass();
+ childClass.prototype.constructor = childClass;
+ childClass.base = parentClass.prototype;
+ return childClass;
+ },
+ log: function (message, level) {
+ console.log("error:" + message);
+ try {
+ $.ajax({ url: "data/log", type: 'get', async: true, cache: false, data: "level=" + (level || 0) + "&message=" + escape(message) });
+ } catch (e) {}
+ }
+};
+
+epgd.init = function () {
+
+ epgd.$con = $('<div id="content"></div>').appendTo(document.body);
+
+ $.datepicker.setDefaults(epgd.tr.dateTimePicker);
+ $.datepicker.setDefaults({
+ showOtherMonths: true,
+ selectOtherMonths: true,
+ });
+ $.timepicker.setDefaults(epgd.tr.dateTimePicker);
+ $.timepicker.setDefaults({
+ timeInput: true,
+ controlType: {
+ create: function (tp_inst, obj, unit, val, min, max, step) {
+ if (unit == 'hour') {
+ if (!tp_inst.inst.settings.timeOnly)
+ $('#ui-datepicker-div').width(($(window).width() > 500 ? 430 : 230)+ "px");
+ $('<span><u>0</u><u>2</u><u>4</u><u>6</u><u>8</u><u>10</u><br /><u>12</u><u>14</u><u>16</u><u>18</u><u>20</u><u>22</u><span>')
+ .appendTo(obj).bind("click", { tp_inst: tp_inst, obj: obj, unit:unit }, $.timepicker.quicklink);
+ } else if (unit == 'minute') {
+ $('<span><u>0</u><u>15</u><u>30</u><u>45</u><span>')
+ .appendTo(obj).bind("click", { tp_inst: tp_inst, obj: obj, unit:unit }, $.timepicker.quicklink);
+ } else if (unit == 'second' && epgd.profile.quickTimes) {
+ obj.closest('dl').find('.ui_tpicker_time').removeClass()
+ .bind("click", { tp_inst: tp_inst, obj:obj, unit: 'time' }, $.timepicker.quicklink).html('<i><u title="' + epgd.profile.quickTimes.replace(/[^=~]+=@[a-z]+/gi, '').replace(/~{2,}/g, '~').replace(/=!?/g, '">').replace(/~/g, '</u></i><i><u title="') + '</u></i>');
+ if (tp_inst.inst.settings.alwaysSetTime)
+ epgd.pages.help.initButtons(tp_inst.inst.dpDiv.find('.ui-datepicker-buttonpane').append(epgd.pages.help.getButton('datepicker')));
+ else
+ $('<button class="iAsButton i-cancel" role="button">' + epgd.tr.clear + '</button>').appendTo(tp_inst.inst.dpDiv.find('.ui-datepicker-buttonpane')).click(function () {
+ tp_inst.$input.val('');
+ $.datepicker._hideDatepicker();
+ });
+ return obj;
+ } else
+ return obj;
+
+ $('<input class="ui-timepicker-input" value="' + val + '" style="width:20px">')
+ .prependTo(obj)
+ .spinner({
+ min: min,
+ max: max,
+ step: step,
+ change: function (e, ui) { // key events
+ // don't call if api was used and not key press
+ if (e.originalEvent !== undefined)
+ tp_inst._onTimeChange();
+ tp_inst._onSelectHandler();
+ },
+ spin: function (e, ui) { // spin events
+ tp_inst.control.value(tp_inst, obj, unit, ui.value);
+ tp_inst._onTimeChange();
+ tp_inst._onSelectHandler();
+ }
+ });
+ return obj;
+ },
+ options: function (tp_inst, obj, unit, opts, val) {
+ if (typeof (opts) == 'string' && val !== undefined)
+ return obj.find('.ui-timepicker-input').spinner(opts, val);
+ return obj.find('.ui-timepicker-input').spinner(opts);
+ },
+ value: function (tp_inst, obj, unit, val) {
+ try {
+ if (val !== undefined)
+ return obj.find('.ui-timepicker-input').spinner('value', val);
+ return obj.find('.ui-timepicker-input').spinner('value');
+ } catch (e) {
+ return false;
+ }
+ }
+ }
+ });
+
+
+ epgd.$menu = $('<nav id="menu-top"><ul id="ui-menu-top"><li id="menu_login"><a href="#menu_login">' + epgd.tr.pages.login.label + '</a></li></ul></nav>').appendTo(document.body).find('ul').hide();
+ epgd.$menu.$maxBut = $('<span class="maxi i-menu" />').insertBefore(epgd.$menu).click(function () {
+ epgd.$menu.parent().toggleClass('open');
+ });
+ epgd.$menu.checkMenuSize = function (ev, callback) {
+ if (window.wrm_i) { // interval aktiv?
+ if (window.wrm_w == $(window).width()) { //Breite vom vorherigen Aufruf und aktuelle Breite gleich?
+ window.clearInterval(window.wrm_i);
+ delete window.wrm_i;
+ epgd.$menu.parent().removeClass('mini').width(window.wrm_w).offset({ 'left': $(window).scrollLeft() });
+ epgd.$menu.checkMenuSize(null, callback);
+ } else
+ window.wrm_w = $(window).width();
+ return;
+ }
+ if (ev) {
+ window.wrm_w = $(window).width();
+ if (!window.wrm_i) // Interval setzen, um sicher zu sein, dass die Breite jetzt stimmt
+ window.wrm_i = window.setInterval(epgd.$menu.checkMenuSize, 200,null,callback);
+ } else {
+ if (epgd.$menu.height() > 40)
+ epgd.$menu.parent().addClass('mini');
+ window.setTimeout(function () {
+ document.body.style.paddingTop = (epgd.$menu.parent().height() + 10) + "px";
+ callback && window.setTimeout(callback,200);
+ }, 200);
+ }
+ };
+ //epgd.$menu.show().checkMenuSize();
+ $(window).bind("resize", epgd.$menu.checkMenuSize);
+ epgd.$dtPicker = $('<input type="text" id="selDate" readonly style="z-index:199;position:relative" />').appendTo(document.body).hide().bind("click",function () { $(this).datepicker("show"); return false; });
+ epgd.$dtPicker.datetimepicker({
+ beforeShow: function () {
+ this.$overlay = $("<div />").addClass("ui-widget-overlay ui-front").appendTo(document.body);
+ },
+ onClose: function () {
+ this.$overlay.remove();
+ $(window).trigger('datepicker');
+ },
+ calendarStart: function() {
+ var d= new Date(epgd.profile.minEventTime * 1000)
+ leadDays = (d.getDay() - parseInt(epgd.profile.pickerFirstDay, 10) + 7) % 7;
+ d.setHours(12, 0);
+ d.setDate(d.getDate() - leadDays);
+ return d;
+ }
+ });
+
+ epgd.$menu.menu({
+ position: { at: "left bottom" },
+ select: function (event, ui) {
+ var id = ui.item.attr('id');
+ if (!id || id.indexOf('menu_') != 0 || (event.originalEvent && event.originalEvent.target.nodeName != 'A' && event.originalEvent.target.nodeName != 'LI'))
+ return false;
+ $(window).trigger("epgd_close");
+ epgd.$menu.parent().removeClass('open');
+ $(".menu-active", this).removeClass("menu-active");
+ $(document.body).append(epgd.$dtPicker.hide());
+ epgd.$menu.checkMenuSize(null,function () {
+ try {
+ ui.item.addClass("menu-active").parent().parent('.ui-menu-item').addClass("menu-active");
+ epgd.pages[id.slice(5)].render();
+ } catch (e) {
+ epgd.utils.popup(epgd.tr.error.common, { title: epgd.tr.error.error });
+ epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2);
+ }
+ });
+ }
+ });
+ $(window).bind("epgd_close", function () {
+ $('.epgPopUp').dialog('destroy');
+ }).bind("profile_updated", function (e,changes) {
+ if (changes["minEventTime"] != undefined)
+ epgd.$dtPicker.datetimepicker("option", {"minDateTime": new Date((epgd.profile.minEventTime= parseInt(epgd.profile.minEventTime,10)) * 1000), "minDate": new Date(epgd.profile.minEventTime * 1000)});
+ if (changes["maxEventTime"] != undefined)
+ epgd.$dtPicker.datetimepicker("option", {"maxDateTime": new Date((epgd.profile.maxEventTime= parseInt(epgd.profile.maxEventTime,10)) * 1000), "maxDate": new Date(epgd.profile.maxEventTime * 1000)});
+ if (changes["pickerFirstDay"] != undefined)
+ epgd.$dtPicker.datetimepicker("option", { "firstDay": epgd.profile.pickerFirstDay });
+ if (changes["defaultVDRuuid"] != undefined) {
+ $('#menu_vdrs > select').val(epgd.profile.defaultVDRuuid);
+ }
+ if (changes["quickTimes"] != undefined) {
+ epgd.pages.magazine.initQT();
+ }
+ if (changes["needLogin"] != undefined) {
+ epgd.pages.login.doLogin();
+ }
+ }).bind("login_changed", function (e, oldLogin) {
+ epgd.$menu.html('').hide();
+ epgd.$con.html('');
+ if (epgd.login.rights) {
+ epgd.$menu.append('<li id="menu_now"><a href="#menu_now">' + epgd.tr.menu.now + '</a></li>');
+ epgd.$menu.append('<li id="menu_magazine"><a href="#menu_magazine">' + epgd.tr.menu.magazine + '</a></li>');
+ (epgd.login.rights & epgd.rights.umTimer) == epgd.rights.umTimer && epgd.$menu.append('<li><a>' + epgd.tr.menu.timer + '</a><ul>'
+ + '<li id="menu_timerList"><a href="#menu_timerList">' + epgd.tr.pages.timer.timerList + '</a></li>'
+ + ((epgd.login.rights & epgd.rights.umSearchTimer) == epgd.rights.umSearchTimer ? '<li id="menu_searchTimerList"><a href="#menu_searchTimerList">' + epgd.tr.pages.timer.searchTimerList + '</a></li>' : '')
+ + '<li id="menu_timersDone"><a href="#menu_timersDone">' + epgd.tr.pages.timer.timersDone + '</a></li>'
+ + '<li id="menu_timerListDone"><a href="#menu_timerListDone">' + epgd.tr.pages.timer.timerListDone + '</a></li>'
+ + '<li id="menu_timerJobList"><a href="#menu_timerJobList">' + epgd.tr.pages.timer.timerJobList + '</a></li>'
+ + '<li id="menu_messageList"><a href="#menu_messageList">' + epgd.tr.pages.timer.messageList + '</a></li>'
+ + '</ul></li>');
+ (epgd.login.rights & epgd.rights.umRecordings) == epgd.rights.umRecordings && epgd.$menu.append('<li id="menu_records"><a href="#menu_records">' + epgd.tr.menu.records + '</a></li>');
+ epgd.$menu.append('<li id="menu_search"><a href="#menu_search">' + epgd.tr.menu.search + '</a></li>');
+ epgd.$menu.append('<li><a>' + epgd.tr.menu.options + '</a><ul>'
+ + '<li id="menu_profile"><a href="#menu_profile">' + epgd.tr.pages.options.profile + '</a></li>'
+ + ((epgd.login.rights & epgd.rights.umConfigEdit) == epgd.rights.umConfigEdit ? '<li id="menu_editChannels"><a href="#menu_editChannels">' + epgd.tr.pages.options.editChannels + '</a></li>' : '')
+ + ((epgd.login.rights & epgd.rights.umConfigUsers) == epgd.rights.umConfigUsers ? '<li id="menu_editUser"><a href="#menu_editUser">' + epgd.tr.pages.options.editUser + '</a></li>' : '')
+ + '</ul></li>');
+ epgd.$menu.append('<li id="menu_help"><a href="#menu_help">' + epgd.tr.menu.help + '</a></li>');
+ epgd.$menu.append('<li id="menu_vdrs"><a href="#menu_vdrs">VDR</a><select></select></li>');
+ }
+ epgd.profile.needLogin == "1" && epgd.$menu.append('<li id="menu_login"><a href="#menu_login">'
+ + (epgd.login.session ? epgd.login.user + ' ' + epgd.tr.pages.login.logout : epgd.tr.pages.login.label )
+ + '</a></li>');
+ if (epgd.login.user != oldLogin.user) {
+ epgd.profile_load();
+ epgd.channels.isDirty = true;
+ epgd.vdrs.list = null;
+ }
+ epgd.channels.load();
+ epgd.vdrs.load();
+ epgd.$menu.show().menu("refresh");
+ epgd.$menu.menu("select", { target: $(epgd.login.rights ? (location.hash || '#' + epgd.profile.startPage || '#menu_profile') : '#menu_login') });//.concat('=' + epgd.profile.startPage + '=').match(/(menu_[^=]+)/)[1] });
+
+ }).bind("vdrs_load", function () {
+ html = '';
+ for (var uuid in epgd.vdrs.list) {
+ html += '<option value="' + uuid + '"' + (uuid == epgd.vdrs.current.uuid ? 'selected' : '') + '>' + epgd.vdrs.list[uuid].name + '</option>';
+ }
+ $('<select>' + html + '</select>').replaceAll('#menu_vdrs > select').show().change(function () {
+ epgd.vdrs.current = epgd.vdrs.get(this[this.selectedIndex].value);
+ }).mousedown(function (ev) {
+ ev.stopPropagation();
+ return true;
+ }).click(function (ev) {
+ return false;
+ });
+ }).bind("unload", function () {
+ if (epgd.login.session)
+ epgd.pages.login.doLogin('logout');
+ });
+
+ epgd.pages.now.init();
+ epgd.pages.magazine.init();
+ epgd.profile_load();
+ if (epgd.profile.needLogin == -1) {
+ epgd.profile.needLogin = 0;
+ epgd.pages.login.doLogin();
+ }
+ window.setInterval(epgd.profile_load, 3600000); // ca. jede Stunde neu abfragen
+ // window.setTimeout(function () { $(window).trigger('resize'); });
+}
+window.onerror = function (msg, url, line, col, error) {
+ // Note that col & error are new to the HTML 5 spec and may not be
+ // supported in every browser. It worked for me in Chrome.
+ var extra = !col ? '' : '\ncolumn: ' + col;
+ extra += !error ? '' : '\nerror: ' + error.stack;
+ try{
+ epgd.utils.log(msg + "\nline: " + line + extra, 2);
+ } catch(e){}
+ return true;
+};
+
+$.widget("custom.catcomplete", $.ui.autocomplete, {
+ _create: function () {
+ this._super();
+ this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)");
+ },
+ _renderMenu: function (ul, items) {
+ var that = this,
+ currentCategory = "";
+ $.each(items, function (index, item) {
+ var li;
+ if (item.category != currentCategory) {
+ ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>");
+ currentCategory = item.category;
+ }
+ li = that._renderItemData(ul, item);
+ if (item.category) {
+ li.attr("aria-label", item.category + " : " + item.label);
+ }
+ });
+ }
+});
+$.datepicker._gotoToday = function (id) {
+ var inst = this._getInst($(id)[0]),
+ now = epgd.utils.now();
+ this._base_gotoToday(id);
+ this._setTime(inst, now);
+ this._setDate(inst, now);
+ this._hideDatepicker();
+};
+$.timepicker.quicklink = function (ev) {
+ var target = ev.target.nodeName == 'I' ? ev.target.firstChild : ev.target,
+ tp_inst,
+ val = null,
+ d = false;
+ try {
+ tp_inst = ev.data.tp_inst || $.datepicker._getInst(epgd.$dtPicker[0]).settings.timepicker;
+ } catch (e) {
+ epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2);
+ return false;
+ }
+ if (target.nodeName == 'U') {
+ if (ev.data.unit == "time")
+ val = $.datepicker.parseTime(tp_inst._defaults.timeFormat, target.innerHTML, tp_inst._defaults);
+ else if (ev.data.unit == "hour")
+ val = { hour: parseInt(target.innerHTML, 10), minute: tp_inst.minute };
+
+ if (val) {
+ if (val.hour < tp_inst.hour - 1)
+ d = true;
+ else {
+ tp_inst.control.value(tp_inst, tp_inst.hour_slider, "hour", val.hour);
+ tp_inst._onTimeChange();
+ if (tp_inst.hour != val.hour)
+ d = true;
+ }
+ if (d) {
+ d = new Date(tp_inst.inst.selectedYear, tp_inst.inst.selectedMonth, tp_inst.inst.selectedDay + 1, val.hour, val.minute);
+ $.datepicker._setDate(tp_inst.inst, d);
+ $.datepicker._setTime(tp_inst.inst, d);
+ $.datepicker._updateDatepicker(tp_inst.inst);
+ } else
+ tp_inst.control.value(tp_inst, tp_inst.minute_slider, "minute", val.minute);
+ } else
+ tp_inst.control.value(tp_inst, ev.data.obj, ev.data.unit, parseInt(target.innerHTML, 10));
+ tp_inst._onTimeChange();
+ tp_inst._onSelectHandler();
+ if (ev.target.nodeName == 'I')
+ $.datepicker._hideDatepicker();
+ }
+}
+
+epgd.ajax = function (options, success, error) {
+ var settings = $.extend({ dataType: 'json', contentType: "application/json; charset=utf-8" }, options);
+ return $.ajax(settings).fail(function (jqxhr, e) {
+ epgd.utils.loader.close();
+ if (jqxhr.status == 401) {
+ epgd.pages.login.doLogin(null,null,function () {
+ if (epgd.login.rights) {
+ settings.url = settings.url.replace(/sid[^\/]+\//, epgd.login.url);
+ $.ajax(settings).done(success).fail(function () {
+ epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ });
+ } else
+ epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ });
+ }
+ else if (jqxhr.status == 403) {
+ epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ } else if (jqxhr.status == 501){
+ epgd.utils.popup(epgd.tr.error.notImplemented, { title: epgd.tr.error.error });
+ } else {
+ if (error && error.call(this, jqxhr, e))
+ return;
+ //if (jqxhr.status == 409) {
+ var mess = '';
+ try {
+ if (jqxhr.responseJSON)
+ mess = jqxhr.responseJSON.result.message;
+ } catch (e) {
+ mess = '';
+ epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || '') + '\n options:' + JSON.stringify(options) + '\n jqhr:' + JSON.stringify(jqxhr), 3);
+ }
+ epgd.utils.popup(mess || jqxhr.responseText || epgd.tr.error.serverNotResponse, { title: epgd.tr.error.error });
+// } else
+ //epgd.utils.popup(epgd.tr.error.serverNotResponse, { title: epgd.tr.error.error });
+ }
+ }).done(success);
+};
diff --git a/http/src/js/5_timerDialog.js b/http/src/js/5_timerDialog.js
new file mode 100644
index 0000000..704f31e
--- /dev/null
+++ b/http/src/js/5_timerDialog.js
@@ -0,0 +1,640 @@
+// Timer Dialoge - Basis Klasse
+epgd.timerDialogBase = function (options) {
+ this.$win = null;
+ this.list = null;
+ if ( options )
+ this.options= $.extend({}, this.options, options);
+}
+epgd.timerDialogBase.prototype = {
+ options: {
+ id: "baseDialog",
+ modal: true,
+ draggable: true,
+ resizable: true,
+ autoOpen: false,
+ width: 'auto',
+ maxHeight: $(window).height(),
+ close: function () {
+ this.list.dialog.form.reset();
+ $(this.list.dialog.form).next().remove();
+ //allFields.removeClass("ui-state-error");
+ },
+ buttons: [{
+ text: epgd.tr.del,
+ icons: { primary: "ui-icon-trash" },
+ id: 'tBDel',
+ click: function () {
+ $(this).dialog("close");
+ this.list.del(this.list.dialog.form.tID.value);
+ }
+ }, {
+ text: epgd.tr.cancel,
+ icons: { primary: "ui-icon-close" },
+ click: function () {
+ $(this).dialog("close");
+ }
+ }, {
+ text: epgd.tr.save,
+ icons: { primary: "ui-icon-disk" },
+ click: function () { this.list.dialog.save() }
+ }]
+ },
+ save: function (data, url, failFunc, succFunc) {
+ this.list.save(data || this.getData(), url, failFunc, succFunc) && !this.options.embed && this.$win.dialog("close");
+ },
+ showError: function (msg, field) {
+ epgd.utils.popup((field && field.id ? '<b>' + $('label[for="' + field.id + '"]').text() + '</b>' : '') + '<div>' + msg + '</div>', { autoClose: 3000 });
+ field && field.focus();
+ return false;
+ },
+ loadFolder: function () {
+ var dialog = this;
+ epgd.ajax({ url: epgd.login.url + "data/recordingdirs" }, function (data) {
+ if (data.recordingdirs.length) {
+ var folder = [],
+ vdrs = epgd.vdrs.list,
+ vdr;
+ $.each(data.recordingdirs, function (id, f) {
+ vdr = vdrs[f.vdruuid];
+ folder.push({ value: f.directory, category: vdr ? vdr.name : '-' });
+ });
+ $(dialog.form.tFolder).catcomplete("option", "source", folder);
+ }
+ });
+ },
+ close: function () {
+ if (this.$win)
+ this.$win.dialog("close");
+ },
+ create: function () {
+ var o = this.options,
+ tr = epgd.tr.pages.timerList,
+ week = '',
+ i;
+ for (i = 1; i < epgd.tr.dateTimePicker.dayNamesShort.length; i++)
+ week += '<input name="tWeek" type="checkbox" />' + epgd.tr.dateTimePicker.dayNamesShort[i];
+ week += '<input name="tWeek" type="checkbox" />' + epgd.tr.dateTimePicker.dayNamesShort[0];
+ this.$win = $('<div id="' + o.id + '" class="searchDialog"><form>'
+ + '<div class="colBlock">'
+ + '<div><label>&nbsp;</label><select id="tType"><option value="R">' + epgd.tr.pages.eventDetail.record + '</option><option value="V">' + epgd.tr.pages.eventDetail.ch_switch + '</option></select></div>'
+ + '<div><label for="tSName">' + epgd.tr.pages.search.searchName + '</label><input type="text" id="tSName" /></div>'
+ +'<div><label for="tInactive">' + tr.inactive + '</label><input type="checkbox" id="tInactive" /></div>'
+ + '</div><div class="ui-corner-all week">' + week + '</div>'
+ + '<div class="onlyTypeR"><label for="tNameMode">' + tr.namingMode + epgd.pages.help.getIcon('sTNameMode') + '</label><br /><select id="tNameMode"><option>' + tr.namingModes.join('</option><option>') + '</option></select></div>'
+ + '<div class="onlyTypeR"><label for="tTemplate">' + tr.template + '</label><input class="full" id="tTemplate" type="text" value="" /></div>'
+ + '<div class="onlyTypeR"><label for="tFolder">' + tr.folder + '</label><input class="full" type="text" id="tFolder" /></div>'
+ + '<div class="colBlock">'
+ + '<div class="noTypeS"><label for="tVdr">VDR</label><select id="tVdr"><option value="">Auto</option>' + $('#menu_vdrs').find('select').html() + '</select></div>'
+ + '<div class="onlyTypeR"><label for="tPrio">' + tr.prio + '</label><input type="number" placeholder="..." min="0" max="99" id="tPrio" style="width:40px" /></div>'
+ + '<div class="onlyTypeR"><label for="tLife">' + tr.lifetime + '</label><input type="number" placeholder="..." min="0" max="99" style="width:40px" id="tLife"/></div>'
+ + '<div class="onlyTypeR"><label for="tVPS">' + 'VPS' + '</label><input type="checkbox" id="tVPS" /></div>'
+ + '</div>'
+ + '<input type="hidden" id="tID" /><br clear="all" />'
+ + '</form></div>');//.dialog(o);//.dialog("option", "buttons", o.buttons);
+ !o.embed && this.$win.appendTo(document.body).dialog(o);
+ this.$win[0].list = this.list;
+ this.form = this.$win.find('form')[0];
+ $(this.form.tFolder).catcomplete({
+ minLength: 0,
+ maxHeight: 300
+ }).focus(function () {
+ $(this).catcomplete("search", "");
+ });
+ $(this.form.tType).change(function () {
+ if (this.selectedIndex < 0)
+ this.selectedIndex = 0;
+ this.form.className = this.form.className.replace(/ ?type./, '') + ' type' + this[this.selectedIndex].value;
+ // $('.onlyTypeR', this.form).toggle(this[this.selectedIndex].value == 'R');
+ // $('#tSName').parent().toggle(this[this.selectedIndex].value == 'S');
+ // $('#tRepeat,#tChFormat').parent().toggle(this[this.selectedIndex].value != 'S');
+ });
+ $(this.form.tNameMode).change(function () {
+ this.form.tTemplate.parentNode.style.display = (this.selectedIndex == 6) ? 'block': 'none';
+ });
+ epgd.utils.addPlaceholders(this.form.tTemplate, '%', tr.templateFields);
+ this.loadFolder();
+ },
+ render : function (t) {
+ t = t || {};
+ if (!this.$win)
+ this.create();
+ !this.options.embed && this.$win.dialog('open').dialog('moveToTop');
+ var form = this.form,
+ d, i;
+ form.tSName.focus();
+ if (t.id) {
+ form.tID.value = t.id;
+ this.$win.parent().find('#tBDel').show();
+ this.$win.parent().find('#tBToggle').hide();
+ } else {
+ form.tID.value = '';
+ this.$win.parent().find('#tBDel').hide();
+ this.$win.parent().find('#tBToggle').show();
+ }
+ $(form.tType).val(t.type || 'R').change();
+ $(form.tVdr).val(t.vdruuid || epgd.profile.timerDefaultVDRuuid);
+ d = t.weekdays || 0;
+ for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2)
+ form.tWeek[i].checked = (d & f);
+ form.tPrio.value = t.priority || '';
+ form.tLife.value = t.lifetime || '';
+ form.tVPS.checked = t.vps == 1;
+ form.tInactive.checked = t.active === 0;
+ form.tFolder.value = t.directory || '';
+ form.tSName.value = t.name || '';
+ epgd.pages.help.initButtons(this.$win);
+ this.resize();
+ },
+ resize: function () {
+ /*var dlgOpt = this.$win.dialog("instance").options;
+ dlgOpt.position.my = "center top";
+ dlgOpt.position.at = "center top"; */
+ this.$win.dialog("option", "maxHeight", $(window).height());
+ }
+ };
+
+// Timerdialog - Klasse
+epgd.timerDialog = epgd.utils.inherits(function () {
+ epgd.timerDialogBase.call(this,{
+ id: 'timerDialog',
+ title: epgd.tr.pages.timer.timerList + ' ' + epgd.tr.edit,
+ buttons: [{
+ text: epgd.tr.pages.timer.searchTimerList,
+ icons: { primary: "ui-icon-transferthick-e-w" },
+ id: "tBToggle",
+ click: function () {
+ var t = this.list.dialog.getData(true);
+ if (t) {
+ $(this).dialog("close");
+ //t.channelid && (t.channelids = t.channelid);
+ if (t.title) {
+ t.expression = t.title;
+ t.searchfields = 1;
+ }
+ epgd.pages.searchTimerList.dialog.render(t);
+ }
+ }
+ }].concat(epgd.timerDialog.base.options.buttons)
+ });
+}, epgd.timerDialogBase);
+epgd.timerDialog.prototype.create = function () {
+ epgd.timerDialog.base.create.call(this);
+
+ var tr = epgd.tr.pages.timerList,
+ form = this.form;
+
+ $(form).prepend('<input type="hidden" id="tEvID" /><div id="tTitle"></div>');
+ $(form.tWeek[0]).parent().before('<div><label for="tStart">' + tr.recordTime + '</label>'
+ + '<br /><span id="tEvTime"></span>&nbsp;<input type="text" id="tStart" style="width:165px" /> - <input type="text" id="tEnd" style="width:40px" /></div>');
+ $(form.tNameMode).after('&nbsp;<span id="tFile"></span>');
+ $(form.tFolder).parent().after('<div><label for="tChannels">' + epgd.tr.channel
+ + '</label><input id="tChannel" type="text" class="full"/></div>');
+ $(this.form.tStart).datetimepicker({
+ minDateTime: epgd.utils.now(),
+ });
+ $(this.form.tEnd).timepicker({
+ // minDateTime: epgd.utils.now()
+ });
+ epgd.utils.addAutoComplete(form.tChannel, { source: epgd.channels.autoCompleteData });
+ form.tFile = $(form).find('#tFile')[0];
+ form.tEvTime = $(form).find('#tEvTime')[0];
+ form.tTitle = $(form).find('#tTitle').click(function () {
+ if (form.tEvID.value) {
+ epgd.utils.loader.process(function () {
+ new epgd.eventDetail(form.tEvID.value).render();
+ });
+ }
+ })[0];
+};
+epgd.timerDialog.prototype.render = function (t) {
+ t = t || {};
+ epgd.timerDialog.base.render.call(this, t);
+ var form = this.form,
+ d;
+
+ form.tFile.innerHTML = t.file || '...';
+ form.tEvID.value = t.eventid || '';
+ epgd.utils.setAutoCompleteValues(form.tChannel, t.channelid ? [t.channelid] : null);
+ form.tTitle.innerHTML = t.title || '';
+ form.tEvTime.innerHTML = t.evStartTime ? epgd.utils.formatDateTime(t.evStartTime) + ' - ' + epgd.utils.formatTime(t.evStartTime + t.evDuration) : '';
+
+ $([form.tStart, form.tEnd]).datetimepicker("option", "disabled", !!t.eventid);
+ if (t.day || !t.evStartTime) {
+ if (t.starttime)
+ d = epgd.utils.date((t.day + parseInt(t.starttime / 100, 10) * 60 * 60 + (t.starttime % 100) * 60));
+ else if (t.day)
+ d = epgd.utils.date(t.day);
+ else
+ d = epgd.utils.now();
+ $(form.tStart).datetimepicker('setDate', d);
+ $(form.tStart).datetimepicker('setTime', d);
+ if (t.endtime)
+ d = epgd.utils.date((t.day + parseInt(t.endtime / 100, 10) * 60 * 60 + (t.endtime % 100) * 60));
+ else
+ d = new Date(d.getTime() + 2 * 60 * 60000);
+ $(form.tEnd).datetimepicker('setTime', d);
+ } else {
+ $([form.tStart, form.tEnd]).val('...');
+ }
+ //form.tNameMode.defaultIndex = parseInt(t.category == 'Serie' ? epgd.profile.namingModeSerie : epgd.profile.namingModeMovie, 10);
+ form.tNameMode.selectedIndex = typeof t.namingmode == "undefined" ? parseInt(t.category == 'Serie' ? epgd.profile.namingModeSerie : epgd.profile.namingModeMovie, 10) : t.namingmode;
+ form.tTemplate.value = t.template || (t.category == 'Serie' ? epgd.profile.namingModeSerieTemplate : epgd.profile.namingModeMovieTemplate);
+ $(form.tNameMode).change();
+};
+epgd.timerDialog.prototype.getData = function (dontValid) {
+ var form = this.form,
+ d, i,
+ data = {};
+ if (form.tEvID.value) data.eventid = parseInt(form.tEvID.value, 10);
+ data.active = form.tInactive.checked ? 0 : 1;
+ if (form.tID.value) data.id = parseInt(form.tID.value, 10);
+ if (form.tStart.value && form.tStart.value != '...') {
+ d = $(form.tStart).datepicker('getDate');
+ data.starttime = d.getHours() * 100 + d.getMinutes();
+ d.setHours(0);
+ d.setMinutes(0);
+ data.day = parseInt(d.getTime() / 1000, 10);
+ data.endtime = parseInt(form.tEnd.value.replace(':', ''), 10);
+ } else if (!data.eventid && !dontValid)
+ return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.pages.timerList.recordTime), form.tStart);
+ data.weekdays = 0;
+ for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2)
+ if (form.tWeek[i].checked)
+ data.weekdays += f;
+ data.vps = form.tVPS.checked ? 1 : 0;
+ if (form.tPrio.value) data.priority = parseInt(form.tPrio.value, 10);
+ if (form.tLife.value) data.lifetime = parseInt(form.tLife.value, 10);
+ //if (form.t) data.childlock = form.t;
+ data.channelid = epgd.utils.getAutoCompleteValues(form.tChannel);
+ if (!data.channelid && !dontValid)
+ return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.channel), form.tChannel);
+ /*data.file = form.tFile.value;
+ if (form.tFolder.value)
+ data.file = form.tFolder.value + '~' + data.file;
+ */
+ d = $(form.tVdr).val();
+ if (d) data.vdruuid = d;
+ //if (!dontValid || form.tNameMode.defaultIndex != form.tNameMode.selectedIndex)
+ data.namingmode = form.tNameMode.selectedIndex;
+ data.template = form.tTemplate.value;
+ data.type = $(form.tType).val();
+ if (data.type == 'V' && !d && !dontValid)
+ return this.showError(epgd.tr.error.emptyField.replace("$field$", "VDR"), form.tVdr);
+ data.directory = form.tFolder.value;
+ data.title = form.tTitle.innerHTML || '';
+ data.name = form.tSName.value;
+ return data;
+}
+// Suchtimerdialog - Klasse
+epgd.searchTimerDialog = epgd.utils.inherits(function (options) {
+ this.searchResultList = null;
+ epgd.timerDialogBase.call(this,$.extend({},{
+ id: 'searchTimerDialog',
+ width: 530,
+ title: epgd.tr.pages.timer.searchTimerList + ' ' + epgd.tr.edit,
+ buttons: [{
+ text: epgd.tr.pages.timer.timerList,
+ icons: { primary: "ui-icon-transferthick-e-w" },
+ id: "tBToggle",
+ click: function () {
+ var t = this.list.dialog.getData(true);
+ if (t) {
+ $(this).dialog("close");
+ t.channelids && (t.channelid = t.channelids.split(',')[0]);
+ t.expression && (t.title = t.expression);
+ epgd.pages.timerList.dialog.render(t);
+ }
+ }
+ }, {
+ text: epgd.tr.test,
+ click: function () {
+ this.list.dialog.search();
+ }
+ }].concat(epgd.searchTimerDialog.base.options.buttons, {
+ text: epgd.tr.copy,
+ icons: { primary: "ui-icon-copy" },
+ id: "tBCopy",
+ click: function (ev) {
+ $(ev.currentTarget).hide();
+ this.list.dialog.form.tID.value = '';
+ this.list.dialog.form.tSName.value += ' copy';
+ this.list.dialog.form.tSName.select();
+ }
+ })
+ },options));
+}, epgd.timerDialogBase);
+epgd.searchTimerDialog.prototype.search = function ($con, searchData) {
+ if (!this.searchResultList)
+ this.searchResultList = new epgd.searchResultList(null);//,this);
+ if (!this.searchResultList.$con || ($con && $con[0] != this.searchResultList.$con[0]))
+ this.searchResultList.render($con || ($('<div style="border-top:1px solid #ccc"></div>').insertAfter(this.form)));
+ else
+ this.searchResultList.$con.find('tbody').empty();
+ if (!this.searchResultList.$con.parent().length) {
+ this.searchResultList.$con.insertAfter(this.form);
+ this.searchResultList.init();
+ }
+ this.searchResultList.update(searchData || this.getData());
+ this.searchResultList.$con[0].scrollIntoView(true);
+}
+epgd.searchTimerDialog.prototype.create = function () {
+ epgd.searchTimerDialog.base.create.call(this);
+
+ var tr = epgd.tr.pages.timerList,
+ trS = epgd.tr.pages.search,
+ sModes = '',
+ form = this.form,
+ key;
+
+ for (key in trS.searchModes)
+ sModes += '<option value="' + (parseInt(key, 10) + 1) + '">' + trS.searchModes[key] + '</option>';
+ if (!epgd.categories) {
+ epgd.categories = [];
+ epgd.ajax({ url: 'data/categories', async: false }, function (data) { epgd.categories = data.categories; });
+ }
+ if (!epgd.genres) {
+ epgd.genres = [];
+ epgd.ajax({ url: 'data/genres', async: false }, function (data) { epgd.genres = data.genres; });
+ }
+
+ $(form.tSName).parent().parent().after('<div><label for="tExpr">' + trS.searchExpression + epgd.pages.help.getIcon('sExpr') + '</label> <input type="text" id="tExpr" style="width:300px" /></div>'
+ + '<div class="full"><select id="tSMode" style="width:auto">' + sModes + '</select>'
+ + '&nbsp;&nbsp;<input type="checkbox" id="tCaseSens" />&nbsp;<label for="tCaseSens">'
+ + trS.caseSensitive + '</label></div>'
+ + '<div class="ui-corner-all week">' + [""].concat(trS.searchFields).join('<input type="checkbox" name="tSFields" />') + '</div>'
+ + '<div><label for="tAdv"><input type="checkbox" id="tAdv" />&nbsp;' + epgd.tr.advanced + epgd.pages.help.getIcon('sTAdv') + '</label><div class="ui-corner-all week">'
+ + '<span>' + tr.episode + '</span><input type="text" id="tSFEpisode" style="width:200px" /> '
+ + '<span>' + epgd.tr.pages.eventDetail.season + '</span><input type="text" id="tSFSeason" style="width:40px" /> '
+ + '<span>' + epgd.tr.pages.eventDetail.part + '</span><input type="text" id="tSFSPart" style="width:40px" /> '
+ + '<br /><span>' + epgd.tr.pages.eventDetail.category + '</span><input type="text" id="tSFCat" style="width:300px" /> '
+ + '<br /><span>' + epgd.tr.pages.eventDetail.genre + '</span><input type="text" id="tSFGenre" style="width:300px" /> '
+ + '<br /><input type="checkbox" name="tSFTip" value="GoldTipp" />GoldTipp<input type="checkbox" name="tSFTip" value="TagesTipp" />TagesTipp<input type="checkbox" name="tSFTip" value="TopTipp" />TopTipp'
+ + '<br /><span>' + epgd.tr.pages.eventDetail.year + '</span><input type="text" id="tSFYear" style="width:70px" />'
+ + '<br /><input type="checkbox" id="tSFNoEpgMatch" />' + tr.noEpgMatch
+ + '</div></div>'
+ + '<div class="noTypeS"><div><label for="tRepeat"><input type="checkbox" id="tRepeat" />&nbsp;'
+ + tr.noRepeat + epgd.pages.help.getIcon('sTRepeat') + '</label><div class="ui-corner-all week">' + [""].concat(trS.searchFields).join('<input type="checkbox" name="tRFields" />') + '</div></div></div>'
+ + '<div><input type="radio" name="tChExclude" value="1" id="tChExclude0" /><label for="tChInclude">' + tr.chInclude
+ + '</label>' + epgd.pages.help.getIcon('sTChannels') + '<input type="radio" name="tChExclude" value="0" id="tChExclude1" /><label for="tChExclude">' + tr.chExclude
+ + '</label></div><input type="text" id="tChannels" class="full"/>'
+ + '<div class="noTypeS"><label for="tChFormat">' + tr.chFormat + epgd.pages.help.getIcon('sTChFormat') + '</label><input id="tChFormat" readonly onclick="epgd.timerEditChFormat(this)" /></div>'
+ + '<div><label for="tTime"><input type="checkbox" id="tTime" />&nbsp;' + epgd.tr.dateTimePicker.timeText + epgd.pages.help.getIcon('sTime') + '</label></div>');
+ $(form.tWeek[0]).before('<span>' + epgd.tr.dateTimePicker.timeTextBetween + ' <input type="text" id="tStart" style="width:40px" /> - <input type="text" id="tEnd" style="width:40px" /></span>')
+ .parent().append('<br /><span class="onlyTypeS">' + tr.nextDays.replace('$field$','<input style="width:40px" type="text" id="tNextDays" />') + '</span>').insertAfter(form.tTime.parentNode);
+ $([form.tStart,form.tEnd]).timepicker({
+ alwaysSetTime: false
+ });
+ $([form.tTime, form.tRepeat, form.tAdv]).change(function () {
+ $(this).parent().next().toggle(this.checked);
+ });
+ $([form.tSFSeason, form.tSFSPart, form.tSFYear]).change(function () {
+ this.value = this.value.replace(/[^0-9-]/g, '');
+ if (this.value.length == 1 && this.value == '-')
+ this.value = '';
+ });
+ $(form.tType).append('<option value="S">' + epgd.tr.menu.search + '</option>');
+ epgd.utils.addAutoComplete(form.tChannels, { source: epgd.channels.autoCompleteData, multiselect: true });
+ epgd.utils.addAutoComplete(form.tSFCat, { source: epgd.categories, multiselect: true });
+ epgd.utils.addAutoComplete(form.tSFGenre, { source: epgd.genres, multiselect: true });
+};
+epgd.searchTimerDialog.prototype.render = function (t) {
+ t = t || { searchfields: 1 };
+ epgd.searchTimerDialog.base.render.call(this, t);
+ var form = this.form,
+ d, i;
+ form.tExpr.value = t.expression || '';
+ $(form.tSMode).val(t.searchmode || 4);
+ form.tCaseSens.checked = t.casesensitiv == 1;
+ d = t.searchfields || 0;
+ for (i = 0, f = 1; i < form.tSFields.length; i++, f *= 2)
+ form.tSFields[i].checked = (d & f);
+ if (t.starttime || t.endtime || t.weekdays || t.nextdays) {
+ form.tTime.checked = true;
+ t.starttime ? $(form.tStart).datetimepicker('setTime', new Date(0, 0, 0, parseInt(t.starttime / 100, 10), (t.starttime % 100))) : form.tStart.value = '';
+ t.endtime ? $(form.tEnd).datetimepicker('setTime', new Date(0, 0, 0, parseInt(t.endtime / 100, 10), (t.endtime % 100))) : form.tEnd.value;
+ form.tNextDays.value = t.nextdays || '';
+ } else
+ form.tTime.checked = false;
+ $(form.tTime).change();
+ d = t.repeatfields || 0;
+ for (i = 0, f = 1; i < form.tRFields.length; i++, f *= 2)
+ form.tRFields[i].checked = (d & f);
+ form.tRepeat.checked = d > 0;
+ $(form.tRepeat).change();
+
+ form.tSFEpisode.value = t.episodename || '';
+ form.tSFSeason.value = t.season || '';
+ form.tSFSPart.value = t.seasonpart || '';
+ form.tSFYear.value = t.year || '';
+
+ epgd.utils.setAutoCompleteValues(form.tSFCat, new String(t.category).replace(/'/g, '').split(','));
+ epgd.utils.setAutoCompleteValues(form.tSFGenre, new String(t.genre).replace(/'/g, '').split(','));
+ d = t.tipp || '';
+ for (i = 0; i < form.tSFTip.length; i++)
+ form.tSFTip[i].checked = d.indexOf("'" + form.tSFTip[i].value + "'") >= 0;
+ form.tSFNoEpgMatch.checked = t.noepgmatch == 1;
+
+ form.tAdv.checked = t.episodename || t.season || t.seasonpart || t.year || t.category || t.genre || t.tipp || t.noepgmatch;
+ $(form.tAdv).change();
+ epgd.utils.setAutoCompleteValues(form.tChannels, new String(t.channelids).split(','));
+
+ if (t.chexclude)
+ form.tChExclude1.checked = 1;
+ else
+ form.tChExclude0.checked = 1;
+ form.tChFormat.value = t.chformat || (t.id ? '' : epgd.profile.chFormat);
+ form.tNameMode.defaultIndex = parseInt(t.category == 'Serie' ? epgd.profile.namingModeSearchSerie : epgd.profile.namingModeSearchMovie, 10);
+ form.tNameMode.selectedIndex = t.namingmode || form.tNameMode.defaultIndex;
+ form.tTemplate.value = t.template || (t.category == 'Serie' ? epgd.profile.namingModeSearchSerieTemplate : epgd.profile.namingModeSearchMovieTemplate);
+ $(form.tNameMode).change();
+ this.$win.parent().find('#tBCopy').toggle(!!t.id);
+};
+epgd.searchTimerDialog.prototype.getData = function (dontValid) {
+ var form = this.form,
+ d, i,
+ data = { expression: form.tExpr.value };
+ if (form.tSFSeason.value) data.season = form.tSFSeason.value;
+ if (form.tSFSPart.value) data.seasonpart = form.tSFSPart.value;
+ if (form.tSFYear.value) data.year = form.tSFYear.value;
+ if (!dontValid) {
+ if (!data.expression)
+ return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.pages.search.searchExpression), form.tExpr);
+ if (data.season && !/^[0-9]{0,3}-?[0-9]{0,3}$/.test(data.season))
+ return this.showError(epgd.tr.error.invalid, form.tSFSeason);
+ if (data.seasonpart && !/^[0-9]{0,3}-?[0-9]{0,3}$/.test(data.seasonpart))
+ return this.showError(epgd.tr.error.invalid, form.tSFSPart);
+ if (data.year && !/^((19|20)[0-9]{2})?(-|-(19|20)[0-9]{2})?$/.test(data.year))
+ return this.showError(epgd.tr.error.invalid, form.tSFYear);
+ }
+ if (form.tID.value) data.id = parseInt(form.tID.value, 10);
+ if (form.tSFEpisode.value) data.episodename = form.tSFEpisode.value;
+ data.category = epgd.utils.getAutoCompleteValues(form.tSFCat, "'");
+ data.genre = epgd.utils.getAutoCompleteValues(form.tSFGenre, "'");
+ d = '';
+ for (i = 0; i < form.tSFTip.length; i++)
+ if (form.tSFTip[i].checked) d += ",'" + form.tSFTip[i].value + "'";
+ data.tipp = d.slice(1);
+ data.noepgmatch = form.tSFNoEpgMatch.checked ? 1 : 0;
+
+ data.searchmode = parseInt($(form.tSMode).val(), 10);
+ data.searchfields = 0;
+ for (i = 0, f = 1; i < form.tSFields.length; i++, f *= 2)
+ if (form.tSFields[i].checked)
+ data.searchfields += f;
+ data.casesensitiv = form.tCaseSens.checked ? 1 : 0;
+ data.repeatfields = 0;
+ if (form.tRepeat.checked) {
+ for (i = 0, f = 1; i < form.tRFields.length; i++, f *= 2)
+ if (form.tRFields[i].checked)
+ data.repeatfields += f;
+ }
+ data.active = form.tInactive.checked ? 0 : 1;
+
+ data.channelids = epgd.utils.getAutoCompleteValues(form.tChannels);
+ data.chformat = form.tChFormat.value;
+ data.chexclude = form.tChExclude1.checked ? 1 : 0;
+ if (form.tTime.checked) {
+ data.starttime = parseInt(form.tStart.value.replace(':', ''), 10);
+ data.endtime = parseInt(form.tEnd.value.replace(':', ''), 10);
+ data.weekdays = 0;
+ for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2)
+ if (form.tWeek[i].checked)
+ data.weekdays += f;
+ }
+ data.vps = form.tVPS.checked ? 1 : 0;
+ if (form.tPrio.value) data.priority = parseInt(form.tPrio.value, 10);
+ if (form.tLife.value) data.lifetime = parseInt(form.tLife.value, 10);
+ //if (form.t) data.childlock = form.t;
+ data.directory = form.tFolder.value;
+ d = $(form.tVdr).val();
+ if (d) data.vdruuid = d;
+ //if (!dontValid || form.tNameMode.defaultIndex != form.tNameMode.selectedIndex)
+ data.namingmode = form.tNameMode.selectedIndex;
+ data.template = form.tTemplate.value;
+ data.type = $(form.tType).val();
+ if (data.type == 'V' && !d && !dontValid)
+ return this.showError(epgd.tr.error.emptyField.replace("$field$", "VDR"), form.tVdr);
+ data.name = form.tSName.value;
+ if (form.tNextDays.value) data.nextdays = parseInt(form.tNextDays.value,10);
+ return data;
+}
+epgd.searchTimerDialog.prototype.save = function (d, url, failFunc, succFunc) {
+ d = d || this.getData();
+ var self = this,
+ id= d.id,
+ name= d.name;
+ d.max = 0;
+ d.id && delete d.id;
+ d.name && delete d.name;
+ epgd.utils.loader.process(function () {
+ epgd.ajax({
+ url: epgd.login.url + "data/search",
+ type: 'post',
+ data: JSON.stringify(d)
+ }, function (data) {
+ d.id = id;
+ d.name = name;
+ if (data.count > 50) {
+ epgd.utils.confirm(epgd.tr.pages.timerList.confirmSaveBigResult.replace('$cnt$', data.count), function (ok) {
+ ok && epgd.searchTimerDialog.base.save.call(self, d);
+ });
+ } else
+ epgd.searchTimerDialog.base.save.call(self, d, url, failFunc, succFunc);
+ epgd.utils.loader.close();
+ });
+ },true);
+}
+// Suche - Klasse
+epgd.searchDialog = epgd.utils.inherits(function () {
+ epgd.searchTimerDialog.call(this, {
+ id: 'search',
+ embed: true,
+ buttons: null
+ });
+ this.searchResultList = new epgd.searchResultList({
+ empty: epgd.tr.pages.search.empty
+ }, this);
+}, epgd.searchTimerDialog);
+epgd.searchDialog.prototype.create = function () {
+ epgd.searchDialog.base.create.call(this);
+ var form = this.form,
+ search= this,
+ $result = $('<div id="searchResult"></div>').appendTo(this.$win);
+ $('<button type="submit" id="sSearch" class="iAsButton i-search">' + epgd.tr.pages.search.search + '</button>')
+ .insertAfter(form.tExpr)
+ .after(' <input type="checkbox" id="sAdv" />&nbsp;<label for="sAdv">' + epgd.tr.advanced + '</label>');
+ $(form.tType).parent().hide().parent().css('border-top','1px solid #ccc').insertAfter($(form.tVdr.parentNode.parentNode).hide());
+ $('<input type="button" class="iAsButton" id="tCopy" value="' + epgd.tr.copy + '" />').insertAfter(form.tSName).click(function () {
+ search.form.tID.value = '';
+ search.form.tSName.value += ' copy';
+ search.form.tSName.select();
+ }).prop("disabled", true);
+ $('<input type="button" class="iAsButton" id="tDel" value="' + epgd.tr.del + '" />').insertAfter(form.tSName).click(function () {
+ search.list.del(this.form.tID.value, function () { search.form.tID.value = '';search.loadSavedSearch() });
+ }).prop("disabled", true); $('<input type="button" class="iAsButton" value="' + epgd.tr.save + '" />').insertAfter(form.tSName).click(function () {
+ var d = search.getData();
+ if (!d.name)
+ return this.showError(epgd.tr.error.invalid, form.tSName);
+ search.save(d, null, null, function () { search.loadSavedSearch() });
+ });
+ $(form).submit(function () {
+ search.search($result);
+ return false;
+ });
+ this.$win.find('#sExpr').keyup(function (ev) { if (ev.keyCode == 13) { this.form.sSearch.click(); $(this).blur(); } }).focus();
+ //$(form.tExpr).parent().next().nextAll().wrapAll('<div id="sAdvView"/>');
+ this.$win.find('#sAdv').change(function () {
+ $(form).toggleClass("noAdv", !this.checked);
+ search.resize();
+ }).prop('checked', epgd.profile.searchAdv == "1").change();
+ $(form.tSName).autocomplete({
+ minLength: 0,
+ maxHeight: 300,
+ source:function(){return false}, // damit bei einem focus kein error ausgelst wird
+ select: function (ev, ui) {
+ var d = ui.item.data || { id: '' };
+ if (d.id) {
+ search.render(d);
+ search.form.sSearch.click();
+ $([form.tDel, form.tCopy, form.tInactive]).prop("disabled", false);
+ return false;
+ } else {
+ form.tID.value = '';
+ $([form.tDel, form.tCopy, form.tInactive]).prop("disabled", true);
+ }
+ }
+ }).focus(function () {
+ $(this).autocomplete("search", "");
+ });
+ this.loadSavedSearch();
+}
+epgd.searchDialog.prototype.loadSavedSearch = function () {
+ var form = this.form;
+ epgd.ajax({ url: epgd.login.url + "data/searchtimers?type=S" }, function (data) {
+ var list = [];
+ $.each(data.searchtimers, function (id, t) {
+ list.push({ value: t.name || t.expression, label: t.name || t.expression, data: t });
+ });
+ $(form.tSName).autocomplete("option", "source", list);
+ });
+}
+epgd.searchDialog.prototype.resize = function () {
+ var $result = this.$win.find('#searchResult'),
+ h = $(window).height() - $result.offset().top - 20;
+ if (h < 100)
+ $result.css({ 'height': 'auto', 'overflow-y': 'visible' });
+ else
+ $result.css({ 'height': h + 'px', 'overflow-y': 'auto' });
+}
+epgd.searchDialog.prototype.render = function (t) {
+ if (!epgd.$con.find('#search').length) {
+ $('#menu_search').addClass("menu-active");
+ this.create();
+ epgd.$con.html('');
+ this.$win.appendTo(epgd.$con);
+ }
+ t = t || { searchfields: 1 };
+ t.type = 'S';
+ epgd.searchDialog.base.render.call(this, t);
+}
+epgd.searchDialog.prototype.close = function () { }
diff --git a/http/src/js/channels.js b/http/src/js/channels.js
new file mode 100644
index 0000000..add3035
--- /dev/null
+++ b/http/src/js/channels.js
@@ -0,0 +1,46 @@
+epgd.channels = {
+ list: null,
+ autoCompleteData: null,
+ isDirty: false,
+ selBox: $('<select id="selChannel"></select>')[0],
+ load: function () {
+ if (!this.list || this.isDirty) {
+ epgd.ajax({ url: epgd.login.url + "data/channels", async: false, cache: false},function (data) {
+ var logoPath = (epgd.profile.channelLogoPath ? epgd.profile.channelLogoPath + '?maxW=70&maxH=50&id=' : false),
+ channelOpt = '',
+ list = {},
+ ac_data = [];
+ data.channels && $.each(data.channels, function (i, channel) {
+ var id = channel.channelid || i;
+ if (channel.name) {
+ channel.html = '<div class="channel" id="' + id + '">' + (logoPath ? '<img src="' + logoPath + id + '" alt="' + channel.name + '" />'
+ + '<i class="i-tv" title="' + epgd.tr.pages.eventDetail.ch_switch + '" />'
+ + (epgd.profile.logoShowName == "1" ? channel.name : '') : channel.name) + '</div>';
+ channel.visible & 1 && (channelOpt += '<option value="' + id + '">' + channel.name + '</option>');
+ }
+ else {
+ channel.html = '<div class="channel" id="' + id + '">'
+ + '<i class="i-tv" title="' + epgd.tr.pages.eventDetail.ch_switch + '" />' + id + '</div>';
+ channel.visible & 1 && (channelOpt += '<option value="' + id + '">' + id + '</option>');
+ }
+ list[id] = channel;
+ ac_data.push({ label: channel.name, value: id });
+ });
+ epgd.channels.list = list;
+ epgd.channels.autoCompleteData= ac_data;
+ $(epgd.channels.selBox).html(channelOpt);
+ $(window).trigger('channels_load');
+ this.dirty = false;
+ });
+ }
+ },
+ getHtml: function (id) {
+ var ch = this.list[id];
+ return ch ? ch.html : '<div class="channel" id="' + id + '">'
+ + '<i class="i-tv" title="' + epgd.tr.pages.eventDetail.ch_switch + '" />' + id + '</div>';
+ },
+ getName: function (id) {
+ var ch = this.list[id];
+ return ch ? ch.name : id;
+ }
+};
diff --git a/http/src/js/epgd b/http/src/js/epgd
new file mode 100644
index 0000000..8673096
--- /dev/null
+++ b/http/src/js/epgd
@@ -0,0 +1,3 @@
+var epgd = {
+ pages: {}
+};
diff --git a/http/src/js/eventDetail.js b/http/src/js/eventDetail.js
new file mode 100644
index 0000000..8ff8548
--- /dev/null
+++ b/http/src/js/eventDetail.js
@@ -0,0 +1,523 @@
+epgd.eventDetail = function (id) {
+ this.id = id;
+ this.data = null;
+ this.expire = 0;
+}
+epgd.eventDetail.prototype.imgPath = false;
+epgd.eventDetail.prototype.load = function (channelId, time) {
+ var self = this;
+ epgd.ajax({
+ url: epgd.login.url + "data/event?" + (channelId && time ? "channelid=" + channelId + "&time=" + time : "id=" + this.id), async: false, cache: false
+ }, function (data) {
+ self.data = data.event; self.id = data.id; self.expire = epgd.utils.now().getTime() + 900000;
+ }); //15*60*1000
+ return this;
+}
+epgd.eventDetail.prototype.render = function () {
+ if (this.expire < epgd.utils.now().getTime())
+ this.load();
+ if (!this.data)
+ return '';
+ this.win.render(this);
+};
+epgd.eventDetail.prototype.doRecord = function (eData) {
+ if (eData === true) return epgd.tr.pages.eventDetail.record; // eData = getTitle
+ eData = eData || this.data;
+ var tData = {
+ id: eData.timerid,
+ eventid: eData.id,
+ channelid: eData.channelid,
+ title: eData.title,
+ evStartTime: eData.starttime,
+ evDuration: eData.duration,
+ category: eData.category,
+ shorttext: eData.shorttext,
+ expression: eData.title
+ };
+ if (tData.eventid)
+ epgd.pages.timerList.dialog.render(tData);
+ else
+ epgd.pages.searchTimerList.dialog.render(tData);
+}
+epgd.eventDetail.prototype.doRepeat = function (checkAvail) {
+ if (checkAvail) return true;
+ var win = this.win,
+ $repeatHdl = win.$con.find('.repeat'),
+ searchData;
+ if (!$repeatHdl.length) {
+ if (!this.searchResultList) {
+ this.searchResultList = new epgd.searchResultList(null, {
+ resize: function () {
+ win.$con.last().find('td[data-evId="' + win.detail.data.id + '"]').parent().remove();
+ win.$con.accordion("refresh");
+ $repeatHdl.click();
+ }
+ });
+ }
+ $repeatHdl = $('<h3 class="repeat">' + epgd.tr.pages.eventDetail.repeat + '</h3>').appendTo(win.$con);
+ searchData = { searchfields: 1, expression: this.data.title, searchmode: 1, casesensitiv: 1, fromEventDetail: true };
+ if (this.data.shorttext) {
+ searchData.searchfields1= 2;
+ searchData.expression1 = this.data.shorttext;
+ }
+ epgd.pages.search.search.call(this, $('<div class="desc"></div>').appendTo(win.$con), searchData);
+ } else
+ $repeatHdl.click();
+}
+epgd.eventDetail.prototype.doPlay = function (checkAvail) {
+ var t = parseInt(epgd.utils.now().getTime() / 1000, 10) - this.data.starttime;
+ if (t < 0 || t > this.data.duration)
+ return false;
+ if (checkAvail) return true;
+ epgd.vdrs.current.switchChannel(this.data.channelid);
+}
+epgd.eventDetail.prototype.doPrev = function (checkAvail) {
+ var t = this.data.starttime - 500,
+ self = this;
+ if (t < epgd.profile.minEventTime)
+ return false;
+ if (checkAvail) return true;
+ epgd.utils.loader.process(function () {
+ new epgd.eventDetail().load(self.data.channelid, t).render();
+ });
+}
+epgd.eventDetail.prototype.doNext = function (checkAvail) {
+ var t = this.data.starttime + this.data.duration + 500,
+ self = this;
+ if (t > epgd.profile.maxEventTime)
+ return false;
+ if (checkAvail) return true;
+ epgd.utils.loader.process(function () {
+ new epgd.eventDetail().load(self.data.channelid, t).render();
+ });
+}
+
+epgd.eventDetail.win = function () {
+ this._create();
+ this.closed = true;
+ this.detail = null;
+ var win = this;
+ $(window).bind("epgd_close.eventDetail", function () {
+ if (!win.closed) {
+ //win.$win.css('left', '');
+ win.$win.css('z-Index', '');
+ win.$win.hide();
+ $(document).unbind("keyup.eventDetail");
+ win.closed = true;
+ win.$openDialogs && win.$openDialogs.removeClass("ui-state-disabled");
+ }
+ });
+ $(window).bind("resize.eventDetail", function (ev) {
+ if (!win.closed) {
+ try {
+ win.$win.css("max-width", $(window).width());
+ win.$win.show().position({ of: window });
+ win.$con.accordion("refresh");
+ } catch (e) { }
+ if (parseInt(win.$win.css('top'), 10) < 69)
+ win.$win.css('top', '69px');
+ };
+ });
+}
+epgd.eventDetail.win.prototype._create = function () {
+ this.imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=270&maxH=146&id=' : false;
+ this.movieImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?actor_id=0&movie_id=' : false;
+ this.movieActorImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?maxW=60&maxH=90&media_type=4&actor_id=' : false;
+ this.serieImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?actor_id=0&series_id=' : false;
+ this.serieActorImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?maxW=60&maxH=90&season_number=0&episode_id=0&media_type=11&actor_id=' : false;
+
+ this.$win = $('<div id="eventDetail" class="ui-front">'
+ + '<div class="ui-front ui-widget ui-widget-content ui-corner-all" style="position:absolute;width:100%;height:100%">'
+ + '<div class="toolbar ui-widget-header ui-corner-all"></div>'
+ + '<div></div>'
+ + '</div>'
+ + '<div class="ui-widget ui-widget-shadow ui-corner-all" style="position:absolute;width:100%;height:100%"></div>'
+ + '</div>').appendTo(document.body);
+ this.$con = this.$win.find(':first :last');
+ var win = this,
+ tr = epgd.tr.pages.eventDetail,
+ toolbar = this.$win.find('.toolbar')[0];
+ this.$rec= $('<button class="iAsButton i-record"/>').css('float', 'left').appendTo(toolbar).click(function () { win.detail.doRecord() });
+ $('<button class="iAsButton i-buffer" title="' + tr.repeat + '" />').css('float', 'left').appendTo(toolbar).click(function () { win.detail.doRepeat() });
+ this.$play = $('<button class="iAsButton i-tv" title="' + tr.ch_switch + '" />').css('float', 'left').appendTo(toolbar).click(function () { win.detail.doPlay() });
+ this.$prev = $('<button class="iAsButton i-rewind" title="' + tr.eventPrev + '" />').appendTo(toolbar).click(function () { win.detail.doPrev() });
+ this.$next = $('<button class="iAsButton i-forward" title="' + tr.eventNext + '" />').appendTo(toolbar).click(function () { win.detail.doNext() });
+ $('<button class="iAsButton i-cancel" title="' + epgd.tr.close + '" />').css('float', 'right').appendTo(toolbar).click(function () { $(window).trigger("epgd_close.eventDetail"); });
+}
+
+epgd.eventDetail.win.prototype.render = function (detail) {
+ this.detail = detail;
+ var e = detail.data,
+ tr = epgd.tr.pages.eventDetail,
+ progress = ((parseInt(epgd.utils.now().getTime() / 1000, 10) - e.starttime) / e.duration * 100),
+ stars = '',
+ ep = e.episode || {},
+ desc = e.longdescription ? '<div title="longdescription">' + e.longdescription + '</div>' : '',
+ extInfo = '',
+ actors = null,
+ mainImg = (this.imgPath && e.imagecount ? this.imgPath + e.id : ''),
+ firstImg = null,
+ constTitle= ep.episodename || e.title,
+ isMobile = $(window).width() < 500,
+ terms, i, sc, actor, info1, info2,
+ recordings= '';
+ if (e.cntlongdescription)
+ desc += '<hr><div title="cntlongdescription">' + e.cntlongdescription + '</div>';
+ if (e.rating) {
+ terms = e.rating.slice(e.rating.indexOf('/')).split(' ');
+ for (i = 1; i < terms.length; i += 3)
+ stars += terms[i] + '<div class="stars' + terms[i + 1].length + '"> </div>';
+ }
+
+ extInfo = "";
+ for (i in tr.extInfo)
+ if (e[i]) extInfo += '<tr><th>' + tr.extInfo[i] + '</th><td>' + e[i] + '</td></tr>';
+
+ if (e.scraper && (sc = e.scraper.movie || e.scraper.serie)) {
+ sc.media = sc.media || [];
+ if (sc.actors) {
+ actors = '';
+ for (i in sc.actors) {
+ actor = sc.actors[i];
+ actors += '<div>' + (this.movieActorImgPath && actor.actorid ? '<img src="' + this.movieActorImgPath + actor.actorid + '" />' : '')
+ + '<a href="' + epgd.profile.movieActorPath + actor.actorid + '" target="_blank">' + actor.actorname + '</a>' + (actor.actorrole || '') + '</div>';
+ }
+ }
+ if (e.scraper.movie) {
+ sc.isMovie= true;
+ if ( sc.media && this.movieImgPath){
+ if (!mainImg && sc.media["1"])
+ mainImg = this.movieImgPath + sc.movieid + '&media_type=1&maxW=270&maxH=146';
+ if (sc.media["3"])
+ firstImg = this.movieImgPath + sc.movieid + '&media_type=3&maxW=400&maxH=999';
+ else if (sc.media["1"])
+ firstImg = this.movieImgPath + sc.movieid + '&media_type=1&maxW=400&maxH=999';
+ }
+
+ if (sc.actors) {
+ actors = '';
+ for (i in sc.actors) {
+ actor = sc.actors[i];
+ actors += '<div>' + (this.movieActorImgPath ? '<img src="' + this.movieActorImgPath + i + '" />' : '')
+ + '<a href="' + epgd.profile.movieActorPath + i + '" target="_blank">' + actor.actorname + '</a>' + (actor.actorrole || '') + '</div>';
+ }
+ }
+ if (sc.overview)
+ desc = '<div title="overview">' + sc.overview + "</div><hr />" + desc;
+
+ /* 0=mmPoster, 1=mmFanart, 2=mmCollectionPoster, 3=mmCollectionFanart, 4=mmActorThumb, 5=mmPosterThumb */
+ extInfo = '<h3><span>' + tr.scrapperMovieInfo + '</span></h3><div>'
+ + '<table class="colFull">'
+ + (sc.media["1"] && this.movieImgPath ? '<tr><th colspan="2"><img src="' + this.movieImgPath + sc.movieid + '&media_type=1&maxW=397&maxH=400" /></th></tr>' : '')
+ + (sc.title ? '<tr><th>' + tr.title + '</th><td>' + sc.title + '</td></tr>' : '')
+ + (sc.originaltitle ? '<tr><th>' + tr.original_title + '</th><td>' + sc.originaltitle + '</td></tr>' : '')
+ + (sc.runtime ? '<tr><th>' + tr.runtime + '</th><td>' + sc.runtime + ' ' + epgd.tr.minutes + '</td></tr>' : '')
+ + (sc.movie_release_date ? '<tr><th>' + tr.release_date + '</th><td>' + sc.movie_release_date + '</td></tr>' : '')
+ + (sc.genres ? '<tr><th>' + tr.genre + '</th><td>' + sc.genres.replace(/^\||\|$/g, '').replace(/ ?\| ?/g, ', ') + '</td></tr>' : '')
+ + (sc.voteaverage ? '<tr><th>' + tr.vote_average + '</th><td class="stars"><div class="stars5" style="width:' + parseInt(sc.voteaverage * 8, 10) + 'px"></div> (' + sc.voteaverage.toFixed(1) + ' / 10)</td></tr>' : '')
+ + (sc.popularity ? '<tr><th>' + tr.popularity + '</th><td>' + sc.popularity.toFixed(1) + '</td></tr>' : '')
+ + extInfo
+ + (sc.budget ? '<tr><th>Budget</th><td>$' + sc.budget + '</td></tr>' : '')
+ + (sc.revenue ? '<tr><th>Einnahmen</th><td>$' + sc.revenue + '</td></tr>' : '')
+ + (sc.homepage ? '<tr><th>' + tr.homepage + '</th><td><a href="' + sc.homepage + '">' + sc.homepage + '</a></td></tr>' : '')
+ + '</table>'
+ + (sc.media["0"] && this.movieImgPath ? '<img class="poster" src="' + this.movieImgPath + sc.movieid + '&media_type=0&maxW=390&maxh=999" />' : '');
+ } else {
+ sc.isSerie = true;
+ /*0=msBanner1, 1=msBanner2, 2=msBanner3, 3=msPoster1, 4=msPoster2, 5=msPoster3, 7=msFanart1,8=msFanart2, 9=msFanart3,
+ 6=msSeasonPoster, 10=msEpisodePic,
+ 11=msActorThumb, 12=msPosterThumb, 13=msSeasonPosterThumb, */
+ if (sc.actors) {
+ actors = '';
+ for (i in sc.actors) {
+ actor = sc.actors[i];
+ actors += '<div>' + (this.serieActorImgPath ? '<img src="' + this.serieActorImgPath + i + '&series_id=' + sc.seriesid + '" />' : '')
+ + '<a>' + actor.actorname + '</a>' + (actor.actorrole ? actor.actorrole.replace(/\|/g, '<br />') : '') + '</div>';
+ }
+ }
+ terms = sc.episode;
+ if (terms) {
+ if (terms.episodeoverview){
+ if ( e.longdescription && terms.episodeoverview.length > e.longdescription.length)
+ desc = desc.replace(/^<div.+<\/div>/i, '');
+ desc= '<div title="episodeoverview">' + terms.episodeoverview + '</div>' + desc;
+ }
+ desc = '<h5>' + terms.episodename + '</h5>' + desc;
+ if (terms.episodegueststars)
+ actors += '</div><div class="colFull actors"><h5>' + tr.gueststars + '</h5><br />' + terms.episodegueststars.replace(/^\||\|$/g, '').replace(/\|/g, '<br />');
+ }
+ if (!mainImg && sc.media["10"] && this.serieImgPath)
+ mainImg = this.serieImgPath + sc.seriesid + '&season_number=' + terms.seasonnumber + '&episode_id=' + terms.episodeid + '&media_type=10&maxW=270&maxH=146';
+ if (sc.media["7"])
+ firstImg = this.serieImgPath + sc.seriesid + '&season_number=0&episode_id=0&media_type=7&maxW=400&maxh=999';
+ if (sc.seriesoverview)
+ desc += desc ? '<hr /><a href="#" onclick="return !$(this).next().toggle()">Serienbeschreibung</a><div style="display:none" title="seriesoverview">' + sc.seriesoverview + "</div>" : '<div>' + sc.seriesoverview + '</div>';
+ extInfo = '<h3><span>' + tr.scrapperSerieInfo + '</span></h3><div>'
+ + '<table class="colFull">'
+ + (sc.media["1"] && this.serieImgPath ? '<tr><th colspan="2"><img src="' + this.serieImgPath + sc.seriesid + '&season_number=0&episode_id=0&media_type=1&maxW=397&maxH=250" /></th></tr>' : '')
+ + (sc.media["10"] && this.serieImgPath ? '<tr><th colspan="2"><img src="' + this.serieImgPath + sc.seriesid + '&season_number=' + terms.seasonnumber + '&episode_id=' + terms.episodeid + '&media_type=10&maxW=397&maxH=400" /></th></tr>' : '')
+ + (sc.seriesname ? '<tr><th>' + tr.title + '</th><td>' + sc.seriesname + '</td></tr>' : '')
+ + (sc.seriesnetwork ? '<tr><th>' + tr.network + '</th><td>' + sc.seriesnetwork + '</td></tr>' : '')
+ + (sc.seriesstatus ? '<tr><th>' + tr.seriesstatus + '</th><td>' + sc.seriesstatus + '</td></tr>' : '')
+ + (sc.seriesfirstaired ? '<tr><th>' + tr.release_date + '</th><td>' + sc.seriesfirstaired + '</td></tr>' : '')
+ + (sc.seriesgenre ? '<tr><th>' + tr.genre + '</th><td>' + sc.seriesgenre.replace(/^\||\|$/g, '').replace(/ ?\| ?/g, ', ') + '</td></tr>' : '')
+ + (sc.seriesrating ? '<tr><th>' + tr.vote_average + '</th><td class="stars"><div class="stars5" style="width:' + parseInt(sc.seriesrating * 8, 10) + 'px"></div> (' + sc.seriesrating.toFixed(1) + ' / 10)</td></tr>' : '')
+ + extInfo
+ + (epgd.profile.serieSeasonPath ? '<tr><td colspan="2"><a href="' + epgd.profile.serieSeasonPath + sc.seriesid + '" target="_blank">' + tr.homepage + '</a></td></tr>' : '')
+ + '</table>'
+ + (sc.media["6"] && this.serieImgPath ? '<img class="poster" src="' + this.serieImgPath + sc.seriesid + '&season_number=' + terms.seasonnumber + '&episode_id=0&media_type=6&maxW=390&maxh=999" />' : '')
+ + (sc.media["3"] && this.serieImgPath ? '<img class="poster" src="' + this.serieImgPath + sc.seriesid + '&season_number=0&episode_id=0&media_type=3&maxW=390&maxh=999" />' : '');
+ }
+ } else {
+ sc = {};
+ extInfo = '<h3><span>' + tr.extentedInfo + '</span></h3><div><table class="colFull">'
+ + '<tr><th>' + tr.title + '</th><td>' + e.title + '</td></tr>'
+ + (ep.partname ? '<tr><th>' + tr.part + '</th><td>' + ep.partname + '</td></tr>' : '')
+ + (e.year ? '<tr><th>' + tr.release_date + '</th><td>' + e.year + '</td></tr>' : '')
+ + (ep.lang ? '<tr><th>' + tr.lang + '</th><td>' + ep.lang + '</td></tr>' : '')
+ + extInfo
+ + '</table>';
+ }
+ if (!actors && e.actor)
+ actors = e.actor.replace(/, /g, '<br />');
+ actors && (extInfo += '<div class="colFull actors"><h5>' + tr.actors + '</h5>' + actors + '</div>');
+ extInfo && (extInfo += '</div>');
+
+ info1 = (e.path ? epgd.tr.pages.timerList.folder + '<br />' + e.path.replace(/\//g, ' / ') + '<br />' : '')
+ + (e.genre ? (tr.genre + '<b>' + e.genre + '</b><br />') : '')
+ + (e.category ? tr.category + '<b>' + e.category + '</b><br />' : '')
+ + (e.country ? tr.country + '<b>' + e.country + '</b><br />' : '')
+ + (e.year ? tr.year + '<b>' + e.year + '</b><br />' : '');
+ info2 = (ep.part ? tr.part + '<b>' + ep.part + (ep.parts ? ' / ' + ep.parts + '' : '') + '</b><br />' : '')
+ + (ep.season ? tr.season + '<b>' + ep.season + '</b><br />' : '')
+ + (ep.number ? tr.number + '<b>' + ep.number + '</b><br />' : '');
+
+ /*
+ e.recordings = [
+ {
+ "matchdensityshorttext": 12,
+ "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014",
+ "name": "Star Wars: Episode III - Die Rache der Sith",
+ "duration": 10736,
+ "path": "Die_Biene_Maja/S03E04/2014-03-23.06.53.29-0.rec",
+ "md5path": "f6abd21ea13f52626723b3321c7a8c42",
+ "matchdensitytitle": 68,
+ "starttime": 1395553980,
+ "title": "Star Wars: Episode III - Die Rache der Sith",
+ "shorttext": "Science-Fiction (USA 2005)"
+ },
+ {
+ "matchdensityshorttext": 48,
+ "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014",
+ "name": "Star Wars: Das Erwachen der Macht",
+ "duration": 8783,
+ "path": "Das_Traumhotel/2016-05-15.18.28.64-0.rec",
+ "md5path": "0279b0d04b68e891ef2b7e6d8bcdd059",
+ "matchdensitytitle": 70,
+ "starttime": 1463329680,
+ "title": "Star Wars: Das Erwachen der Macht",
+ "sho__rttext": "Star Wars - Episode VII: The Force Awakens"
+ }
+ ];
+ */
+
+ if (e.recordings)
+ for (i in e.recordings) {
+ terms= e.recordings[i];
+ recordings += '<div class="rec" data-start="' + terms.starttime + '" data-owner="' + (terms.owner || '')
+ + '" data-md5="' + terms.md5path + '" data-path="' + terms.path + '">'
+ + '<em>' + epgd.utils.formatDateTime(terms.starttime) + '</em><u>' + parseInt(terms.duration / 60, 10) + ' ' + epgd.tr.minutes
+ + '</u><b onclick="new epgd.recordDetail(this.parentNode).render()">'
+ + '<div class="progress" title="' + terms.matchdensitytitle + '% ' + epgd.tr.pages.search.matchdensity + '"><div style="width:' + terms.matchdensitytitle + '%" ></div></div>' + terms.title
+ + (terms.shorttext ? '<i><div class="progress" title="' + terms.matchdensityshorttext + '% ' + epgd.tr.pages.search.matchdensity + '"><div style="width:' + terms.matchdensityshorttext + '%" ></div></div>' + terms.shorttext + '</i>' : '')
+ + '</b></div>';
+ }
+
+ this.$con = $('<div><h3><div class="date">' + $.datepicker.formatDate(isMobile ? 'd. M y' : 'd. MM yy', epgd.utils.date(e.starttime)) + '</div>'
+ + (isMobile ? '' : e.title) + '<div class="time"><b>'
+ + epgd.utils.formatTime(e.starttime) + '</b>&nbsp;&ndash;&nbsp;' + epgd.utils.formatTime(e.starttime + e.duration)
+ + ' ' + epgd.tr.oClock + '&nbsp;|&nbsp;' + parseInt(e.duration / 60, 10) + ' ' + epgd.tr.minutes + '</div></h3>'
+ + '<div>'
+ + '<div class="colFull">'
+ + '<div class="imgBox">' + (mainImg ? '<img src="' + mainImg + '" />' : '') + '</div>'
+ + '<div class="chPrFl">'
+ + epgd.channels.getHtml(e.channelid)
+ + (progress > 0 && progress <= 100 ? '<div class="progress"><div style="width: ' + progress + '%"></div></div>' : '')
+ + '<div class="audio">'
+ + (e.flags && e.flags.indexOf('16:9') > 0 ? '<span class="a-169"></span>' : '')
+ + (e.audio && e.audio.indexOf('DolbyDigital') >= 0 ? '<span class="a-dd" title="DolbyDigital"></span>' : '')
+ + (e.flags && e.flags.indexOf('Live') > 0 ? 'Live' : '')
+ + (e.parentalrating ? '<div class="parRate' + e.parentalrating + '">' + tr.parentalrating + e.parentalrating + '</div>' : '')
+ + '</div>'
+ + (e.merge ? '<div>' + tr.mergeSrc + e.merge + '</div>' : '')
+ + '</div>'
+ + (stars ? '<div class="stars">' + stars + '</div>' : '')
+ + '<div class="col2">'
+ + e.title + (ep.partname ? '<br /><i>' + ep.partname + '</i>' : (e.shorttext ? '<br /><i>' + e.shorttext + '</i>' : ''))
+ + '</div><div class="col2 rate rate' + (e.numrating || '0') + '">'
+ + (e.tipp ? '<b class="tipp">' + e.tipp + '</b>' : '')
+ + (e.txtrating ? '<span>' + e.txtrating + '</span>' : '')
+ + (e.shortreview || '')
+ + '</div>'
+ + (info1 ? '<div class="info">' + info1 + '</div>': '')
+ + (info2 ? '<div class="info">' + info2 + '</div>' : '')
+ + (firstImg ? '<img src="' + firstImg + '" />' : '')
+ + '</div>'
+ + '<div class="colFull desc">' + (desc ? desc.replace(/\n/g, '<br />') : '') + '</div>'
+ + '</div>'
+ + extInfo
+ + (e.category == 'Serie' || sc.isSerie ? '<h3 data-conti="' + constTitle + '"><span>' + tr.constabelInfo + '</span></h3><div class="desc">'
+ + '<a class="iAsButton i-edit" href="' + epgd.profile.constabelEditPath + encodeURIComponent(constTitle) + '.episodes' + '" target="constabel">' + epgd.tr.edit + '</a>'
+ + '<a class="iAsButton i-link-ext" href="' + epgd.profile.constabelLinkPath + encodeURIComponent(constTitle) + '" target="constabel">' + epgd.tr.pages.eventDetail.addConstableLink + '</a>'
+ + epgd.pages.help.getButton('constabel',true)
+ + (epgd.profile.constabelLoginPath ? '<a class="iAsButton i-login" href="' + epgd.profile.constabelLoginPath + '" target="constabel">' + epgd.tr.pages.eventDetail.loginConstable + '</a>' : '')
+ + '<pre id="cRaw"></pre>'
+ + '</div>'
+ : '')
+ + (recordings ? '<h3><span>' + epgd.tr.menu.records + '</span></h3><div class="recordings">' + recordings + '</div>' : '')
+ + '</div>').replaceAll(this.$con);
+ this.$con.accordion({
+ heightStyle: "fill",
+ header: "h3",
+ active: 0,
+ beforeActivate: function(ev, ui){
+ if (ui.newHeader.attr('data-conti')) {
+ epgd.utils.loader.process(function () {
+ epgd.ajax({ url: epgd.login.url + 'data/proxy?id=constabel&title=' + encodeURIComponent(encodeURIComponent(ui.newHeader.attr('data-conti'))) + '&_' + new Date().getTime(), dataType: "html", contentType: "text/plain; charset=utf-8" }, function (data) {
+ if (data.indexOf('Error:') == -1) {
+ var $pre = ui.newPanel.find('#cRaw'),
+ thead = '<thead><tr><th>' + tr.season + '</th><th>' + tr.part + '</th><th>' + tr.number + '</th><th>' + tr.title + '</th>',
+ tbody = '<tbody>',
+ lines = data.split(/\r?\n/),
+ line, m, i;
+ for (i = 0; i < lines.length; i++) {
+ line = lines[i];
+ if (line.charAt(0) == '#') {
+ m = line.match(/EXTRACOL[0-9] (.+)/i);
+ if (m)
+ thead += '<th>' + m[1] + '</th>';
+ } else {
+ m = line.split(/\t/);
+ if (m.length > 3)
+ tbody += '<tr><td>' + m.join('</td><td>') + '</td></tr>';
+ }
+ }
+ $pre.html(data).hide().before('<a href="#" onclick="return !!$(\'#cRaw\').toggle()[0].scrollIntoView()">Raw</a>');
+ $pre.before('<table>' + thead + '</thead>' + tbody + '</tbody></table>');
+ } else
+ ui.newPanel.find('#cRaw').html(epgd.tr.error.noData);
+ epgd.utils.loader.close();
+ });
+ ui.newHeader.removeAttr('data-conti');
+ },true);
+ }
+ }
+ });
+ this.$rec.toggleClass("hasTimer", !!e.timerid).prop("title", this.detail.doRecord(true));
+ this.$play.toggle(this.detail.doPlay(true));
+ this.$prev.toggle(this.detail.doPrev(true));
+ this.$next.toggle(this.detail.doNext(true));
+ this.$con.find('.channel .i-tv').click(function () { epgd.vdrs.current.switchChannel(this.parentNode.id); });
+ //this.$win.position({ of: window });
+ this.closed = false;
+
+ i = Math.max.apply(null, this.$win.siblings(".ui-front:visible").map(function () {
+ return +$(this).css("z-index");
+ }).get()); // zIndexMax
+ if (i >= +this.$win.css("z-index"))
+ this.$win.css("z-index", i + 1);
+
+ $(window).trigger("resize.eventDetail");
+ this.$openDialogs = $('.ui-dialog:visible:not(.ui-state-disabled)').addClass("ui-state-disabled");
+ $(document).bind("keyup.eventDetail", function (e) {
+ if (e.keyCode == 27) {
+ $(window).trigger("epgd_close.eventDetail");
+ }
+ });
+ epgd.pages.help.initButtons(this.$con);
+}
+
+epgd.recordDetail = epgd.utils.inherits(function (elem) {
+ this.elem = elem;
+ return epgd.eventDetail.call(this);
+}, epgd.eventDetail);
+epgd.recordDetail.prototype.load = function () {
+ var self = this;
+ epgd.ajax({
+ url: epgd.login.url + 'data/recording?starttime=' + this.elem.getAttribute('data-start') + '&md5path=' + this.elem.getAttribute('data-md5') + '&owner=' + this.elem.getAttribute('data-owner'), async: false
+ }, function (data) {
+ self.data = data.recording;
+ });
+ return this;
+}
+epgd.recordDetail.prototype.doRecord = function (eData) {
+ if (eData === true) return epgd.tr.pages.records.similarTimer; // eData = getTitle
+ epgd.eventDetail.prototype.doRecord.call(this, eData);
+}
+epgd.recordDetail.prototype.doPlay = function (checkAvail) {
+ if (checkAvail) return true;
+ epgd.ajax({ url: epgd.login.url + 'data/replayrecording?vdruuid=' + ( !epgd.vdrs.list[this.data.vdruuid].usecommonrecfolder ? this.data.vdruuid : epgd.vdrs.current.uuid ) + '&starttime=' + this.data.starttime + '&md5path=' + this.data.md5path + '&owner=' + (this.data.owner || ''), cache: false }, function (data) {
+ epgd.utils.popup(data.result.message, { title: 'VDR', autoClose: 5000 });
+ });
+}
+epgd.recordDetail.prototype.doPrev = function (checkAvail) {
+ var $elem = $(this.elem).prev('.rec');
+ if (!$elem.length)
+ return false;
+ if (checkAvail) return true;
+ $elem.find('B').click();
+}
+epgd.recordDetail.prototype.doNext = function (checkAvail) {
+ var $elem = $(this.elem).next('.rec');
+ if (!$elem.length)
+ return false;
+ if (checkAvail) return true;
+ $elem.find('B').click();
+}
+
+epgd.doneTimerDetail = epgd.utils.inherits(function (tr) {
+ this.tr = tr;
+ return epgd.eventDetail.call(this);
+}, epgd.eventDetail);
+epgd.doneTimerDetail.prototype.load= function () {
+ var self = this;
+ epgd.ajax({ url: epgd.login.url + 'data/donetimer?id=' + this.tr.tData.id, async: false, cache: false }, function (data) {
+ var t = data.donetimer;
+ if (t.state)
+ t.cntlongdescription = epgd.pages.timerListDone.stateIcons[t.state];
+ t.episode = { lang: t.episodelang, season: t.episodeseason, part: t.episodepart };
+ self.id = data.id;
+ self.expire = epgd.utils.now().getTime() + 900000;
+ delete t.timerid;
+ delete t.id;
+ self.data = t;
+ });
+ return this;
+};
+epgd.doneTimerDetail.prototype.doRecord= function (eData) {
+ if (eData === true) return epgd.tr.pages.records.similarTimer;
+ epgd.eventDetail.prototype.doRecord.call(this, eData);
+ //epgd.pages.searchTimerList.dialog.render(eData || this.data);
+};
+epgd.doneTimerDetail.prototype.doPlay= function (checkAvail) {
+ return false;
+};
+epgd.doneTimerDetail.prototype.doPrev= function (checkAvail) {
+ var $elem = $(this.tr).prev('tr');
+ if (!$elem.length)
+ return false;
+ if (checkAvail) return true;
+ $elem.find('td').click();
+};
+epgd.doneTimerDetail.prototype.doNext= function (checkAvail) {
+ var $elem = $(this.tr).next('tr');
+ if (!$elem.length)
+ return false;
+ if (checkAvail) return true;
+ $elem.find('td').click();
+};
+
+
+$(document).ready(function () {
+ epgd.eventDetail.prototype.win = new epgd.eventDetail.win();
+}); \ No newline at end of file
diff --git a/http/src/js/pages.editChannels.js b/http/src/js/pages.editChannels.js
new file mode 100644
index 0000000..74883c3
--- /dev/null
+++ b/http/src/js/pages.editChannels.js
@@ -0,0 +1,313 @@
+epgd.pages.editChannels = {
+ /* $.get("http://wwwa.tvmovie.de/static/tvghost/html/onlinedata/cftv520/datainfo.txt").done(function(data){console.log(data)}) */
+
+ render: function () {
+ if (!(epgd.login.rights & epgd.rights.umConfigEdit) == epgd.rights.umConfigEdit) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ var tr = epgd.tr.pages.editChannels,
+ $panel = epgd.$con,
+ $but,
+ lis='',
+ vdrs= '',
+ merge,
+ src, id, plg, uuid,ch;
+ for (id in epgd.channels.list) {
+ ch = epgd.channels.list[id];
+ merge = [];
+ for (plg in ch.sources) {
+ src = ch.sources[plg];
+ merge[src.merge] = '<li><u>' + plg + '</u> <input type="text" readonly value="' + src.extid + '" /></li>';
+ }
+ //merge[99] = '<li>dvb</li>';
+ lis+='<li><em class="i-check' + (ch.visible & 1 ? '' : '-empty')
+ + '"></em><em style="display:none" class="i-check' + (ch.visible & 2 ? '' : '-empty')
+ + '"></em><span>' + id + '</span><input type="text" value="' + (ch.name || '') + '" />'
+ //+ '<ol>' + merge.join('') + '</ol>'
+ + '</li>';
+ };
+ for (uuid in epgd.vdrs.list)
+ vdrs += '<li data-url="vdr&uuid=' + uuid + '">' + epgd.vdrs.list[uuid].name + '</li>';
+
+ /*
+ merge = [];
+ merge[1] = '<li><u>tvm</u> <input type="text" value="enter id" /></li>';
+ merge[2] = '<li><u>epgdata</u> <input type="text" value="enter id" /></li>';
+ //merge[99] = '<li>dvb</li>';
+ <a class="ui-icon ui-icon-trash">Trash</a>
+ */
+ $but = $panel.html('<div class="ui-widget"><div class="ui-state-highlight ui-corner-all" style="padding: 0.3em 0.7em; font-size:0.9em">'
+ + '<button class="iAsButton i-down-dir">' + tr.menu.channelList + '</button> '
+ + '<span class="i-info-circled" style="display:inline-block"></span>' + epgd.tr.pages.editChannels.headline
+ + '</div></div>'
+ + '<div class="pageEditChannels" id="pageEditChannelsHead"><div class="selMarkBlock"><b title="' + epgd.tr.markAll + '" class="selected" data-t="1"></b><b title="' + epgd.tr.markNone
+ + '" data-t="0"></b><b title="' + epgd.tr.markToggle + '"><b class="selected"></b></b></div><div class="selMarkBlock" data-index="0" title="' + epgd.tr.pages.editChannels.checkWeb
+ + '">Web<em title="' + epgd.tr.markAll + '" class="iAsButton i-check"></em><em title="' + epgd.tr.markNone
+ + '" class="iAsButton i-check-empty"></em></div>'
+ //+ '<div data-index="1" title="' + epgd.tr.pages.editChannels.checkVDR
+ //+ '">VDR<em title="' + epgd.tr.markAll + '" class="iAsButton i-check"></em><em title="' + epgd.tr.markNone
+ //+ '" class="iAsButton i-check-empty"></em></div>'
+ + '<span><input type="text"/>channel-id</span><span><input type="text"/>channel-name</span>'
+ //+ '<div>merging</div>'
+ + '</div>'
+ ).find('button');
+
+ $but.click(function () {
+ var $menu = this.$menu.show();
+ $(document).bind("click.ui_menu", function (ev) {
+ if (!$(ev.target).closest(".ui-menu").length) {
+ $menu.hide();
+ $(this).unbind("click.ui_menu");
+ }
+ });
+ return false;
+ })[0].$menu = $('<ul style="font-size:0.8em; width:200px;position:absolute">'
+ + '<li data-id="loadList"><a>' + tr.menu.referenceList + '</a><ul style="width:100px">'
+ + '<li data-id="channelpedia"><a>channelpedia</a></li>'
+ + ( vdrs ? '<li><a>VDR</a><ul>' + vdrs + '</ul></li>' : '')
+ + '<li data-id="insertList"><a>' + tr.menu.insertAsText + '</a></li>'
+ + '</ul></li>'
+ + '<li data-id="getChannelNames"><a>' + tr.menu.extentEmptyChannelNames + '</a></li>'
+ + '<li data-id="getAllChannelNames"><a>' + tr.menu.applyAllChannelNames + '</a></li>'
+ + '<li data-id="getOrder"><a>' + tr.menu.applyChannelSort + '</a></li></ul>').hide().insertAfter($but).menu({
+ select: function (ev, ui) {
+ var $li = ui.item,
+ ul, path,
+ filter = '';
+ if (!$li.attr('data-id'))
+ $li = $li.parents('li[data-id]:first');
+ switch ($li.attr('data-id')) {
+ case 'getChannelNames':
+ filter= '[value=""]';
+ case 'getAllChannelNames':
+ epgd.utils.loader.process(function () {
+ var list = [];
+ $('#pageEditChannelsSource li').each(function () {
+ list[this.lastChild.innerHTML] = this.firstChild.innerHTML;
+ })
+ $('#pageEditChannels > li > input' + filter).each(function () {
+ this.value = list[this.previousSibling.innerHTML] || this.value;
+ });
+ });
+ break;
+ case 'getOrder':
+ epgd.utils.loader.process(function () {
+ var $list = $('#pageEditChannels'),
+ $span;
+ $($('#pageEditChannelsSource span').get().reverse()).each(function () {
+ $span = $list.find('> li > span:contains(' + this.innerHTML + ')');
+ if ($span.length)
+ $span.parent().prependTo($list);
+ });
+ });
+ break;
+ case 'insertList':
+ $('<div title="channel.conf"><p>' + tr.desc_insertList + ' <a href="http://channelpedia.yavdr.com/gen/DVB-S/S19.2E/S19.2E_complete_sorted_by_groups.channels.conf" target="forList">channelpedia.yavdr.com</p><textarea style="width:100%; height:60%"></textarea><button>ok</button></div>').dialog({
+ modal: true,
+ width: 500,
+ height: 400
+ }).find('textarea').change(function () {
+ epgd.pages.editChannels.insertReferenceList(this.value);
+ $(this).parent().dialog('destroy');
+ });
+ break;
+ case 'loadList':
+ if (ui.item.attr('data-url')) {
+ epgd.ajax({url:epgd.login.url + 'data/proxy?id=' + ui.item.attr('data-url'), dataType: "html", contentType: "text/plain; charset=utf-8"},epgd.pages.editChannels.insertReferenceList);
+ break;
+ }
+ case 'channelpedia':
+ ul = $('<ul style="width:100px" />').appendTo(ui.item)[0];
+ epgd.ajax({url:epgd.login.url + 'data/proxy?id=channelpedia', dataType: "html", contentType: "text/plain; charset=utf-8"},function (data) {
+ $li.attr('data-id', '');
+ var $ul = $(data.replace(/<img [^>]+>/g, '')).find('.entryMenu > ul:first');
+ $ul.find('br').remove();
+ $ul.find('a').each(function () {
+ this.parentNode.setAttribute('data-url', this.getAttribute("href"));
+ this.removeAttribute('href');
+ });
+ $ul.find('>li').each(function () {
+ $('<li data-id="channelpediaList"><a>' + this.firstChild.innerHTML + '</a></li>').append($(this).next('ul').width(400)).appendTo(ul);
+ });
+ $(ev.target).menu("refresh").menu("expand");
+ });
+ return true;
+ case 'channelpediaList':
+ path = ui.item.attr('data-url');
+ $li.attr('data-id', 'loadList');
+ ui.item.removeAttr('data-url');
+ epgd.ajax({ url: epgd.login.url + 'data/proxy?id=channelpedia&path=' + path, dataType: "html", contentType: "text/plain; charset=utf-8" }, function (data) {
+ var $ul = $('<ul />');
+ $(data).find('.singleSourceMainMenu li:contains("channels.conf")').each(function () {
+ var $this = $(this);
+ $('<li title="' + $this.find('.description').text() + '" data-url="channelpedia&path='
+ + path + $this.find('.button a').attr('href') + '"><a>'
+ + $this.find('.caption').text() + '</a></li>').appendTo($ul);
+ });
+ $ul.appendTo(ui.item);
+ $(ev.target).menu("refresh").menu("expand");
+ });
+ return true;
+ default:
+ return false;
+ }
+ $(document).trigger("click.ui_menu");
+ }
+ }).position({
+ my: "left top",
+ at: "left bottom",
+ of: $but[0]
+ });
+ $('<button class="iAsButton i-save">' + epgd.tr.save + '</button>').insertAfter($but).click(function () {
+ var data = {};
+ $('#pageEditChannels > li').each(function (index) {
+ var $this = $(this),
+ sources = {};
+ merge = {};
+ $this.find('>ol>li').each(function (index) {
+ var $this = $(this),
+ extid = $this.find('input').val();
+ sources[$this.find('u').text()] = merge = { merge: index };
+ if (extid) merge.extid = extid;
+ });
+ data[$this.find('span').text()] = {
+ name: $this.find('input').val(),
+ visible: $this.find('em:eq(0)').hasClass('i-check') * 1 + $this.find('em:eq(1)').hasClass('i-check') * 2,
+ order: index + 1,
+ sources: sources
+ }
+ });
+ epgd.ajax({
+ url: epgd.login.url + 'data/save-channels',
+ type: 'post',
+ data: JSON.stringify({ "channels": data })
+ },function (data) {
+ data = data.result;
+ if (data.state == 200) {
+ epgd.utils.popup(epgd.tr.dataSaved);
+ epgd.channels.isDirty = true;
+ }
+ else
+ epgd.utils.popup(data.message);
+ });
+ });
+
+ $('<ol id="pageEditChannels" class="pageEditChannels">' + lis + '</ol>').appendTo($panel).sortable({
+ revert: 'invalid',
+ handle: ':not(em)'
+ }).click(function (ev) {
+ if (ev.target.nodeName == "EM")
+ $(ev.target).toggleClass('i-check i-check-empty');
+ else {
+ $li = $(ev.target).closest('li');
+ if ($li.parent('#pageEditChannels').length) {
+ $li.toggleClass('selected');
+ if (ev.shiftKey && this.lastSel) {
+ var $lastSel = $(this.lastSel),
+ delta = $li.index() - $lastSel.index();
+ if (delta > 0)
+ $lastSel.nextAll(':lt(' + delta + '):not(.filterHide)').toggleClass('selected', $lastSel.hasClass('selected'));
+ else
+ $lastSel.prevAll(':lt(' + -delta + '):not(.filterHide)').toggleClass('selected', $lastSel.hasClass('selected'));
+ }
+ else
+ this.lastSel = $li[0];
+ }
+ }
+ });
+ $('<ol id="pageEditChannelsSource" class="pageEditChannels"></ol>').appendTo($panel).sortable({
+ connectWith: '#pageEditChannels',
+ revert: "invalid",
+ remove: function (e, ui) {
+ $('<li><em class="i-check"></em>'
+ //+ '<em class="i-check"></em>'
+ + '<span>' + ui.item.find('span').text()
+ + '</span><input type="text" value="' + ui.item.find('i').text() + '" />'
+ //+ '<ol></ol>'
+ +'</li>').insertAfter(ui.item);
+ return false;
+ },
+ }).hide();
+ $panel.append('<br clear="all" />');
+ $(window).bind("resize.editChannels", function () {
+ var h = $(window).height() - $('#pageEditChannels').offset().top -20;
+ if ($('#pageEditChannelsSource:visible').length == 0 || ($panel.width() - $('#pageEditChannels').width() - $('#pageEditChannelsSource').width() - 80) > 0)
+ $('#pageEditChannels,#pageEditChannelsSource').css({ height: h });
+ else {
+ $('#pageEditChannels').height(h*0.66);
+ $('#pageEditChannelsSource').height(h * 0.33);
+ }
+ }).trigger('resize');
+ $(window).bind("epgd_close.editChannels", function () {
+ $(window).unbind(".editChannels");
+ epgd.channels.load();
+ });
+
+ /*
+ .find('ol').sortable({
+ connectWith: "#mergeSrc"
+ });
+ */
+ /*,
+ cancel: ???
+ accept: function (event, ui) {
+ console.log(ui);
+ return $(event.target).html().indexOf('>' + ui.item.find('u').text() + '<') > 0;
+ }*/
+ /*
+ $('#mergeSrc').droppable({
+ accept: "#pageEditChannels ol li",
+ drop: function (event, ui) {
+ $(ui.draggable).remove();
+ }
+ }).find('li').draggable({
+ connectToSortable: "#pageEditChannels ol",
+ helper: "clone",
+ });
+ */
+
+ $('#pageEditChannelsHead em').click(function () {
+ var $sel = null,
+ $lis;
+ try {
+ $sel = $(window.getSelection().getRangeAt(0).cloneContents()).children();
+ } catch (e) { $sel = null; }
+ if (!$sel || !$sel.length) {
+ $lis = $('#pageEditChannels > li');
+ $sel = $lis.filter('.selected');
+ if (!$sel.length)
+ $sel = $lis;
+ }
+
+ $sel.find('> em:eq(' + this.parentNode.getAttribute('data-index') + ').i-check' + (this.className.indexOf('i-check-empty') > 0 ? '' : '-empty')).toggleClass('i-check i-check-empty');
+ });
+
+ $('#pageEditChannelsHead b').click(function () {
+ var t = this.getAttribute('data-t');
+ $('#pageEditChannels > li').toggleClass('selected', t == 1 ? true : t == 0 ? false : undefined);
+ return false;
+ });
+ this.inp_ChID = $('#pageEditChannelsHead input:eq(0)').keyup(this.filter)[0];
+ this.inp_ChName = $('#pageEditChannelsHead input:eq(1)').keyup(this.filter)[0];
+ },
+ filter: function () {
+ var id = epgd.pages.editChannels.inp_ChID.value.toLowerCase(),
+ name = epgd.pages.editChannels.inp_ChName.value.toLowerCase();
+ $('#pageEditChannels > li').each(function () {
+ var $li = $(this);
+ if ((!id || $li.find('span').text().toLowerCase().indexOf(id) >= 0) && (!name || $li.find('input').val().toLowerCase().indexOf(name) >= 0))
+ $li.removeClass('filterHide');
+ else
+ $li.addClass('filterHide');
+ });
+ },
+ insertReferenceList: function (data) {
+ var html = '',
+ terms;
+ $(data.split('\n')).each(function () {
+ terms = this.split(':');
+ if (terms[0])
+ html += '<li><i>' + terms[0].split(/,|;/)[0] + '</i><span>' + terms[3] + '-' + terms[10] + '-' + terms[11] + '-' + terms[9] + '</span></li>';
+ })
+ $('#pageEditChannelsSource').show().html(html);
+ $(window).trigger("resize.editChannels");
+ }
+};
diff --git a/http/src/js/pages.editUser.js b/http/src/js/pages.editUser.js
new file mode 100644
index 0000000..e41b67c
--- /dev/null
+++ b/http/src/js/pages.editUser.js
@@ -0,0 +1,96 @@
+epgd.pages.editUser = {
+ cur: null,
+ render: function () {
+ if (!(epgd.login.rights & epgd.rights.umConfigUsers) == epgd.rights.umConfigUsers) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ var tr = epgd.tr.pages.editUser,
+ $form= $('<form></form>'),
+ $sel = $('<select size="10"></select>').change(function () {
+ epgd.pages.editUser.showUser(this[this.selectedIndex].data, $form, epgd.pages.editUser.render);
+ });
+ $('<option>' + tr.add + '</option>').appendTo($sel)[0];
+ epgd.$con.html('<div id="page_editUser"><div><h2>' + tr.user + '</h2></div></div>');
+ epgd.ajax({ url: epgd.login.url + "data/users", cache: false }, function (data) {
+ for (var uName in data.users) {
+ $('<option>' + uName + '</option>').appendTo($sel)[0].data = data.users[uName];
+ }
+ });
+ epgd.$con.find('#page_editUser').append($form).children().first().append($sel);
+ },
+ showUser: function (userData, $form, callback) {
+ epgd.pages.editUser.cur = userData || {"user": "", "active": 1, "rights": epgd.login.rights};
+ var tr = epgd.tr.pages.editUser,
+ u = epgd.pages.editUser.cur,
+ rightForm = '',
+ um;
+ //epgd.rights = {}; for (var i = 1; i < 1025; i = i * 2) epgd.rights['um' + i] = i;// zum Test
+ for (um in epgd.rights)
+ rightForm += '<div><input type="checkbox"' + ((u.rights & epgd.rights[um]) == epgd.rights[um] ? ' checked="checked"' : '') + ' name="uRights" id="uR' + um + '" value="' + epgd.rights[um] + '"/><label for="uR' + um + '">' + (tr.rights[um] || um) + '</label></div>';
+ $form.html((!u.user ? '<h2>' + epgd.tr.pages.login.userName + '</h2><div><input type="text" id="uName" value="" /></div><br />' : '')
+ + '<div><input type="radio"' + (u.active == "1" ? ' checked="checked"' : '') + ' name="uActive" value="1" id="uActive"/><label for="uActive">' + tr.active + '</label>'
+ + ' <input type="radio"' + (u.active == "0" ? ' checked="checked"' : '') + ' name="uActive" value="0" id="uInactive" /><label for="uInActive">' + tr.inActive + '</label>'
+ + (u.user && ' <input type="radio" name="uActive" value="-1" id="uDel"/><label for="uDel">' + epgd.tr.del + '</label>')
+ + '</div>'
+ + '<h2>' + epgd.tr.pages.login.password + '</h2><div><input type="password" id="uPass" /></div>'
+ + '<h2>' + tr.rights.label + '</h2><div>' + rightForm + '</div>'
+ + '<div><br /><button class="iAsButton i-save">' + epgd.tr.save + '</button></div>');
+ $form.find('button').click(function () {
+ return epgd.pages.editUser.save(this.form, callback);
+ });
+ $uRights = $($form[0].uRights).each(function () {
+ this.r = parseInt(this.value, 10);
+ });
+ function check() {
+ var flag = this.r;
+ if (this.checked)
+ $uRights.each(function () { // Alle unterrechte automatisch setzen und fixieren
+ if (this.r < flag && (flag & this.r) == this.r) this.checked = this.disabled = true;
+ });
+ else
+ $uRights.each(function () {
+ if (this.r < flag && (flag & this.r) == this.r) {
+ this.disabled = false; // Es ist ein Unterrecht, also erst mal wieder erlauben
+ var sub = this; // Suchen, ob dieses recht noch ein von einem weiteren Recht ein Unterrecht ist und dann ggf. wieder setzen und fixieren
+ $uRights.each(function () {
+ if (this.checked && this.r > sub.r && (this.r & sub.r) == sub.r) sub.checked = sub.disabled = true;
+ });
+ }
+ });
+ }
+ $uRights.each(check).click(check);
+ },
+ save: function (form, callback) {
+ var u = {rights:1},
+ cur = epgd.pages.editUser.cur;
+ $(form.uRights).each(function () { if (this.checked) u.rights |= this.r; });
+ u.active = parseInt(form.uActive.value,10);
+ if (cur.user) {
+ u.user = cur.user;
+ if (u.active == -1) {
+ delete u.active;
+ u.state = 'D';
+ } else {
+ u.state = 'M';
+ if (u.active == cur.active)
+ delete u.active;
+ if (u.rights == cur.rights)
+ delete u.rights;
+ if (form.uPass.value)
+ u.passwd = YaMD5.hashStr(u.user + form.uPass.value);
+ }
+ } else{
+ u.state = 'C';
+ u.user = form.uName.value;
+ if (!u.user)
+ return !epgd.utils.topInfo(epgd.tr.error.emptyField.replace('$field$', epgd.tr.pages.login.userName), { isError: 1 });
+ u.passwd = YaMD5.hashStr(u.user + form.uPass.value);
+ }
+ epgd.ajax({url: epgd.login.url + "data/save-users",type: 'post',data: JSON.stringify({ users: [u] })},function (data) {
+ if (data.Error || data.result.state != 200)
+ return epgd.utils.topInfo(data.Error || data.result.message, { isError: 1 });
+ (u.user == epgd.login.user) && $(window).trigger("login_changed",u);
+ if ( $.isFunction(callback))
+ callback(data);
+ });
+ return false;
+ }
+};
diff --git a/http/src/js/pages.help.js b/http/src/js/pages.help.js
new file mode 100644
index 0000000..d63ebd6
--- /dev/null
+++ b/http/src/js/pages.help.js
@@ -0,0 +1,49 @@
+epgd.pages.help = {
+ $con: null,
+ render: function () {
+ $('#menu_help').addClass("menu-active");
+ if (!this.$con) this.load();
+ epgd.$con.html(this.$con);
+ this.init();
+ },
+ getButton: function(id, useAnchor){
+ return (useAnchor ? '<a' : '<button') + ' id="bh_' + id + '" class="help iAsButton i-help" role="button">' + epgd.tr.menu.help + '</' + ( useAnchor ? 'a>' : 'button>');
+ },
+ getIcon: function (id) {
+ return '<a id="bh_' + id + '" class="help iAsIcon i-help" />';
+ },
+ initButtons: function ($con) {
+ if (!$con)
+ $con = epgd.$con;
+ $con.tooltip({
+ items: ".help",
+ //position: { at: "left top" },
+ //position: { my: "left top" },
+ tooltipClass: 'quickInfo',
+ content: function () {
+ return epgd.pages.help.getQuickInfo(this.id.slice(3));
+ },
+ open: function (ev, ui) {
+ $(ui.tooltip).position({
+ of: ev.toElement,
+ my: "left top"
+ });
+ ev.preventDefault();
+ }
+ });
+ },
+ getQuickInfo: function (id) {
+ var h= epgd.pages.help;
+ if (!h.$con) h.load();
+ return h.$con.find('#h_' + id).html() || epgd.tr.pages.help.noHelp;
+ },
+ load: function () {
+ var me = this;
+ epgd.ajax({
+ url: epgd.tr.pages.help.url, async: false, dataType: "html", contentType: "text/plain; charset=utf-8"
+ }, function (data) {
+ me.$con = $($(data).filter('#help')[0]);
+ $(data).filter('#help_js').appendTo(document.body);
+ });
+ }
+};
diff --git a/http/src/js/pages.login.js b/http/src/js/pages.login.js
new file mode 100644
index 0000000..c751d49
--- /dev/null
+++ b/http/src/js/pages.login.js
@@ -0,0 +1,114 @@
+epgd.pages.login = {
+ useCookie: document.cookie.match(/login=([^;]+)/),
+ render: function () {
+ if (epgd.login.session)
+ this.doLogin('logout');
+ this.showForm();
+ },
+ showForm: function(callback){
+ var tr = epgd.tr.pages.login,
+ $con = $('#login');
+ if (!$con.length) {
+ $con = $('<div id="login" title="' + tr.label + '" class="searchDialog ui-dialog" style="margin:5% auto"><form class="ui-dialog-content ui-widget-content"><table cellpadding="5">'
+ + '<tr><td>' + tr.userName + '</td><td><input type="text" id="lUser" /></td></tr>'
+ + '<tr><td>' + tr.password + '</td><td><input type="password" id="lPass" /></td></tr>'
+ + '<tr><td colspan="2"><input type="checkbox" id="lAlways" /> <label for="lAlways">' + tr.loggedAlwaysIn + '</label></td></tr>'
+ + '</table></form></div>');
+ $con.dialog({
+ modal: true, width: "auto",
+ closeOnEscape: false,
+ buttons: [{
+ text: tr.label,
+ icons: {primary: "ui-icon-unlocked"},
+ click: function () {
+ var form = $con.find('form')[0];
+ if (!form.lUser.value)
+ return !!epgd.utils.topInfo(epgd.tr.error.emptyField.replace('$field$', tr.userName), { isError: 1 });
+ $(this).dialog("close");
+ epgd.pages.login.useCookie = form.lAlways.checked ? [] : null;
+ epgd.pages.login.doLogin(form.lUser.value, form.lPass.value, callback);
+ }
+ }]
+ }).keypress(function (e) {
+ if (e.keyCode == 13) {
+ $(this).parent().find(".ui-dialog-buttonpane button:eq(0)").trigger("click");
+ }
+ }).parent().find('.ui-dialog-titlebar-close').remove();
+ } else
+ $con.dialog('open');
+ },
+ doLogin: function (user, pass, callback) {
+ var curLogin = epgd.login,
+ uKey = '',
+ storage = sessionStorage;
+
+ try {
+ storage.setItem('_storagetest_', 1);
+ storage.removeItem('_storagetest_');
+ } catch (ex) {
+ storage = { removeItem: function () { }, setItem: function () { }, getItem: function () { return null; } }
+ }
+
+ function trigger_changed() {
+ if (epgd.login.user != curLogin.user || epgd.login.rights != curLogin.rights) {
+ if (!epgd.login.session) {
+ if (epgd.pages.login.useCookie) {
+ epgd.pages.login.useCookie[1] = null;
+ document.cookie = "login=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
+ }
+ storage.removeItem('login');
+ epgd.login.url = '';
+ } else {
+ if (epgd.pages.login.useCookie) {
+ epgd.pages.login.useCookie[1] = uKey;
+ var d = new Date();
+ d.setTime(d.getTime() + 365 * 24 * 60 * 60 * 1000);
+ document.cookie = "login=" + uKey + "; expires=" + d.toUTCString();
+ }
+ storage.setItem('login', uKey);
+ epgd.login.url = 'sid' + epgd.login.session + '/';
+ }
+ $(window).trigger("login_changed", curLogin);
+ }
+ epgd.login.url = epgd.login.session ? 'sid' + epgd.login.session + '/' : '';
+ if ($.isFunction(callback))
+ callback();
+ }
+
+ if (user != 'logout') {
+ if (curLogin.session) {
+ $.ajax({ url: curLogin.url + "data/login", data: JSON.stringify({ key: '' }), type: 'post', contentType: "application/json; charset=utf-8", dataType: 'json' });
+ epgd.login.url = '';
+ }
+ if (epgd.profile.needLogin == "0") {
+ epgd.login = { user: '', session: '', rights: 4294967295, url: '' };
+ return trigger_changed();
+ }
+ if (user)
+ uKey = YaMD5.hashStr(user + pass);
+ else {
+ uKey = storage.getItem('login');
+ if (!uKey && epgd.pages.login.useCookie)
+ uKey = epgd.pages.login.useCookie[1];
+ if (!uKey)
+ return this.showForm(callback);
+ }
+ }
+ $.ajax({ url: epgd.login.url + "data/login", data: JSON.stringify({ key: uKey }), type: 'post', contentType: "application/json; charset=utf-8", dataType: 'json' }).done(function (data) {
+ var tr = epgd.tr.pages.login;
+ epgd.login = data.login || { user: '', session: '', rights: 0, url: '' };
+ if (!epgd.login.session) {
+ if (user == 'logout') {
+ epgd.utils.topInfo(tr.logoutMessage);
+ } else
+ epgd.utils.topInfo(tr.error, { isError: 1 });
+ $('#menu_login a').text(tr.label);
+ } else {
+ $('#menu_login a').text(epgd.login.user + ' ' + tr.logout);
+ if (location.hash == "#menu_login" || location.hash == "#")
+ location.hash = "";
+ }
+ return trigger_changed();
+ });
+ }
+};
diff --git a/http/src/js/pages.magazine.js b/http/src/js/pages.magazine.js
new file mode 100644
index 0000000..f5769e2
--- /dev/null
+++ b/http/src/js/pages.magazine.js
@@ -0,0 +1,413 @@
+epgd.pages.magazine = {
+ startTime: null,
+ endTime: null,
+ $head: null,
+ $con: null,
+ list: [],
+ viewCnt: 0,
+ scrollStart:0,
+ timeLineL: null,
+ timeLineR: null,
+ qt:{},
+ imgPath: epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=100&maxH=70&id=' : false,
+ init: function () {
+ //this.initQT();
+ this.select = epgd.channels.selBox;
+
+ $(window).bind('channels_load', function () {
+ var self= epgd.pages.magazine,
+ id;
+ if (!self.$head)
+ return;
+ self.$head.empty();
+ for (id in self.list)
+ self.list[id].index = -1;
+ self._initChannels();
+ for (id in self.list)
+ if (self.list[id].index == -1) {
+ self.preTime.removeChild(self.list[id].col);
+ delete self.list[id];
+ };
+ });
+ },
+ initQT: function () {
+ var qt = {};
+ epgd.profile.quickTimes.replace(/=([0-9]{1,2}):([0-9]{1,2})/g, function (a, h, m) {
+ qt[parseInt(h,10)] = '<p' + (m ? ' style="margin-top:' + (m * 2) + 'px"' : '') + '> </p>';
+ });
+ this.qt= qt;
+ },
+ _initChannels: function () {
+ var ch,i;
+ for (i = 0; i < this.select.length; i++) {
+ ch = this.list[this.select[i].value];
+ if (!ch) {
+ ch = new epgd.pages.magazine.channel(this.select[i].value, i, $('<div class="ui-widget-content"/>')[0]);
+ this.list[ch.id] = ch;
+ } else {
+ ch.index = i;
+ }
+ this.preTime.appendChild(ch.col);
+ this.select[i].ch = ch;
+ this.$head.append('<div class="ui-widget-content ui-corner-top">' + epgd.channels.getHtml(ch.id) + '</div>')
+ }
+ this.$head.css('width',(208 * this.select.length + 55) + 'px');
+ },
+ _initWinBindings: function(){
+ $(window)
+ .bind("epgd_close.pages_magazine", function () {
+ epgd.$dtPicker.hide();
+ $(window).unbind(".pages_magazine");
+ clearInterval(this.pages_magazine.timeInterval);
+ delete this.pages_magazine;
+ })
+ .bind("resize.pages_magazine", function () {
+ var w = $(window).width(),
+ l = $(this).scrollLeft();
+ this.pages_magazine.$nav.width(w + 'px');
+ this.pages_magazine.$con.css('height', ($(window).height() - 10 - $('#magazine').offset().top) + 'px');
+ this.pages_magazine.viewCnt = parseInt((w - 110) / 208, 10);
+ if (this.pages_magazine.viewCnt < 5 ) {
+ this.pages_magazine.timeLineR.style.left = '-50px';
+ this.pages_magazine.$con.css('width', (208 * this.pages_magazine.select.length + 25) + 'px');
+ } else if (this.pages_magazine.viewCnt >= this.pages_magazine.select.length) {
+ this.pages_magazine.viewCnt = this.pages_magazine.select.length;
+ this.pages_magazine.timeLineR.style.left = '-50px';
+ w = this.pages_magazine.viewCnt * 208 + 55;
+ this.pages_magazine.$con.css('width', (w -30) + 'px');
+ } else {
+ this.pages_magazine.timeLineR.style.left = (l + w - 52) + 'px';
+ this.pages_magazine.$con.css('width', (208 * this.pages_magazine.select.length + 150) + 'px');
+ }
+ this.pages_magazine.lineNow.style.width = (w - 10) + 'px';
+ epgd.$menu.parent().offset({ 'left': l });
+ this.pages_magazine.$nav.offset({ 'left': l });
+ this.pages_magazine.update();
+ })
+ .bind("scroll.pages_magazine", function () {
+ this.pages_magazine.timeLineL.style.left = '-50px';
+ this.pages_magazine.timeLineR.style.left = '-50px';
+ })
+ .bind("scrollstop.pages_magazine", function () {
+ var l = $(this).scrollLeft();
+ this.pages_magazine.timeLineL.style.left = this.pages_magazine.lineNow.style.left = l + 'px';
+ if (this.pages_magazine.viewCnt >= 5 && this.pages_magazine.viewCnt < this.pages_magazine.select.length)
+ this.pages_magazine.timeLineR.style.left = (l + $(window).width() - 52) + 'px';
+ this.pages_magazine.nextMain = parseInt((l + 104) / 208, 10);
+ if (this.pages_magazine.select.selectedIndex != this.pages_magazine.nextMain)
+ this.pages_magazine.setMain(0, this.pages_magazine.nextMain, true);
+ epgd.$menu.parent().offset({ 'left': l });
+ this.pages_magazine.$nav.offset({ 'left': l });
+ return false;
+ })
+ .bind("datepicker.pages_magazine", function () {
+ this.pages_magazine.setTime(epgd.utils.unixTime(epgd.$dtPicker.datetimepicker('getDate') || epgd.utils.now()), true);
+ })[0].pages_magazine = this;
+
+ this.$con.bind('scrollstop.pages_magazine', function () {
+ var s = $(this).scrollTop();
+ if (s > this.pages_magazine.scrollEnd)
+ this.pages_magazine.setTime(s * 30 + epgd.profile.minEventTime);
+ else if (s < this.pages_magazine.scrollStart)
+ this.pages_magazine.setTime(Math.max(this.pages_magazine.startTime - 43200, epgd.profile.minEventTime)); // 60 * 60 *12
+ });
+
+ this._setLineNow();
+ this.timeInterval = setInterval(this._setLineNow, 60000);
+ },
+ _setLineNow: function(){
+ var m = window.pages_magazine,
+ now = new Date().getTime() / 1000;
+ if (now > m.endTime || (m.startTime - epgd.profile.minEventTime) < -3600 ) {
+ $(window).trigger("epgd_close");
+ $('<div class="ui-widget-overlay ui-front"></div>').click(function () {
+ epgd.profile.minEventTime = epgd.utils.now().getTime() / 1000 - 10800;
+ $(window).trigger("profile_updated", { "minEventTime": true });
+ epgd.$dtPicker.datetimepicker('setDate', epgd.utils.now());
+ m.$con.empty();
+ m.render();
+ $(this).remove();
+ }).appendTo(document.body);
+ return;
+ }
+ m.lineNow.style.top = ((now - m.startTime) / 30 + m.scrollStart) + 'px';
+ m.lineNow.innerHTML= epgd.utils.formatTime(now);
+ },
+ render: function (channel) {
+ $('#menu_magazine').addClass("menu-active").append(epgd.$dtPicker.show());
+ var startTime = epgd.utils.unixTime(epgd.utils.now()),
+ d;
+ if (this.startTime && (this.startTime - epgd.profile.minEventTime) < -3600) {
+ this.startTime = null;
+ this.list = [];
+ }
+ if (!this.startTime) {
+ $(window).trigger("epgd_close");
+ $(this.select).appendTo(epgd.$menu.find('#menu_magazine')).mousedown(function (ev) {
+ ev.stopPropagation();
+ return true;
+ }).click(function (ev) {
+ return false;
+ }).change(function () {
+ epgd.pages.magazine.render($(this).val());
+ });
+ if (this.select.selectedIndex < 0)
+ this.select.selectedIndex = 0;
+ this.$nav= $('<div id="magazine-nav"><div class="ui-widget-content ui-corner-top left"><div class="ui-widget-content ui-corner-top"><span class="iAsButton i-left-dir"></span><span class="iAsButton i-rewind"></span></div></div>'
+ + '<div class="ui-widget-content ui-corner-top right"><div class="ui-widget-content ui-corner-top"><span class="iAsButton i-right-dir"></span><span class="iAsButton i-forward"></span></div></div></div>')
+ this.$head = $('<div id="magazine-head"></div>');
+ this.$con = $('<div id="magazine"></div>');
+ this.$con[0].pages_magazine = this;
+ this.preTime = $('<div style="height:' + parseInt((epgd.profile.maxEventTime - epgd.profile.minEventTime) / 30,10) + 'px"></div>').appendTo(this.$con)[0];
+ this.timeLineL = $('<div class="ui-widget-content timeLine"></div>').appendTo(this.preTime)[0];
+ this.timeLineR = $('<div class="ui-widget-content timeLine tlr"></div>').appendTo(this.preTime)[0];
+ this.lineNow = $('<p class="timeNow"></p>').appendTo(this.preTime)[0];
+ this._initChannels();
+ this.startTime = startTime+3600;
+ d = new Date(this.startTime * 1000);
+ if (d.getMinutes() > 0) {
+ d.setMinutes(0);
+ this.startTime = d.getTime() / 1000;
+ }
+ this.endTime = this.startTime;
+ this.setTime(this.startTime-7200);
+ }
+ if (!window.pages_magazine) {
+ this._initWinBindings();
+ epgd.$con.empty();
+ this.$nav.appendTo(epgd.$con).bind("click", this.actionHead);
+ this.$head.appendTo(epgd.$con).bind('click', function (ev) {
+ if (ev.target.className == 'i-tv')
+ epgd.vdrs.current.switchChannel(ev.target.parentNode.id);
+ });
+ this.$con.appendTo(epgd.$con).bind("click", this.actionCon).bind("touchend",this.actionConOpen);
+ if (!$.support.touch && epgd.profile.magazinePan > 0)
+ this._pan();
+ }
+ $(window).trigger("resize.pages_magazine");
+ if (channel)
+ this.setChannel(channel);
+ if (startTime < this.startTime || startTime > this.endTime)
+ this.setTime(startTime);
+ this.$con.scrollTop((startTime - epgd.profile.minEventTime) / 30 - 15);
+ $(window).trigger("resize.pages_magazine");
+ },
+ _pan: function(){
+ var pan = false,
+ tp = $('<div style="width:90%; height:35px; margin-top:15px; position:fixed;z-index:99;left:5%"></div>').prependTo(epgd.$con)[0],
+ bot = $('<div style="width:90%; height:35px; position:fixed;z-index:99;bottom:0;left:5%"></div>').appendTo(epgd.$con)[0];
+ this.timeLineL.pan = -1;
+ this.timeLineR.pan = 1;
+ tp.pan = epgd.profile.magazinePan * -30;
+ bot.pan = epgd.profile.magazinePan * 30;
+
+ window.tp = tp;
+ window.bp = bot;
+ window.p = pan;
+ $([this.timeLineL, this.timeLineR, tp, bot]).mouseover(function (ev) {
+ if (pan) return;
+ pan = this.pan;
+ window.setTimeout(function () {
+ if (pan) {
+ var checkPan = window.setInterval(function () {
+ if (!pan || !window.pages_magazine)
+ return window.clearInterval(checkPan);
+ if (pan < -1 || pan > 1)
+ window.pages_magazine.setTime((window.pages_magazine.$con.scrollTop() + 15) * 30 + epgd.profile.minEventTime + pan, true);
+ else
+ window.pages_magazine.setMain(pan);
+ }, (pan < -1 || pan > 1 ? 100 : 1200));
+ }
+ }, epgd.profile.magazinePanDelay);
+ }).mouseout(function () {
+ pan = false;
+ });
+ },
+ setChannel: function (channel) { this.setMain(0, this.list[channel].index); },
+ setMain: function (delta, baseIndex, dontScroll) {
+ var optList = this.select,
+ i = isNaN(baseIndex) ? optList.selectedIndex : baseIndex;
+ i += delta;
+ if (i < 0)
+ i = 0;//+= optList.length;
+ else if (i >= optList.length - this.viewCnt)
+ i = optList.length - this.viewCnt;// -= optList.length;
+ optList.selectedIndex = i;
+ this.update();
+ !dontScroll && $(window).scrollLeft(i * 208);
+ },
+ setTime: function (start, doScroll) {
+ var t, insHtml = '',
+ h,
+ newEndTime = start + 43200; //86400; //60 * 60 * 24
+ if (start < this.startTime) {
+ do {
+ this.startTime -= 3600;
+ t = epgd.utils.formatTime(this.startTime);
+ h = parseInt(t, 10);
+ if (h % 4 == 0) //if (t == '00:00')
+ t += $.datepicker.formatDate('<br />D,<br />dd<br />MM<br />yy', new Date(this.startTime * 1000))
+ insHtml = (this.qt[h] || '') + '<dfn>' + t + '</dfn>' + insHtml;
+ } while (this.startTime > start);
+ $(this.timeLineL).prepend(insHtml);
+ $(this.timeLineR).prepend(insHtml);
+ this.scrollStart = (this.startTime - epgd.profile.minEventTime) / 30;
+ if (this.scrollStart < 0) {
+ this.scrollStart = 0;
+ this._setLineNow();
+ }
+ this.preTime.style.paddingTop = this.scrollStart + 'px';
+ }
+ if (this.endTime < newEndTime) {
+ insHtml = '';
+ newEndTime = Math.max(newEndTime, this.endTime + 43200); //60 * 60 * 12
+ for (; this.endTime < newEndTime; this.endTime += 3600) {
+ t = epgd.utils.formatTime(this.endTime);
+ h = parseInt(t, 10);
+ if (h % 4 == 0)
+ t += $.datepicker.formatDate('<br />D,<br />dd<br />M<br />yy', new Date(this.endTime * 1000));
+ insHtml += (this.qt[h] || '') + '<dfn>' + t + '</dfn>';
+ }
+ $(this.timeLineL).append(insHtml);
+ $(this.timeLineR).append(insHtml);
+ this.scrollEnd = (this.endTime - epgd.profile.minEventTime - 43200) / 30; // 60 * 60 *12
+ }
+ insHtml && this.update();
+ doScroll && this.$con.scrollTop((start - epgd.profile.minEventTime) / 30 - 15);
+ },
+ actionHead: function (ev) {
+ var self = epgd.pages.magazine,
+ c;
+ if (ev.target.nodeName == 'SPAN') {
+ c = ev.target.className;
+ if (c.indexOf('i-left-dir') > -1)
+ self.setMain(-1);
+ else if (c.indexOf('i-rewind') > -1)
+ self.setMain(-self.viewCnt);
+ else if (c.indexOf('i-right-dir') > -1)
+ self.setMain(1);
+ else if (c.indexOf('i-forward') > -1)
+ self.setMain(self.viewCnt);
+ }
+ },
+ actionConOpen: function (ev) {
+ var dt = $(ev.target).closest('dt')[0];
+ if (dt)
+ dt.firstOpen = (dt.clientHeight != dt.scrollHeight);
+ },
+ actionCon: function (ev) {
+ var dt = $(ev.target).closest('dt')[0];
+ if (dt) {
+ if (dt.firstOpen)
+ return false;
+ if (!dt.eventDetail)
+ dt.eventDetail = new epgd.eventDetail(dt.title);
+ epgd.utils.loader.process(function () {
+ dt.eventDetail.render();
+ });
+ }
+ },
+ update: function () {
+ var self = this,
+ i;
+ for (i = 0, j = this.select.selectedIndex; i < this.viewCnt && j < this.select.length; i++)
+ this.select[j++].ch.updateTime();
+ window.setTimeout(function () {
+ for (var i = 0, j = self.select.selectedIndex + self.viewCnt; i < self.viewCnt && j < self.select.length; i++)
+ self.select[j++].ch.updateTime();
+ }, 500);
+ }
+};
+
+epgd.pages.magazine.channel = function (id,index, col) {
+ this.id = id;
+ this.index = index;
+ this.col = col;
+ this.startTime;
+ this.endTime;
+}
+epgd.pages.magazine.channel.prototype = {
+ updateTime: function () {
+ if (!this.startTime) {
+ this.startTime = epgd.pages.magazine.startTime;
+ this.endTime = epgd.pages.magazine.endTime;
+ this.loadData(epgd.pages.magazine.startTime, epgd.pages.magazine.endTime);
+ } else {
+ if (epgd.pages.magazine.startTime < this.startTime)
+ this.loadData( epgd.pages.magazine.startTime, this.startTime);
+ if (epgd.pages.magazine.endTime > this.endTime)
+ this.loadData(this.endTime, epgd.pages.magazine.endTime);
+ }
+ },
+ loadData: function (startTime, endTime) {
+ var self = this,
+ insAfter= (self.endTime < endTime);
+ if (insAfter)
+ self.endTime = endTime;
+ else
+ self.startTime = startTime;
+ epgd.ajax({ url: epgd.login.url + "data/events?time=" + startTime + '&endtime=' + endTime + '&channelid=' + this.id }, function (data) {
+ var insHtml = '',
+ first = data.events[0],
+ i,
+ event,
+ $dt= null,
+ $col = $(self.col),
+ desc,h,d,
+ eTime;
+ if (first) {
+ if (insAfter) {
+ $dt = $col.find('dt:last');
+ eTime = $dt[0].eTime;
+ if ($dt.attr('title') == first.id)
+ delete data.events[0];
+ } else {
+ eTime = first.starttime;
+ $dt = $col.find('dt:first');
+ if ($dt.attr('title') == data.events[data.events.length - 1].id)
+ delete data.events[data.events.length-1];
+ }
+ for (i = 0; i < data.events.length; i++) {
+ event = data.events[i];
+ desc = event.shortdescription || event.shorttext;
+ h = event.duration;
+ d = parseInt(h / 60, 10);/*,
+ fav = epgd.profile.fav ? ';border-color:' + epgd.profile.fav(event) : ''*/;
+ h += (event.starttime - eTime);
+ h = h < 600 ? 20 : parseInt(h / 30, 10); // 20px = 10 Minuten
+ eTime += h * 30;
+ insHtml += '<dt title="' + event.id + '" style="height:' + h + 'px;min-height:' + h + 'px">' //' + fav + '
+ + '<div class="title">' + event.title + '</div>'
+ + (epgd.pages.magazine.imgPath && event.imagecount ? '<img src="' + epgd.pages.magazine.imgPath + event.id + '" />' : '')
+ + '<div class="time' + (event.timerid ? ' hasTimer' : '') + '"><u>' + epgd.utils.formatTime(event.starttime) + '</u><i>' + d + '&nbsp;' + epgd.tr.minutes + '</i></div>'
+ + (event.numrating ? '<span class="rate rate' + event.numrating + '"> </span>' : '')
+ + (event.tipp ? '<b class="tipp">' + event.tipp + '</b>' : '')
+ + '<div class="desc">' + (event.genre ? '<span>' + event.genre + '</span> ' : '') + (desc ? desc.replace(/\n/g, '<br />') : '')
+ + '</div></dt>';
+ };
+ } else {
+ h = (endTime - startTime) / 30;
+ insHtml = '<div style="height:' + h + 'px;min-height:' + h + 'px"></div>';
+ first = { starttime: startTime };
+ eTime = startTime;
+ }
+ if (insAfter) {
+ $col.append(insHtml);
+ $col.find('dt:last')[0].eTime = eTime;
+ } else {
+ $col.prepend(insHtml);
+ if ($dt && $dt.length) {
+ $dt.css('margin-top', '');
+ h = $dt[0].starttime - eTime;
+ if (h) {
+ h = parseInt(h/30,10) + parseInt($dt.css('min-height'), 10);
+ $dt.css({ "height": h + 'px', "min-height": h + 'px' })
+ }
+ } else
+ $col.find('dt:last')[0].eTime = eTime;
+ $col.find('dt:first').css('margin-top', parseInt((first.starttime - startTime) / 30, 10))[0].starttime= first;
+ }
+ //self.html = $(col).html();
+ });
+ }
+};
diff --git a/http/src/js/pages.now.js b/http/src/js/pages.now.js
new file mode 100644
index 0000000..8244f33
--- /dev/null
+++ b/http/src/js/pages.now.js
@@ -0,0 +1,135 @@
+epgd.pages.now = {
+ $ul: null,
+ timestamp_min: -1,
+ timestamp_max: 0,
+ timestamp_cur: 0,
+
+ init: function () {
+ $(window).bind('channels_load', function () { epgd.pages.timestamp_max = 0; });
+ },
+ render: function () {
+ //this.renderTime = new Date().getTime();
+ if (!window.pages_now) {
+ this.$search = $('<div style="float:left;margin-left:5px"></div>').appendTo($('#menu_now')).click(function () {
+ if (this.curType == '@Now')
+ window.pages_now.setTime(null,'@Now');
+ });
+ var $searchMenu = this.$searchMenu = $('<ul class="ui-menu ui-widget ui-widget-content"></ul>').appendTo($('#menu_now')).hide();
+ epgd.profile.quickTimes && epgd.profile.quickTimes.replace(/([^=]+)=!?([^~]+)~?/g, function (a, l, v) {
+ $searchMenu.append('<li data-type="' + v + '" class="ui-menu-item ' + (v.indexOf('@') == 0 && v != '@Next' && v != '@Now' ? 'i-search' : 'i-clock') + '">' + l + '</li>');
+ });
+ if (!$searchMenu.find('li[data-type="@Next"]').length)
+ $searchMenu.prepend('<li data-type="@Next" class="ui-menu-item">' + epgd.tr.pages.eventDetail.eventNext + '</li>');
+ if (!$searchMenu.find('li[data-type="@Now"]').length)
+ $searchMenu.prepend('<li data-type="@Now" class="ui-menu-item">' + epgd.tr.pages.dateTimePicker.currentText + '</li>');
+ this.$searchMenu.click(function (ev) {
+ if (ev.target.getAttribute('data-type')) {
+ window.pages_now.setTime(null, ev.target.getAttribute('data-type'));
+ $searchMenu.hide();
+ }
+ });
+ $(window).bind("epgd_close.pages_now", function () {
+ if (window.pages_now) {
+ epgd.$dtPicker.hide();
+ window.pages_now.$searchMenu.remove();
+ window.pages_now.$search.remove();
+ delete window.pages_now;
+ }
+ $(window).unbind(".pages_now");
+ $('#menu_now').unbind(".pages_now");
+ }).bind("datepicker.pages_now", function () {
+ this.pages_now.setTime(epgd.utils.unixTime(epgd.$dtPicker.datetimepicker('getDate')));
+ })[0].pages_now = this;
+ this.$ul = epgd.$con.html('<div id="pageNow"><ul class="teaserList"></ul></div>').find('ul')
+ .click(function (ev) {
+ if ($(ev.target).closest('.channel').length) {
+ $(window).trigger("epgd_close.eventDetail");
+ if (ev.target.className == 'i-tv')
+ epgd.vdrs.current.switchChannel(ev.target.parentNode.id);
+ else {
+ epgd.$menu.menu("select", { target: "#menu_magazine" });
+ epgd.pages.magazine.setChannel(ev.target.parentNode.id);
+ }
+ return;
+ }
+ var li = $(ev.target).closest('li')[0];
+ if (!li) return;
+ if (!li.eventDetail)
+ li.eventDetail = new epgd.eventDetail(li.title);
+ epgd.utils.loader.process(function () {
+ li.eventDetail.render();
+ });
+ });
+ this.setTime(null, '@Now');
+ };
+ $('#menu_now').addClass("menu-active").bind("click.pages_now", function (ev) {
+ if ((ev.target == this || ev.target.nodeName == 'A') && window.pages_now) {
+ window.pages_now.$searchMenu.show();
+ ev.preventDefault();
+ }
+ return false;
+ }).append(epgd.$dtPicker.show());
+ },
+ setTime: function (start, type) {
+ type = type || '@time';
+ var at = ' ' + epgd.tr.pages.now.at;
+ if (type == '@Now' || type == '@time') {
+ this.timestamp_cur = start || epgd.utils.unixTime(epgd.utils.now());
+ this.load("data/events?time=" + this.timestamp_cur);
+ epgd.$dtPicker.datetimepicker('setDate', epgd.utils.date(this.timestamp_cur));
+ } else if (type == '@Next')
+ this.load("data/events?next=1&time=" + this.timestamp_cur);
+ else if (type[0] == '@') {
+ at = ' ' + epgd.tr.menu.search;
+ this.load("data/search", 'post', JSON.stringify({ autotimername: type.slice(1) }));
+ } else {
+ $.timepicker.quicklink({ target: { nodeName: 'U', innerHTML: type }, data: { unit: 'time' } });
+ $(window).trigger('datepicker');
+ }
+ this.$search[0].curType = type;
+ this.$search.text(this.$searchMenu.find('li[data-type="' + type + '"]').text() + at);
+ },
+ load: function (url,type,data) {
+ epgd.utils.loader.process(function () {
+ pages_now.$ul.empty();
+ epgd.ajax({ url: epgd.login.url + url, async: false, cache: false, type:type,data:data }, function (data) {
+ if (!data.events || !data.events.length) {
+ epgd.utils.loader.close();
+ return epgd.utils.popup(epgd.tr.error.noData);
+ }
+ var imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=100&maxH=70&id=' : false,
+ min = 0,
+ max = 2000000000,
+ dFormat = epgd.tr.dateTimePicker.dateFormat.replace(/\.?y+/,'');
+ now = parseInt(epgd.utils.now().getTime() / 1000, 10);
+ //maxHeight = 0,
+ $.each(data.events, function (id, event) {
+ var end = event.starttime + event.duration,
+ progress = ((now - event.starttime) / event.duration * 100),
+ desc = event.shortdescription || event.shorttext;
+ if (event.starttime > min) min = event.starttime;
+ if (end < max) max = end;
+ $('<li title="' + event.id + '" class="ui-widget-content ui-corner-all">'
+ + epgd.channels.getHtml(event.channelid)
+ + '<div class="time' + (event.timerid ? ' hasTimer' : '') + '"><b>' + epgd.utils.formatTime(event.starttime)
+ + '</b>&nbsp;&ndash;&nbsp;' + epgd.utils.formatTime(end) + ' ' + epgd.tr.oClock
+ + (event.tipp ? '<b class="tipp">' + event.tipp + '</b>' : '')
+ + '</div>'
+ + (progress > 0 && progress <= 100 ? '<div class="progress"><div style="width: ' + progress + '%"></div></div>' : '<div class="date">' + epgd.utils.formatDate(event.starttime, dFormat) + '</div>')
+ + '<div class="desc">'
+ + (imgPath && event.imagecount ? '<img src="' + imgPath + event.id + '" />' : '')
+ + '<div class="title">' + event.title
+ + (event.numrating ? '<span class="rate rate' + event.numrating + '"> </span>' : '')
+ + '</div>'
+ + (event.genre ? '<span>' + event.genre + '</span> ' : '') + (desc ? desc.replace(/\n/g, '<br />') : '')
+ + '</div>'
+ + '</li>').appendTo(pages_now.$ul);
+ });
+ epgd.pages.now.timestamp_min = min;
+ epgd.pages.now.timestamp_max = max;
+ epgd.utils.loader.close();
+ });
+ }, true);
+ }
+
+};
diff --git a/http/src/js/pages.profile.js b/http/src/js/pages.profile.js
new file mode 100644
index 0000000..87bbc1b
--- /dev/null
+++ b/http/src/js/pages.profile.js
@@ -0,0 +1,251 @@
+epgd.pages.profile = {
+ render: function () {
+ var /*fav = '',
+ rules= epgd.profile.favCond.split('\n');
+ for (var i = 0; i < rules.length; i++) {
+ var terms = rules[i].match(/if \((.+)\) return '([^']+)';$/);
+ if (terms)
+ fav += '<li style="border:2px solid ' + terms[2] + '"></li>';
+ },*/
+ startPage = epgd.profile.startPage.slice(5),
+ namingmodeOptions = '<option>' + epgd.tr.pages.timerList.namingModes.join('</option><option>') + '</option>',
+ html = '<form id="page_profile"><h3>Interface</h3><div><table>'
+ + '<tr><td>startpage</td><td><select id="startPage">'
+ + jQuery.map(epgd.tr.menu, function (value, key) {
+ return '<option value="menu_' + key + (startPage == key ? '" selected="selected">' : '">') + value + '</option>';
+ }).join('') + '</select></td></tr>'
+ + '<tr><td>default VDR</td><td><select id="defaultVDRuuid">' + $('#menu_vdrs').find('select').html() + '</select></td></tr>'
+ + '<tr><td>datepicker first day</td><td><select id="pickerFirstDay"><option>' + epgd.tr.dateTimePicker.dayNames.join('</option><option>') + '</option></select></td></tr>'
+ + '<tr><td>quicklinks</td><td><textarea rows="5" style="float:left;width:50%; margin-right:10px" id="quickTimes" onchange="epgd.pages.profile.validate.quickTimes(this)">' + epgd.profile.quickTimes.replace(/~/g, '\n') + '</textarea><span>enter in each line label=hh:mm(24h), eg:<br />prime time=20:15 or prime time=!20:15 (this time will not be highlighted in magazine)<br />now=@Now or next=@Next<br />tip=@searchtimerName</span></td></tr>'
+ + '<tr><td>constabel-login</td><td><input type="text" class="full" id="constabelLoginPath" value="' + (epgd.profile.constabelLoginPath || '') + '" />'
+ + '<br />e.g.https://www.eplists.de/eplist.cgi?action=login&login=[username]&secret=[password]</td></tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.maxListEntries + '</td><td><input type="text" id="maxListEntries" value="' + epgd.profile.maxListEntries + '" data-valexp="^[1-9]{0,3}$" /></td></tr>'
+ + '<tr><th colspan="2">' + epgd.tr.menu.magazine + '</th><tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.magazinePan + '</td><td><input type="text" id="magazinePan" value="' + epgd.profile.magazinePan + '" data-valexp="^[0-9]{1,2}$" /></td></tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.magazinePanDelay + '</td><td><input type="text" id="magazinePanDelay" value="' + epgd.profile.magazinePanDelay + '" data-valexp="^[1-9][0-9]{2,3}$" /></td></tr>'
+ + '<tr><th colspan="2">' + epgd.tr.pages.timer.timerList + '</th><tr>'
+ + '<tr><td>' + epgd.tr.pages.timerList.namingMode + '</td><td><b>' + epgd.tr.pages.eventDetail.scrapperSerieInfo + '</b><div>'
+ + epgd.tr.pages.timer.timerList + ': <select id="namingModeSerie">' + namingmodeOptions + '</select><input id="namingModeSerieTemplate" value="' + epgd.profile.namingModeSearchSerieTemplate + '" type="text" style="width:90%" /></div><div>'
+ + epgd.tr.pages.timer.searchTimerList + ': <select id="namingModeSearchSerie">' + namingmodeOptions + '</select><input id="namingModeSearchSerieTemplate" value="' + epgd.profile.namingModeSearchSerieTemplate + '" type="text" style="width:90%" /></div><b style="text-decoration:line-through">'
+ + epgd.tr.pages.eventDetail.scrapperSerieInfo + '</b><div>'
+ + epgd.tr.pages.timer.timerList + ': <select id="namingModeMovie">' + namingmodeOptions + '</select><input id="namingModeMovieTemplate" value="' + epgd.profile.namingModeMovieTemplate + '" type="text" style="width:90%" /></div><div>'
+ + epgd.tr.pages.timer.searchTimerList + ': <select id="namingModeSearchMovie">' + namingmodeOptions + '</select><input id="namingModeSearchMovieTemplate" value="' + epgd.profile.namingModeSearchMovieTemplate + '" type="text" style="width:90%" /></div></td></tr>'
+ + '<tr><td>' + epgd.tr.pages.timerList.chFormat + '</td><td><input id="chFormat" readonly onclick="epgd.timerEditChFormat(this)" value="' + epgd.profile.chFormat + '" /></td></tr>'
+ + '<tr><td>VDR</td><td><select id="timerDefaultVDRuuid"><option value="">Auto</option>' + $('#menu_vdrs').find('select').html() + '</select></td></tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.mailReceiver + '</td><td><input type="mail" value="' + (epgd.profile.mailReceiver || '') + '" id="mailReceiver" /><button onclick="epgd.utils.sendMail(\'checkMailAddress\',\'it works\',\'\',$(form.mailReceiver).val())">' + epgd.tr.test + '</button></td></tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.sendMessages + '</td><td>'
+ + jQuery.map(epgd.tr.pages.timerList.messageTypes, function (value, key) {
+ return '<input type="checkbox" value="' + key + '" name="messageMailTypes"' + (epgd.profile.messageMailTypes.indexOf(key) >= 0 ? ' checked="checked"' : '') + ' />' + value;
+ }).join('&nbsp;&nbsp;')
+ + '</td></tr>'
+ + '<tr><th colspan="2">' + epgd.tr.menu.search + '</th><tr>'
+ + '<tr><td>' + epgd.tr.advanced + '</td><td><input type="checkbox" id="searchAdv" /></td></tr>'
+ + '<tr><th colspan="2">VDR OSD</th><tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.vdr.startWithSched + '</td><td><input type="checkbox" id="startWithSched"' + (epgd.profile.startWithSched == "1" ? ' checked="checked"' : '') + ' /></td></tr>'
+ + '<tr><th colspan="2">' + epgd.tr.menu.records + '</th><tr>'
+ + '<tr><td>' + epgd.tr.pages.profile.record.subFolderSort + '</td><td><select id="recordSubFolderSort"><option value="1">' + epgd.tr.pages.eventDetail.title + ' up</option><option value="2">' + epgd.tr.pages.eventDetail.title + ' down</option><option value="3">' + epgd.tr.pages.timerList.folder + ' up</option><option value="4">' + epgd.tr.pages.timerList.folder + ' down</option><option value="5">' + epgd.tr.pages.timerList.recordTime + ' up</option><option value="6">' + epgd.tr.pages.timerList.recordTime + ' down</option></select></td></tr>'
+ + '</table></div>';
+ if ((epgd.login.rights & epgd.rights.umConfigEdit) == epgd.rights.umConfigEdit)
+ html += '<h3>System</h3><div></div>';
+ epgd.$con.html(html + '</form>'
+ + '<br /><input type="button" value="' + epgd.tr.save + '" onclick="epgd.pages.profile.save()" class="ui-button ui-widget ui-state-default ui-corner-all">');
+ this.form= $( "#page_profile" ).tooltip().accordion({
+ headers: "<h3>",
+ collapsible: true,
+ heightStyle: "content",
+ activate: function (event, ui) {
+ var panel = ui.newPanel[0];
+ if (panel && !panel.hasLoaded) {
+ panel.hasLoaded = true;
+ if (ui.newHeader.text() == "System") {
+ $(panel).html('<table>'
+ + '<tr><th colspan="2">' + epgd.tr.pages.login.label + '</th></tr>'
+ + '<tr><td>' + epgd.tr.pages.login.needLogin + '</td><td><input type="checkbox" id="needLogin" /></td></tr>'
+ + '</table>')
+ .find("#needLogin").click(function () {
+ if (this.checked && !this.hasUsers) {
+ this.checked = false;
+ var elem = this;
+ epgd.ajax({ url: epgd.login.url + "data/users", cache:false }, function (data) {
+ var u = null,
+ $dialog,
+ uName;
+ for (uName in data.users) { u = data.users[uName]; if (u.active) return (elem.hasUsers = elem.checked = true) };
+ $dialog = $('<form title="' + epgd.tr.pages.editUser.user + ' ' + (u ? u.user : epgd.tr.pages.editUser.add) + '"></form>');
+ epgd.pages.editUser.showUser(u, $dialog, function () {
+ $dialog.dialog("close");
+ if (!u)
+ elem.hasUsers = elem.checked = true;
+ else
+ $(elem).click();
+ });
+ $dialog.dialog({ modal: true, width: "auto" });
+ });
+ }
+ }).prop('checked', epgd.profile.needLogin == "1");
+ epgd.ajax({ url: epgd.login.url + "data/parameters", async: true, cache: false, dataType: "json" }, function (data) {
+ var html = '', i, p, val,
+ tr = epgd.tr.pages.profile.system,
+ ptTime = 1, ptBool = 2; // ptNum = 0, , ptAscii = 3
+ for (i in data.parameters) {
+ p = data.parameters[i];
+ if (p.owner == 'epgd') {
+ html += '<tr><td>' + (tr[p.name] || p.name) + '</td><td>';
+ val = typeof p.value == "undefined" ? p["default"] : p.value;
+ if (p.type == ptTime)
+ val= epgd.utils.formatDateTime(val);
+ if (p.readonly)
+ html += val;
+ else {
+ html += '<input data-value="' + val + '" data-valexp="' + (p.valexp || '') + '" id="' + p.name + '"';
+ if (p.type == ptBool)
+ html += ' type="checkbox"' + (val == "1" ? ' checked' : '');
+ else
+ html += ' type="text" class="full" value="' + val + '"';
+ html += ' /></td></tr>';
+ }
+ }
+ }
+ html && $(panel).find('table').append('<tbody id="pSystem"><tr><th>' + tr.label + '</th><th style="min-width:300px"></th></tr>' + html + '</tbody>') //&& $( "#page_profile" ).accordion('refresh');
+ });
+ }
+ }
+ }
+ })[0];
+ this.form.namingModeSerie.selectedIndex = epgd.profile.namingModeSerie;
+ this.form.namingModeSearchSerie.selectedIndex = epgd.profile.namingModeSearchSerie;
+ this.form.namingModeMovie.selectedIndex = epgd.profile.namingModeMovie;
+ this.form.namingModeSearchMovie.selectedIndex = epgd.profile.namingModeSearchMovie;
+
+ $([this.form.namingModeSerie,this.form.namingModeSearchSerie,this.form.namingModeMovie,this.form.namingModeSearchMovie] ).change(function () {
+ this.nextSibling.style.display = (this.selectedIndex == 6) ? 'block' : 'none';
+ }).change();
+ epgd.utils.addPlaceholders(this.form.namingModeSerieTemplate, '%', epgd.tr.pages.timerList.templateFields);
+ epgd.utils.addPlaceholders(this.form.namingModeSearchSerieTemplate, '%', epgd.tr.pages.timerList.templateFields);
+ epgd.utils.addPlaceholders(this.form.namingModeMovieTemplate, '%', epgd.tr.pages.timerList.templateFields);
+ epgd.utils.addPlaceholders(this.form.namingModeSearchMovieTemplate, '%', epgd.tr.pages.timerList.templateFields);
+
+ $(this.form.quickTimes).one("focus", function () {
+ var quickTimes = this;
+ epgd.ajax({ url: epgd.login.url + "data/searchtimers?type=S" }, function (data) {
+ var placeholders = { "@Now": ": current time", "@Next": ": next event" };
+ $.each(data.searchtimers, function (id, t) {
+ placeholders['@' + t.name || t.expression] = ': saved timer';
+ });
+ epgd.utils.addPlaceholders(quickTimes, '@', placeholders);
+ });
+ });
+
+ this.form.searchAdv.checked = epgd.profile.searchAdv == "1";
+ epgd.profile.defaultVDRuuid && $(this.form.defaultVDRuuid).val(epgd.profile.defaultVDRuuid);
+ $(this.form.timerDefaultVDRuuid).val(epgd.profile.timerDefaultVDRuuid);
+ $(this.form.recordSubFolderSort).val(epgd.profile.recordSubFolderSort);
+ this.form.pickerFirstDay.selectedIndex= (epgd.profile.pickerFirstDay || epgd.tr.dateTimePicker.firstDay);
+ },
+ save: function () {
+ var profile = epgd.profile,
+ data = [],
+ form = this.form,
+ owner= "@" + epgd.login.user,
+ panel;
+ function checkData(p) {
+ if (profile[p.name] != p.value)
+ data.push(p);
+ }
+
+ if (!this.validate.quickTimes(form.quickTimes)
+ || !this.validate.checkRegex(form.magazinePan)
+ || !this.validate.checkRegex(form.magazinePanDelay))
+ return false;
+
+ checkData({ name: "defaultVDRuuid", value: $(form.defaultVDRuuid).val() || '', owner: owner });
+ checkData({ name: "quickTimes", value: form.quickTimes.value.replace(/\n/g, '~'), owner: owner });
+ checkData({ name: "startWithSched", value: $(form.startWithSched).prop('checked') ? "1" : "0", owner: owner });
+ checkData({ name: "pickerFirstDay", value: new String(form.pickerFirstDay.selectedIndex), owner: owner });
+ checkData({ name: "startPage", value: $(form.startPage).val() || '', owner: owner });
+ checkData({ name: "namingModeSerie", value: new String(this.form.namingModeSerie.selectedIndex), owner: owner });
+ checkData({ name: "namingModeSearchSerie", value: new String(this.form.namingModeSearchSerie.selectedIndex), owner: owner });
+ checkData({ name: "namingModeMovie", value: new String(this.form.namingModeMovie.selectedIndex), owner: owner });
+ checkData({ name: "namingModeSearchMovie", value: new String(this.form.namingModeSearchMovie.selectedIndex), owner: owner });
+ checkData({ name: "namingModeSerieTemplate", value: new String(this.form.namingModeSerieTemplate.value), owner: owner });
+ checkData({ name: "namingModeSearchSerieTemplate", value: new String(this.form.namingModeSearchSerieTemplate.value), owner: owner });
+ checkData({ name: "namingModeMovieTemplate", value: new String(this.form.namingModeMovieTemplate.value), owner: owner });
+ checkData({ name: "namingModeSearchMovieTemplate", value: new String(this.form.namingModeSearchMovieTemplate.value), owner: owner });
+ checkData({ name: "timerDefaultVDRuuid", value: $(form.timerDefaultVDRuuid).val() || '', owner: owner });
+ checkData({ name: "constabelLoginPath", value: $(form.constabelLoginPath).val() || '', owner: owner });
+ checkData({ name: "chFormat", value: $(form.chFormat).val() || '', owner: owner });
+ checkData({ name: "searchAdv", value: $(form.searchAdv).prop('checked') ? "1" : "0", owner: owner });
+ checkData({ name: "messageMailTypes", value: $(form.messageMailTypes).map(function () { return this.checked ? this.value : "" }).toArray().join(''), owner: owner });
+ checkData({ name: "mailReceiver", value: $(form.mailReceiver).val() || '', owner: owner });
+ checkData({ name: "magazinePan", value: $(form.magazinePan).val() || '', owner: owner });
+ checkData({ name: "magazinePanDelay", value: $(form.magazinePanDelay).val() || '', owner: owner });
+ checkData({ name: "maxListEntries", value: $(form.maxListEntries).val() || '', owner: owner });
+ checkData({ name: "recordSubFolderSort", value: $(form.recordSubFolderSort).val() || '1', owner: owner });
+
+ panel = $('#pSystem').parent().parent()[0];
+ if (panel && panel.hasLoaded) {
+ checkData({ name: "needLogin", value: $(form.needLogin).prop('checked') ? "1" : "0", owner: "webif" });
+ $('#pSystem input').each(function () {
+ if (this.type == 'checkbox') {
+ if (this.checked != (this.getAttribute('data-value') == "1"))
+ data.push({ name: this.id, value: (this.checked ? "1" : "0"), owner: "epgd", valexp: this.getAttribute('data-valexp')});
+ } else if (this.getAttribute('data-value') != this.value) {
+ if (epgd.pages.profile.validate.checkRegex(this))
+ data.push({ name: this.id, value: this.value, owner: "epgd" });
+ else{
+ data = [];
+ return false;
+ }
+ }
+ });
+ }
+ if (data.length) {
+ if (panel) panel.hasLoaded = false;
+ panel = $("#page_profile").accordion("option", "active");
+ $("#page_profile").accordion("option", "active", false).accordion("option", "active", panel);
+ epgd.ajax({
+ url: epgd.login.url + 'data/save-parameters',
+ type: 'post',
+ data: JSON.stringify({ "parameters": data })
+ }, function (res) {
+ res = res.result;
+ if (res && res.state == 200)
+ epgd.utils.topInfo(epgd.tr.dataSaved);
+ else
+ epgd.utils.topInfo(res.message, { isError: 1 });
+ epgd.profile_load();
+ }, function (jqxhr) {
+ try {
+ var msg = '';
+ $(jqxhr.responseJSON.result.failed).each(function () {
+ msg += '<li>' + form[data[this].name].parentNode.previousSibling.innerHTML + '</li>';
+ });
+ if (msg) {
+ epgd.utils.popup('<ol>' + msg + '</ol>', { title: epgd.tr.error.invalid });
+ return true;
+ }
+ } catch (e) { }
+ return false;
+ });
+ }
+ },
+ validate: {
+ quickTimes: function (input) {
+ input.value = input.value.replace(/\n{2,}/g, '\n').replace(/^\n+|\n+$/g, '');
+ if (!/^(\n?[^=]+=!?(([0-1]?[0-9]|2[0-4]):[0-5]?[0-9]|@Now|@Next|@[A-Za-z0-9]*))*$/.test(input.value)) {
+ input.focus();
+ epgd.utils.popup(epgd.tr.error.invalid);
+ return false;
+ }
+ return true;
+ },
+ checkRegex: function (input) {
+ if (input.getAttribute('data-valexp') && !new RegExp(input.getAttribute('data-valexp')).test(input.value)) {
+ input.focus();
+ epgd.utils.popup(epgd.tr.error.invalid);
+ return false;
+ }
+ return true;
+ }
+ }
+};
diff --git a/http/src/js/pages.records.js b/http/src/js/pages.records.js
new file mode 100644
index 0000000..640a27a
--- /dev/null
+++ b/http/src/js/pages.records.js
@@ -0,0 +1,453 @@
+epgd.pages.records = {
+ render: function () {
+ if (!(epgd.login.rights & epgd.rights.umRecordings) == epgd.rights.umRecordings) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ if (!epgd.profile.recordSubFolderSort)
+ epgd.profile.recordSubFolderSort = 1;
+ $('#menu_records').addClass("menu-active");
+ var tr = epgd.tr.pages.records;
+
+ if (!this.$bar) {
+ this.$bar = $('<div class="ui-widget ui-state-highlight ui-corner-all" style="padding:3px 10px">'
+ + '<button class="iAsButton i-trash" title="' + epgd.tr.del + '"/>'
+ + '<div id="recBar">'
+ + '<button class="iAsButton i-refresh" onclick="epgd.pages.records.update()">' + epgd.tr.reload + '</button>'
+ + epgd.pages.help.getIcon('recRefresh') + '&nbsp;&nbsp; '
+ + epgd.tr.pages.search.search + epgd.pages.help.getIcon('recSearch') + '<button class="iAsButton" onclick="this.checked = !this.checked; $(this).toggleClass(\'ui-state-highlight\', this.checked); epgd.pages.records.search();">&nbsp;&#8727;</button>'
+ + '<input id="rSVal" type="text" onkeyup="epgd.pages.records.search(this.value)" />'
+ + '<button class="iAsButton" onclick="this.checked = !this.checked;$(this).toggleClass(\'ui-state-highlight\', this.checked); epgd.pages.records.search();">&#8727;&nbsp;</button>'
+ + '<span style="display:none">'
+ + '<button class="iAsButton i-rewind" onclick="epgd.pages.records.searchMove(1)"></button>'
+ + '<span id="rSCnt">0</span>'
+ + '<button class="iAsButton i-forward" onclick="epgd.pages.records.searchMove(-1)"></button>'
+ + '</span>&nbsp;&nbsp; <input type="checkbox" id="dragdrop"' + ($.support.touch ? '' : ' checked="checked"') + ' onchange="epgd.pages.records.dd(this.checked)" />'
+ + tr.ddLabel + epgd.pages.help.getIcon('recDD')
+ + '</div>'
+ +'</div>');
+ this.$trash = this.$bar.find('.i-trash').droppable({
+ accept: ".rec",
+ hoverClass: "ui-state-hover",
+ tolerance: "pointer",
+ drop: function (ev, ui) {
+ var elem = ui.helper.context;
+ epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$", elem.getAttribute('data-path')), function (ok) {
+ ok && epgd.pages.records.del(elem);
+ });
+ return false;
+ }
+ }).click(function () {
+ var $recs = $("#records").find('.rec.selected');
+ $recs.length && epgd.utils.confirm(epgd.tr.confirmDelete + ($recs.length > 1 ? '<br />' + $recs.length + epgd.tr.entries : ''), function (ok) {
+ ok && $recs.each(function () {
+ epgd.pages.records.del(this);
+ });
+ });
+ });
+ this.curSearch = {
+ pattern: '', searchValue: '', hits: $(), cur: 0, $count: this.$bar.find('#rSCnt')
+ , fromStart: this.$bar.find('#rSVal').prev('button')[0]
+ , toEnd: this.$bar.find('#rSVal').next('button')[0]
+ }
+ epgd.pages.help.initButtons(this.$bar);
+ }
+ this.$bar.insertAfter(epgd.$menu);
+ epgd.$menu.checkMenuSize();
+ $(window).bind("epgd_close.records", function () {
+ epgd.pages.records.$bar.remove();
+ epgd.$menu.checkMenuSize();
+ $(window).unbind(".records");
+ });
+ epgd.$con.html('<div id="records"></div>');
+ epgd.utils.loader.process(function () {
+ epgd.ajax({ url: epgd.login.url + "data/recordings", cache: false }, function (data) {
+ var recs = data.recordings,
+ rec, key, paths, t, p, i,
+ tree = { f: {}, r: [] },
+ vdrs = {},
+ vdr, v,
+ html = '',
+ min = ' ' + epgd.tr.minutes,
+ $divs,
+ sortFunc = epgd.profile.recordSubFolderSort == 6 ? function (a, b) { return a.starttime > b.starttime ? -1 : 1 }
+ : epgd.profile.recordSubFolderSort == 5 ? function (a, b) { return a.starttime > b.starttime ? 1 : -1 }
+ : epgd.profile.recordSubFolderSort == 4 ? function (a, b) { return a.path > b.path ? -1 : 1 }
+ : epgd.profile.recordSubFolderSort == 3 ? function (a, b) { return a.path > b.path ? 1 : -1 }
+ : epgd.profile.recordSubFolderSort == 2 ? function (a, b) { return a.tit > b.tit ? -1 : 1 }
+ : function (a, b) { return a.tit > b.tit ? 1 : -1 };
+
+ for (vdr in epgd.vdrs.list) {
+ v = epgd.vdrs.list[vdr];
+ if (!v.usecommonrecfolder)
+ vdrs[vdr] = { f: {}, r: [] };
+ html += '<div>VDR - ' + v.name + ': ' + v.videodir + ' - ' + parseInt(v.videofree / 1000, 10) + ' GB ' + tr.available + ' / ' + parseInt(v.videototal / 1000, 10) + ' GB</div>';
+ }
+ if (!$('#dragdrop').parent().length) //.append(html)
+ return false;
+ epgd.$con.find('#records').before(html);
+ html = '';
+
+ for (i in recs) {
+ rec = recs[i];
+ t = vdrs[rec.vdruuid] || tree;
+ paths = rec.path.split('/');
+ paths.pop();
+ for (p = 0; p < paths.length; p++) {
+ key = paths[p].replace(/_/g, ' ');
+ t = t.f[key] || (t.f[key] = { f: {}, r: [] });
+ }
+ t.r.push(rec);
+ }
+
+ function checkTree(t) {
+ var hasContent = false,
+ subFolder, subTree;
+ t.cnt = 0;
+ for (subFolder in t.f) {
+ subTree = t.f[subFolder];
+ if (subTree.r.length == 1)
+ t.r.push(subTree.r.pop());
+ checkTree(subTree);
+ if (checkTree(subTree)) {
+ hasContent = true;
+ t.cnt += subTree.cnt;
+ } else
+ delete t.f[subFolder];
+ }
+ if (!hasContent)
+ delete t.f;
+ t.cnt += t.r.length;
+ return hasContent || t.r.length > 0;
+ }
+
+ function renderTree(t) {
+ Object.keys(t.f).sort().forEach(function (subFolder) {
+ var subTree = t.f[subFolder],
+ i;
+ html += subFolder ? '<div class="folder"><h4><span class="i-folder-closed">(' + (subTree.cnt) + ')</span><m class="i-"/>' + subFolder + '</h4>' : '<div>';
+ subTree.f && renderTree(subTree);
+ if (subTree.r.length) {
+ for (i in subTree.r) {
+ rec = subTree.r[i];
+ rec.tit = ((rec.name != subFolder ? rec.name : '')
+ + (subFolder != rec.title && (rec.title != rec.name) ? '<br />' + rec.title : '')
+ + (rec.shorttext && (rec.shorttext != rec.name) ? '<i>' + rec.shorttext + '</i>' : '')) || subFolder;
+ rec.html = '<div class="rec" data-start="' + rec.starttime + '" data-owner="' + (rec.owner || '')
+ + '" data-md5="' + rec.md5path + '" data-path="' + rec.path + '">'
+ + '<em>' + epgd.utils.formatDateTime(rec.starttime) + '</em><u>' + parseInt(rec.duration / 60, 10) + min + '</u><b>'
+ + rec.tit
+ + '</b></div>';
+ };
+ subTree.r.sort(sortFunc);
+ for (i in subTree.r) { html += subTree.r[i].html; }
+ }
+ html += '</div>';
+ });
+ }
+
+ p = {};
+ if (checkTree(tree))
+ p[tr.commonRecFolder] = tree;
+ for (vdr in vdrs) {
+ t = vdrs[vdr];
+ if (checkTree(t)) {
+ p['VDR - ' + epgd.vdrs.list[vdr].name] = t;
+ }
+ }
+ renderTree({ f: p });
+
+ $divs = epgd.$con.find('#records').html(html);
+ if (!$divs.length)
+ return false;
+ $divs = $divs.click(epgd.pages.records.action).find('>div');
+ if ($divs.length == 1)
+ $divs.first().toggleClass('open');
+ epgd.pages.records.$menu = $('<ul class="ui-menu ui-widget ui-widget-content" style="position:absolute">'
+ + '<li class="ui-menu-item" data-type="title"><a class="iAsButton i-sort-name-up" data-sort="1"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="2"></a>&nbsp;' + epgd.tr.pages.eventDetail.title + '</li>'
+ + '<li class="ui-menu-item" data-type="path"><a class="iAsButton i-sort-name-up" data-sort="3"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="4"></a>&nbsp;' + epgd.tr.pages.timerList.folder + '</li>'
+ + '<li class="ui-menu-item" data-type="start"><a class="iAsButton i-sort-name-up" data-sort="5"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="6"></a>&nbsp;' + epgd.tr.pages.timerList.recordTime + '</li>'
+ + '</ul>').hide().appendTo(epgd.$con);
+ $('#dragdrop').change();
+ epgd.pages.records.curSearch.$recs = null;
+ epgd.utils.loader.close();
+ });
+ },true);
+ },
+ search: function (searchValue) {
+ var cs = this.curSearch,
+ sLength,
+ $recs,
+ pattern,
+ fromStart = cs.fromStart.checked,
+ toEnd = cs.toEnd.checked;
+
+ if (!cs.$recs)
+ cs.$recs= epgd.$con.find('#records .rec,h4');
+ if (typeof searchValue == "string")
+ cs.searchValue = searchValue.replace(/</g, '&lt;').replace(/>/g, '&gt;');
+
+ pattern = (fromStart ? '>' + cs.searchValue : cs.searchValue).toLowerCase() + (toEnd ? '<' : '');
+ if (pattern == cs.pattern)
+ return;
+ sLength = cs.searchValue.length;
+ $recs = cs.$recs;
+
+ if (cs.hits.length) {
+ $(cs.hits).each(function () {
+ this.innerHTML = this.innerHTML.replace(/<mark>([^<]+)<\/mark>/gi, '$1');
+ }).parents('.tmp-open').removeClass('tmp-open');
+ if (pattern.indexOf(cs.pattern) == 0)
+ $recs = $(cs.hits);
+ else
+ cs.cur = 0;
+ cs.hits = [];
+ } else
+ cs.cur = 0;
+ cs.pattern = pattern;
+ if (sLength > 2) {
+ $recs.each(function () {
+ var pos = this.innerHTML.toLowerCase().indexOf(pattern);
+ if (pos > 0) {
+ cs.hits.push(this)
+ $(this).parents('.folder').addClass('tmp-open');
+ do {
+ if (fromStart)
+ pos++;
+ this.innerHTML = this.innerHTML.slice(0, pos) + "<mark>" + cs.searchValue + "</mark>" + this.innerHTML.slice(pos + sLength);
+ } while ((pos = this.innerHTML.toLowerCase().indexOf(pattern, pos + 13)) > 0) // "<mark></mark>" = 13 Zeichen
+ }
+ });
+ cs.$count.text(cs.hits.length).parent().show();
+ this.searchMove(0);
+ } else
+ cs.$count.parent().hide();
+ },
+ searchMove: function (dir) {
+ this.curSearch.cur += dir;
+ var n = this.curSearch.hits[this.curSearch.cur];
+ if (!n) {
+ this.curSearch.cur = dir < 0 ? this.curSearch.hits.length - 1 : 0;
+ n = this.curSearch.hits[this.curSearch.cur];
+ }
+ if (n) {
+ n.scrollIntoView(false);
+ $(n).css({ 'background-color': 'green' });
+ window.setTimeout(function () { $(n).css({ 'background-color': '' }); },1500);
+ }
+ },
+ action: function (ev) {
+ var elem = ev.target; // aktueller Sortiebutton, bzw. inital jquery-elment
+ if (elem.nodeName == 'MARK')
+ elem = elem.parentNode;
+ if (elem.nodeName == 'M') {
+ epgd.pages.records.$menu.show().position({
+ my: "left top",
+ at: "left bottom",
+ of: elem
+ }).find('a').removeClass('ui-state-highlight');
+ epgd.pages.records.$menu.find('a[data-sort=' + (elem.curSort || epgd.profile.recordSubFolderSort) +']').addClass('ui-state-highlight');
+ $(document).one('click.recmenu', function (ev) {
+ if (ev.target.nodeName == 'A') {
+ var t = ev.target.parentNode.getAttribute('data-type');
+ if (t ){
+ elem.curSort= ev.target.getAttribute('data-sort');
+ epgd.pages.records.sort(elem.parentNode.parentNode, elem.curSort);
+ }
+ }
+ epgd.pages.records.$menu.hide();
+ $(document).unbind('.recmenu');
+ }).bind("keyup.recmenu", function (e) {
+ if (e.keyCode == 27)
+ $(document).trigger("click.recmenu");
+ });
+ return false;
+ }
+
+ if (elem.nodeName == 'I' || elem.nodeName == 'SPAN')
+ elem = elem.parentNode;
+ if (elem.nodeName == 'B') {
+ elem = elem.parentNode;
+ if (!elem.recDetail)
+ elem.recDetail = new epgd.recordDetail(elem);
+ epgd.utils.loader.process(function () {
+ elem.recDetail.render();
+ });
+ } else if (elem.nodeName == 'H4') {
+ elem = elem.parentNode;
+ if (elem.nodeName == 'DIV' && elem.className.indexOf('folder') >= 0) {
+ if (elem.className.indexOf('open') == -1) {
+ if ($(window).width() < 500) {
+ $(elem).siblings('.open').removeClass('open');
+ document.body.scrollTop = $(elem).offset().top - 35;
+ }
+ $(elem).addClass('open');
+
+ } else
+ $(elem).removeClass('open');
+ }
+ } else
+ $(elem).closest('.rec').toggleClass('selected');
+ },
+ dd: function (enable) {
+ var $records = $("#records"),
+ $recs = $records.find('.rec').has('.ui-draggable');
+ if (enable && $recs.length == 0) {
+ $records.find("h4").droppable(this.__dropSettings);
+ $recs.end().draggable({
+ cancle: "b",
+ revert: "invalid",
+ distance: 15,
+ helper: function () {
+ return $(this).clone().css("display", "block");
+ },
+ appendTo: 'body',
+ cursor: 'pointer',
+ cursorAt: { left: -15, top: 5 },
+ start: function (ev, ui) {
+ $(document).trigger("click.recmenu");
+ $(document.body).addClass('dd-open');
+ document.body.style.paddingTop = epgd.pages.records.$bar.height() + 'px';
+ document.body.scrollTop -= ev.pageY - $(ev.delegateTarget).closest('.folder').offset().top;
+ /*$(document).bind("keyup.dd", [this], function (ev) {
+ if (ev.keyCode == 27)
+ $.ui.ddmanager.dragStop($(ev.data[0]).draggable("instance"), ev); //$(ev.data[0]).draggable("cancel");
+ }); */
+ },
+ stop: function (ev, ui) {
+ // $(document).unbind(".dd");
+ $(document.body).removeClass('dd-open');
+ epgd.$menu.checkMenuSize();
+ }
+ });
+ } else if ($recs.length){
+ $recs.draggable(enable ? "enable" : "disable");
+ }
+ },
+ __dropSettings: {
+ accept: ".rec",
+ hoverClass: "ui-state-hover",
+ tolerance: 'pointer',
+ drop: function (ev, ui) {
+ console.log("Dropped!", ev, ui);
+ var $elem = $(ev.target),
+ path = '';
+ do {
+ path = $elem.text().replace(/^\(.*\)/,'') + '/' + path;
+ $elem = $elem.parent();
+ } while (($elem = $elem.prevAll('h4')).length);
+ epgd.pages.records.move(ui.draggable.context, path.slice(path.indexOf('/', 2) + 1).replace(/ /g, '_'),ev.target.parentNode)
+ return false;
+ }
+ },
+ update: function () {
+ epgd.ajax({ url: epgd.login.url + "data/updaterecordings" }, function (data) {
+ epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace('$sec$', 5), { autoClose: 5000 });
+ $(window).trigger("epgd_close.records");
+ window.setTimeout(function () { epgd.pages.records.render(); }, 5000);
+ });
+ },
+ move: function (elem, path, folder) {
+ var curPath = elem.getAttribute('data-path').split('/'),
+ name = curPath.pop(), // 2016-08-21.11.18.59-0.rec entfernen
+ i,
+ endPos= 0;
+ curPath = curPath.join('/') + '/';
+ for (i = 0; i < Math.min(path.length, curPath.length) && path[i] == curPath[i]; i++) {
+ if (path[i] == '/')
+ endPos= i;
+ }
+ curPath = window.prompt(epgd.tr.pages.records.moveMessage.replace("$src$", curPath), path.concat(curPath.slice(endPos)).replace(/\/{2,}/g, '/').replace(/\/$/, ''));
+ if (curPath) {
+ epgd.ajax({ url: epgd.login.url + 'data/renamerecording?starttime=' + elem.getAttribute('data-start') + '&md5path=' + elem.getAttribute('data-md5') + '&owner=' + elem.getAttribute('data-owner') + '&name=' + curPath.replace(/\//g, '~'), async: true }, function (data) {
+ data = data.result;
+ if (data && data.state == 200) {
+ var $elem = $(elem),
+ $counter = $elem.prevAll('h4').find('span'),
+ $folder= $(folder),
+ newPath = curPath.split('/'), i;
+ $elem.attr('data-path', curPath + '/' + name);
+ $elem.attr('data-md5', "").draggable("disable").addClass("ui-state-disabled");
+ newPath.shift(); //erster Ordner ist ja == folder
+ $elem.parents('.folder:not(:last)').find('>h4>span').each(function () {
+ this.innerHTML = '(' + (parseInt(this.innerHTML.slice(1, -1), 10) - 1) + ')';
+ });
+ $counter = $folder.find('span');
+ $counter.text('(' + (parseInt($counter.text().slice(1, -1), 10) + 1) + ')');
+ for (i = 0; i < newPath.length; i++) {
+ if ($folder.find('>.folder>h4').each(function () {
+ if (this.lastChild.nodeValue == newPath[i]) {
+ $folder = $(this.parentNode);
+ $counter = $folder.find('span');
+ $counter.text('(' + (parseInt($counter.text().slice(1, -1), 10) + 1) + ')');
+ return true;
+ } else
+ return false;
+ }).length == 0) {
+ for (; i < newPath.length; i++) {
+ $folder = $('<h4><span class="i-folder-closed">(1)</span><m class="i-"/>' + newPath[i] + '</h4></div>').droppable(epgd.pages.records.__dropSettings).wrap('<div class="folder open"></div>').parent().appendTo($folder);
+ }
+ };
+ }
+ $elem.appendTo($folder);
+ epgd.pages.records.sort(folder);
+ epgd.utils.topInfo(epgd.tr.dataSaved);
+ epgd.pages.records.__updateRec(elem);
+ }
+ else {
+ epgd.utils.topInfo(data.message, { isError: 1 });
+ return false;
+ }
+ });
+ }
+ return !!curPath;
+ },
+ __updateRec: function (elem, cnt) {
+ epgd.ajax({ url: epgd.login.url + 'data/recording?starttime=' + elem.getAttribute('data-start') + '&path=' + elem.getAttribute('data-path') + '&owner=' + elem.getAttribute('data-owner') + '&'+cnt, async: true }, function (data) {
+ $(elem).attr('data-md5', data.recording.md5path).draggable("enable").removeClass("ui-state-disabled");
+ }, function (jqxhr, e) {
+ if (!cnt)
+ cnt = 0;
+ else if (cnt >= 5)
+ return epgd.utils.popup(epgd.tr.pages.records.notFoundMessage, { title: epgd.tr.error.error });
+
+ window.setTimeout(epgd.pages.records.__updateRec, 3000,elem,++cnt);
+ return true;
+ });
+ },
+ del: function (elem) {
+ epgd.ajax({ url: epgd.login.url + 'data/deleterecording?starttime=' + elem.getAttribute('data-start') + '&md5path=' + elem.getAttribute('data-md5') + '&owner=' + elem.getAttribute('data-owner'), async: true }, function (data) {
+ data = data.result;
+ if (data && data.state == 200) {
+ epgd.utils.topInfo(elem.getAttribute('data-path') + '<br />' + epgd.tr.dataSaved);
+ $(elem).parents('.folder:not(:last)').find('>h4>span').each(function () {
+ this.innerHTML = '(' + (parseInt(this.innerHTML.slice(1, -1), 10) - 1) + ')';
+ });
+ $(elem).remove();
+ } else
+ epgd.utils.topInfo(elem.getAttribute('data-path') + '<br />' + data.message, { isError: 1 });
+ });
+ },
+ sort: function (con, sort) {
+ var $elems = $(con).find('>div.rec'),
+ dir = sort % 2 ? 1 : -1,
+ t;
+ if (!sort)
+ sort = $(">h4>m", con)[0].curSort || epgd.profile.recordSubFolderSort;
+ if (sort < 3)
+ $elems.sort(function (a, b) { return a.lastChild.innerHTML > b.lastChild.innerHTML ? dir : -dir }).appendTo(con);
+ else{
+ t= sort < 5 ? 'data-path' : 'data-start';
+ $elems.sort(function (a, b) { return a.getAttribute(t) > b.getAttribute(t) ? dir : -dir }).appendTo(con);
+ }
+ $(con).find('>div.folder').each(function () {
+ epgd.pages.records.sort(this, sort);
+ });
+ }
+};
+/*
+$.widget("ui.draggable", $.ui.draggable, {
+ _mouseStart: function (ev) {
+ if (this.options.beforeStart && this.options.beforeStart(ev) === false)
+ return false;
+ return this._super(ev);
+ }
+});
+*/ \ No newline at end of file
diff --git a/http/src/js/pages.timer.js b/http/src/js/pages.timer.js
new file mode 100644
index 0000000..44b1cd7
--- /dev/null
+++ b/http/src/js/pages.timer.js
@@ -0,0 +1,743 @@
+epgd.sortTable = function (options) {
+ this.o = $.extend({
+ conSel: epgd.$con,
+ empty: '',
+ right: 1
+ }, options);
+}
+epgd.sortTable.prototype = {
+ sortIcons: '<span class="iAsButton i-sort-name-down sort"></span><span class="iAsButton i-sort-name-up sort"></span>',
+ update: function () { },
+ hideHead: function(){
+ var $ths = this.$con.find('thead:first').hide().find('>tr>th');
+ this.$con.find('tbody:first').html('<tr><td colspan="' + $ths.length + '">' + this.o.empty
+ + ($ths.last().find('.i-doc-new').wrapAll('<div />').parent().html() || '') + '</td></tr>');
+ },
+ showHead: function(){
+ this.$con.find('>table>thead').show();
+ this.filter();
+ this.sort();
+ },
+ getTable: function () { },
+ action: function ($el, iconName, data) {
+ switch (iconName) {
+ case 'refresh':
+ this.update();
+ break;
+ case 'detail':
+ if (!$el[0].eventDetail)
+ $el[0].eventDetail = new epgd.eventDetail(data);
+ epgd.utils.loader.process(function () {
+ $el[0].eventDetail.render();
+ });
+ break;
+ }
+ },
+ render: function ($con, searchData) {
+ this.trs = [];
+ this.$con = $con || $(this.o.conSel);
+ this.$con.empty();
+ if (!(epgd.login.rights & this.o.right) == this.o.right) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error });
+ this.$con.html(this.getTable());
+ this.init();
+ this.update(searchData);
+ },
+ init: function () {
+ var list = this,
+ cIndex = 0;
+ this.$con.find('>table').click(function (ev) {
+ var $el = $(ev.target),
+ el = $el[0],
+ data = el.getAttribute('data-evId'),
+ d,
+ $lastSel;
+ if (data)
+ list.action($el, 'detail', data);
+ else if (ev.target.className == 'i-tv') {
+ epgd.vdrs.current.switchChannel(ev.target.parentNode.id);
+ } else {
+ //if (!searchData || searchData.fromEventDetail != true)
+ // $(window).trigger("epgd_close.eventDetail");
+ $el = $el.closest('span.sort');
+ if ($el.length) {
+ $el.parent().parent().find('.ui-state-highlight').removeClass('ui-state-highlight');
+ $el.addClass("ui-state-highlight");
+ list.sort($el);
+ } else {
+ $el = $(el).closest('span.edit');
+ if ($el.length) {
+ list.action($el, $el[0].className.match(/i-([a-z0-9-]+)/)[1]);
+ } if (list.o.selectable) {
+ if (el.nodeName == 'TD') {
+ $el = $(el).parent().toggleClass('selected');
+ if (ev.shiftKey && this.lastSel) {
+ $lastSel = $(this.lastSel);
+ d = $el.index() - $lastSel.index();
+ if (d > 0)
+ $lastSel.nextAll(':lt(' + d + '):visible').toggleClass('selected', $lastSel.hasClass('selected'));
+ else
+ $lastSel.prevAll(':lt(' + -d + '):visible').toggleClass('selected', $lastSel.hasClass('selected'));
+ }
+ else
+ this.lastSel = $el[0];
+ } else if (el.nodeName == 'B') {
+ d = el.getAttribute('data-t');
+ $(list.trs).filter(":visible").toggleClass('selected', d == 1 ? true : d == 0 ? false : undefined);
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+ }).find('>thead>tr').find('>th').each(function () {
+ this.cIndex = cIndex;
+ cIndex += this.colSpan;
+ }).end().find('[data-defaultSort="1"]>span.sort:last,[data-defaultSort="-1"]>span.sort:first').addClass('ui-state-highlight');
+ this.$con.find('>table>thead input.filter').keyup(function () {
+ list.filter();
+ }).each(function () {
+ if (!this.result)
+ this.result = $('<i style="padding-left:5px;font-weight:normal"></i>').insertAfter(this)[0];
+ });
+ },
+ sort: function ($el) {
+ $el = $el || this.$con.find('>table>thead .ui-state-highlight');
+ if (!$el.length) return;
+ var i = $el.parent()[0],
+ d = ($el.hasClass('i-sort-name-down') ? -1 : 1),
+ trs = this.trs,
+ l,td;
+ if (!i.sortInfo) {
+ i = i.cIndex;
+ for (l = 0; l < trs.length; l++) {
+ td = trs[l].cells[i];
+ td.sort = td.getAttribute('data-sort') || $(td).text().toLowerCase();
+ };
+ } else
+ i = i.cIndex;
+ trs.sort(function (a, b) {
+ var va = a.cells[i].sort,
+ vb = b.cells[i].sort;
+ return (va > vb ? 1 * d : va == vb ? 0 : -1 * d);
+ });
+ this.$con.find('>table>tbody').append(trs.slice());
+ },
+ filter: function(){
+ var cells = {},
+ l, i,
+ tr, hide;
+ this.$con.find('>table>thead input.filter').each(function () {
+ if (this.value)
+ cells[this.parentNode.cIndex] = [this.value.toLowerCase(),0,this.result || {}];
+ else if (this.result)
+ this.result.innerHTML= '';
+ });
+ for (l = 0; l < this.trs.length; l++) {
+ tr = this.trs[l];
+ hide = '';
+ for (i in cells) {
+ if (tr.cells[i].innerHTML.toLowerCase().indexOf(cells[i][0]) == -1)
+ hide = 'none';
+ else
+ cells[i][1]++;
+ }
+ tr.style.display = hide;
+ };
+ for (i in cells)
+ if (cells[i][2].innerHTML = cells[i][1]);
+ }
+}
+
+epgd.timerEditChFormat = function (input) {
+ var formats = ',SD,HD,3D',
+ values = input.value,
+ i;
+ if (values) {
+ values = values.split(',');
+ for (i = 0; i < values.length; i++)
+ formats = formats.replace(',' + values[i] + ',', ',');
+ }
+ $('<div title="' + epgd.tr.pages.timerList.chFormat + '"><ol style="float:left; border:2px inset #ddd; min-height:50px; margin-right:20px;">'
+ + (values.length ? '<li>' + values.join('</li><li>') + '</li>' : '')
+ + '</ol><ul style="float:left; border:2px inset #ddd; min-height:50px;list-style-type:none">'
+ + (formats.length > 1 ? '<li>' + formats.slice(1).replace(/,/g, '</li><li>') + '</li>' : '') + '</div>')
+ .dialog({
+ modal: true,
+ buttons: [{
+ text: epgd.tr.apply,
+ click: function () {
+ var val = '';
+ $(this).find('ol > li').each(function () { val += ',' + this.innerHTML; });
+ input.value = val.slice(1);
+ $(this).dialog("close");
+ }
+ }, {
+ text: epgd.tr.cancel,
+ click: function () {
+ $(this).dialog("close");
+ }
+ }]
+ }).find('ul,ol').sortable({
+ connectWith: "ul,ol"
+ }).disableSelection();
+};
+
+
+// Timer Listen Base Klasse
+epgd.timerListBase = epgd.utils.inherits(function (options, dialog) {
+ this.dialog = dialog;
+ if (this.dialog)
+ this.dialog.list = this;
+ if (!options.conSel) options.conSel = '#content';//'#tabCon';
+ if (!options.empty) options.empty = epgd.tr.pages.timerList.empty;
+ epgd.sortTable.call(this,options);
+}, epgd.sortTable);
+epgd.timerListBase.prototype.getTable = function () {
+ var tr = epgd.tr.pages.timerList;
+ return '<table id="timerList" class="timerTable"><thead><tr><th style="min-width:120px">' + epgd.tr.channel + this.sortIcons
+ + '</th><th></th><th data-defaultSort="1" colspan="2">' + tr.startTime + this.sortIcons + ' <input type="text" class="filter" style="width:50px" /></th><th>'
+ + tr.endTime + '</th><th style="min-width:120px">' + epgd.tr.pages.eventDetail.title + this.sortIcons
+ + ' <input type="text" class="filter" style="width:100px" /></th><th style="min-width:120px">VDR' + this.sortIcons
+ + ' <input type="text" class="filter" style="width:50px" /></th><th style="min-width:130px">' + this.sortIcons
+ + (this.o.addNew ? '<span class="iAsButton i-doc-new edit" title="' + tr.newTimer + '"></span>'
+ + '<span class="iAsButton i-refresh edit" title="' + epgd.tr.reload + '"></span>' : '')
+ + (this.o.selectable ? '<br clear="all" /><span style="margin-top:3px" class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>'
+ + '<div class="selMarkBlock" style="width:auto"><b title="' + epgd.tr.markAll + '" class="selected" data-t="1"></b><b title="' + epgd.tr.markNone
+ + '" data-t="0"></b><b title="' + epgd.tr.markToggle + '"><b class="selected"></b></b></div>' : '')
+ + '</th></tr></thead><tbody></tbody></table>';
+}
+epgd.timerListBase.prototype.update = function () {
+ var timerList = this;
+ epgd.utils.loader.process(function () {
+ timerList.$con.find('tbody').empty();
+ epgd.ajax({ url: epgd.login.url + timerList.o.updateUrl, async: false, cache: false }, function (data) {
+ if (!data.timers.length) {
+ timerList.hideHead();
+ } else {
+ var trs = [],
+ editIcons = timerList.editIcons,
+ noEditStates = 'DF',
+ stateIcons = {
+ 'D': '<div class="i-trash">' + epgd.tr.pages.timerList.timerStates.D + '</div>', // gelöscht
+ 'E': '<div class="i-warning">' + epgd.tr.pages.timerList.timerStates.E + '</div>', // Fehler
+ 'F': '<div class="i-ok">' + epgd.tr.pages.timerList.timerStates.F + '</div>', // Aufnahme erfolgreich
+ 'R': '<div class="i-progress">' + epgd.tr.pages.timerList.timerStates.R + '</div>', // nimmt gerade auf
+ 'P': '<div class="i-clock">' + epgd.tr.pages.timerList.timerStates.P + '</div>', // wartet auf Aufnhemebeginn
+ 'U': '<div class="i-help">' + epgd.tr.pages.timerList.timerStates.U + '</div>' // unbekannt
+ },
+ timerActions = epgd.tr.pages.timerList.timerActions,
+ searchTimerIcon = '<span class="iAsButton i-flashlight edit" title="' + epgd.tr.pages.timer.searchTimerList + ' ' + epgd.tr.edit + '" data-id="$id$">$title$</span>';
+ $.each(data.timers, function (id, t) {
+ t.action = t.action ? t.action.toUpperCase() : 'A';
+ t.state = t.state ? t.state.toUpperCase() : 'U';
+ var vdr = epgd.vdrs.list[t.vdruuid] || { name: '--' },
+ //start = t.day ? t.day + parseInt(t.starttime / 100, 10) * 60 * 60 + (t.starttime % 100) * 60 : new String(100 + parseInt(t.endtime / 100, 10)).slice(1) + ':' + (t.endtime % 100),
+ // searchTimer = t.aux && t.aux.match(/<epgd>.*<expression>([^<]+)<\/expression>/),
+ tr = $('<tr' + (t.active ? '' : ' class="ui-state-disabled"') + '><td>'
+ + epgd.channels.getHtml(t.channelid) + '</td><td>'
+ + (t.action != 'A'
+ ? '<div class="i-wait">' + timerActions[t.action] + '</div>'
+ : stateIcons[t.state]
+ ) + (t.info || '') + '</td>'
+ + '<td data-sort="' + new String(t.day) + new String(10000 + t.starttime).slice(1) + '">'
+ + (t.day ? epgd.utils.formatDate(t.day) : '-')
+ + '</td><td>'
+ + new String(100 + parseInt(t.starttime / 100, 10)).slice(1) + ':' + new String(100 + parseInt(t.starttime % 100, 10)).slice(1)
+ + '</td><td>'
+ + new String(100 + parseInt(t.endtime / 100, 10)).slice(1) + ':' + new String(100 + parseInt(t.endtime % 100, 10)).slice(1)
+ + '</td><td' + (t.eventid ? ' data-evId="' + t.eventid + '">' + (t.title || '') + '<br />' + (t.shorttext || '') : '>') + '</td><td>'
+ + vdr.name + '<br />' + (t.directory ? t.directory + '~' : '') + (t.file || '') + '</td><td>'
+ + (t.autotimerid ? searchTimerIcon.replace('$id$', t.autotimerid).replace('$title$', t.autotimername || t.expression || epgd.tr.pages.timer.searchTimerList) : '')
+ + (noEditStates.indexOf(t.state) == -1 ? editIcons : '') + '</td></tr>')[0];
+ tr.tData = t;
+ trs.push(tr);
+ });
+ timerList.trs = trs;
+ timerList.showHead();
+ /*timerList.$con.find('>table>tbody>tr').find('>td:eq(1)').tooltip({
+ items: "div", content: function () {
+ return this.innerHTML;
+ }
+ })*/
+ }
+ epgd.utils.loader.close();
+ $(window).trigger('timerlist_updated', timerList);
+ });
+ },true);
+}
+epgd.timerListBase.prototype.action = function ($el, iconName,data) {
+ //this.dialog && this.dialog.close && this.dialog.close();
+ var id;
+ switch (iconName) {
+ case 'edit':
+ case 'doc-new':
+ this.dialog.render($el.closest('tr')[0].tData);
+ break;
+ case 'trash':
+ this.del(this.getSelectedIds($el));
+ break;
+ case 'flashlight':
+ id = $el.attr('data-id'),
+ list = this;
+ $(window).one('searchTimerList_updated', function () {
+ list.$con.find('tbody>tr').each(function () {
+ if (this.tData.id == id) {
+ epgd.pages.searchTimerList.dialog.render(this.tData);
+ return false;
+ }
+ });
+ });
+ epgd.$menu.menu("select", { target: "#menu_searchTimerList" });
+ break;
+ default:
+ epgd.sortTable.prototype.action.call(this,$el, iconName, data);
+ }
+};
+epgd.timerListBase.prototype.editIcons = '<span class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span><span class="iAsButton i-edit edit" title="' + epgd.tr.edit + '"></span>';
+epgd.timerListBase.prototype.getSelectedIds = function ($el) {
+ var ids = [];
+ if ($el[0].parentNode.nodeName == 'TH') {
+ $(this.trs).filter(".selected:visible").each(function () {
+ ids.push(this.tData.id);
+ });
+ } else
+ ids.push($el.closest('tr')[0].tData.id);
+ return ids;
+}
+epgd.timerListBase.prototype.del = function (ids, succFunc, arrayName) {
+ var self = this,
+ allIDs= $.isArray(ids) ? ids : [parseInt(ids,10)];
+ ids && allIDs.length && epgd.utils.confirm(epgd.tr.confirmDelete + (allIDs.length > 1 ? '<br />' + allIDs.length + epgd.tr.entries : ''), function (ok) {
+ ok && self.saveArray(allIDs, arrayName || "delete", succFunc);
+ });
+}
+epgd.timerListBase.prototype.saveArray = function (ids, arrayName, succFunc) {
+ var self = this,
+ allIDs= $.isArray(ids) ? ids : [parseInt(ids,10)],
+ data= {};
+ data[arrayName] = allIDs;
+ ids && allIDs.length && this.save(data, null, function (jqxhr) {
+ try {
+ var ids = ',';
+ $(jqxhr.responseJSON.result.failed).each(function () {
+ ids += allIDs[this] + ',';
+ });
+ if (ids.length > 1) {
+ $(self.trs).each(function () {
+ if (ids.indexOf(',' + this.tData.id + ',') >= 0)
+ this.style.backgroundColor = 'red';
+ });
+ }
+ } catch (e) { }
+ return false;
+ }, succFunc);
+};
+epgd.timerListBase.prototype.save = function (data, url, failFunc, succFunc) {
+ if (!data) return false;
+ var timerList = this;
+ epgd.utils.loader.process(function () {
+ epgd.ajax({
+ url: epgd.login.url + (url || timerList.o.saveUrl),
+ type: 'post',
+ data: JSON.stringify(data)
+ }, function (data) {
+ data = data.result;
+ if (data.state == 200)
+ epgd.utils.topInfo(epgd.tr.dataSaved);
+ else
+ epgd.utils.topInfo(data.message, { isError: 1 });
+ epgd.utils.loader.close();
+ timerList.$con && timerList.$con.parent().length && timerList.update();
+ succFunc && succFunc.call(timerList);
+ }, failFunc);
+ },true);
+ return true;
+}
+
+// searchResult List - Klasse
+epgd.searchResultList = epgd.utils.inherits(function (options, dialog) {
+ epgd.timerListBase.call(this, $.extend({
+ saveUrl: 'data/save-searchtimer'
+ }, options),dialog);
+}, epgd.timerListBase);
+epgd.searchResultList.prototype.getTable = function () {
+ var tr = epgd.tr.pages.timerList;
+ return '<table id="searchResultList" class="timerTable"><thead><tr><th style="min-width:120px">' + epgd.tr.channel + this.sortIcons + '</th><th data-defaultSort="1" colspan="2">' + tr.startTime + this.sortIcons + '</th><th>'
+ + tr.endTime + '</th><th>' + epgd.tr.pages.eventDetail.title + this.sortIcons + '</th><th></th></tr></thead><tbody></tbody></table>';
+}
+epgd.searchResultList.prototype.update = function (d) {
+ if (!d)
+ return false;
+ var timerList = this;
+ d.id && delete d.id;
+ d.name && delete d.name;
+ d.max = epgd.profile.maxListEntries;
+ epgd.utils.loader.process(function () {
+ timerList.$con.find('tbody').empty();
+ epgd.ajax({
+ url: epgd.login.url + "data/search",
+ type: 'post',
+ data: JSON.stringify(d)
+ }, function (data) {
+ var trs = [], i;
+ if (!data.events || !data.events.length) {
+ timerList.hideHead();
+ } else {
+ data.count > d.max && epgd.utils.popup('Achtung! Es wurden ' + data.count + ' Ergebnisse gefunden. Angezeigt werden aber nur ' + d.max + '.<br /> Das Nachladen ist noch nicht implementiert! Der Wert kann in den Einstellungen angepasst werden');
+ $.each(data.events, function (id, e) {
+ var trClass = '',
+ icons = '',
+ d;
+ if (e.dones) {
+ for (i in e.dones) {
+ d = e.dones[i];
+ icons += '<span class="iAsButton" title="' + epgd.tr.pages.timerList.doneStates[d.state] + ' data-id=' + d.id + '">' + d.state + '</span>';
+ if (d.state == 'R')
+ trClass = ' class="ui-state-disabled"';
+ }
+ }
+ trs.push($('<tr' + trClass + '><td>'
+ + epgd.channels.getHtml(e.channelid) + '</td><td data-sort="' + e.starttime + '">'
+ + epgd.utils.formatDate(e.starttime) + '</td><td>'
+ + epgd.utils.formatTime(e.starttime) + '</td><td>'
+ + epgd.utils.formatTime(e.starttime + e.duration)
+ + '</td><td data-evId="' + e.id + '">' + e.title + '<br />' + (e.shorttext || '')
+ + '</td><td>' + icons + '</td></tr>').tooltip()[0]);
+ });
+ timerList.trs = trs;
+ timerList.showHead();
+ }
+ epgd.utils.loader.close();
+ timerList.dialog && timerList.dialog.resize && window.setTimeout(function(){timerList.dialog.resize();},100);
+ });
+ },true);
+};
+// Timerliste eines Suchtimers - Klasse
+epgd.searchTimerTimerList = epgd.utils.inherits(function (options, dialog) {
+ epgd.timerListBase.call(this, $.extend({
+ saveUrl: 'data/save-timer',
+ updateUrl: 'data/timers?state=P,R'
+ }, options), dialog);
+}, epgd.timerListBase);
+epgd.searchTimerTimerList.prototype.getTable = function () {
+ var tr = epgd.tr.pages.timerList;
+ return '<table class="timerTable"><thead><tr><th>' + epgd.tr.channel + this.sortIcons + '</th><th data-defaultSort="1" colspan="2">' + tr.startTime + this.sortIcons + '</th><th>'
+ + tr.endTime + '</th><th>' + epgd.tr.pages.eventDetail.title + this.sortIcons + '</th><th>VDR' + this.sortIcons + '</th><th>'
+ + '</th></tr></thead><tbody></tbody></table>';
+}
+epgd.searchTimerTimerList.prototype.update = function (d) {
+ if (!d)
+ return false;
+ var timerList = this;
+ epgd.utils.loader.process(function () {
+ timerList.$con.find('tbody').empty();
+ epgd.ajax({ url: epgd.login.url + timerList.o.updateUrl + '&autotimerid=' + d.id, async: true, cache: false }, function (data) {
+ var trs = [],
+ editIcons = '<span class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>';
+ if (!data.timers.length) {
+ timerList.hideHead();
+ } else {
+ $.each(data.timers, function (id, t) {
+ var vdr = epgd.vdrs.list[t.vdruuid] || { name: '--' },
+ tr = $('<tr' + (t.active ? '' : ' class="ui-state-disabled"') + '><td>'
+ + epgd.channels.getHtml(t.channelid) + '</td><td data-sort="' + new String(t.day) + new String(10000 + t.starttime).slice(1) + '">'
+ + (t.day ? $.datepicker.formatDate(epgd.tr.dateTimePicker.dateFormat, epgd.utils.date(t.day)) : '-')
+ + '</td><td>'
+ + new String(100 + parseInt(t.starttime / 100, 10)).slice(1) + ':' + new String(100 + parseInt(t.starttime % 100, 10)).slice(1)
+ + '</td><td>'
+ + new String(100 + parseInt(t.endtime / 100, 10)).slice(1) + ':' + new String(100 + parseInt(t.endtime % 100, 10)).slice(1)
+ + '</td><td' + (t.eventid ? ' data-evId="' + t.eventid + '">' + t.title + '<br />' + (t.shorttext || '') : '>') + '</td><td>'
+ + vdr.name + '<br />' + t.file + '</td><td>'
+ + editIcons + '</td></tr>')[0];
+ tr.tData = t;
+ trs.push(tr);
+ });
+ timerList.trs = trs;
+ timerList.showHead();
+ }
+ timerList.dialog && timerList.dialog.resize && window.setTimeout(function () { timerList.dialog.resize(); }, 100);
+ epgd.utils.loader.close();
+ });
+ });
+}
+
+// anstehende Timer
+epgd.pages.timerList = new epgd.timerListBase({
+ updateUrl: 'data/timers?state=P,R',
+ saveUrl: 'data/save-timer',
+ selectable: true,
+ addNew: true,
+ right: epgd.rights.umTimer
+}, new epgd.timerDialog());
+// Küzlich erledigte Timer
+epgd.pages.timersDone = new epgd.timerListBase({
+ updateUrl: 'data/timers?state=D,F,E&action=A',
+ right: epgd.rights.umTimer
+});
+epgd.pages.timersDone.getTable = function () {
+ return epgd.timerListBase.prototype.getTable.call(this).replace('data-defaultSort="1"', 'data-defaultSort="-1"')
+}
+// Timerhistorie
+epgd.pages.timerListDone = new epgd.timerListBase({
+ updateUrl: 'data/donetimers', saveUrl: 'data/store-donetimers',
+ selectable: true,
+ right: epgd.rights.umTimer
+});
+epgd.pages.timerListDone.getTable = function () {
+ return '<table id="timerListDone" class="timerTable"><thead><tr><th style="min-width:120px"><input type="text" class="filter" style="width:40px" />'
+ + this.sortIcons + '</th><th data-defaultSort="-1" style="min-width:180px">'
+ + epgd.tr.pages.timerList.recordTime + this.sortIcons + '</th><th>'
+ + epgd.tr.pages.eventDetail.title + ' <input type="text" class="filter" />' + this.sortIcons + '</th><th style="min-width:120px">'
+ + epgd.tr.channel + this.sortIcons + '</th><th style="min-width:100px">' + this.sortIcons
+ + '<span style="margin-top:3px" class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>'
+ + '<div class="selMarkBlock" style="width:auto"><b title="' + epgd.tr.markAll + '" class="selected" data-t="1"></b><b title="' + epgd.tr.markNone
+ + '" data-t="0"></b><b title="' + epgd.tr.markToggle + '"><b class="selected"></b></b></div>'
+ + '</th></tr></thead><tbody></tbody></table>';
+}
+epgd.pages.timerListDone.action = function ($el, iconName,data) {
+ if (iconName == 'detail' && !$el[0].eventDetail)
+ $el[0].eventDetail = new epgd.doneTimerDetail($el.parent()[0]);
+ epgd.timerListBase.prototype.action.call(this, $el, iconName, data);
+}
+epgd.pages.timerListDone.stateIcons = {
+ 'D': '<div class="i-trash">' + epgd.tr.pages.timerList.doneStates.D + '</div>', // gelöscht
+ 'F': '<div class="i-warning">' + epgd.tr.pages.timerList.doneStates.F + '</div>', // Aufnahme fehlgeschlagen
+ 'f': '<div class="i-warning">' + epgd.tr.pages.timerList.doneStates.f + '</div>', // Timer konnte nicht erstellt werden
+ 'R': '<div class="i-ok">' + epgd.tr.pages.timerList.doneStates.R + '</div>', // Aufnahme fertig
+ 'C': '<div class="i-buffer">' + epgd.tr.pages.timerList.doneStates.C + '</div>', // Timer bereits erstellt
+ 'Q': '<div class="i-clock">' + epgd.tr.pages.timerList.doneStates.Q + '</div>' // Timer in Vorbereitung
+}
+epgd.pages.timerListDone.update = function () {
+ var timerList = this;
+ epgd.utils.loader.process(function () {
+ epgd.ajax({ url: epgd.login.url + timerList.o.updateUrl, async: false, cache: false }, function (data) {
+ timerList.$con.find('tbody').empty();
+ if (!data.donetimers.length) {
+ timerList.hideHead();
+ } else {
+ var trs = [],
+ tr, i, t,
+ searchTimerIcon = '<span class="iAsButton i-flashlight edit" title="' + epgd.tr.pages.timer.searchTimerList + ' ' + epgd.tr.edit + '" data-id="$id$">$title$</span>';
+ for (i in data.donetimers) {
+ t = data.donetimers[i];
+ tr = $('<tr><td>'
+ + (t.state && timerList.stateIcons[t.state] || '') + '</td>'
+ + '<td data-sort="' + t.starttime + '">'
+ + epgd.utils.formatDateTime(t.starttime) + '<br />' + parseInt(t.duration / 60, 10) + ' ' + epgd.tr.minutes
+ + '</td><td data-evId="' + t.id + '">' + (t.title || '') + '<br />' + (t.shorttext || '') + '</td><td data-sort="' + t.channelid + '">'
+ + epgd.channels.getHtml(t.channelid) + '</td><td>'
+ + '<span class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>'
+ + (t.autotimerid ? searchTimerIcon.replace('$id$', t.autotimerid).replace('$title$', t.autotimername || t.expression || epgd.tr.pages.timer.searchTimerList) : '')
+ + '</td></tr>')[0];
+ tr.tData = t;
+ trs.push(tr);
+ };
+ timerList.trs = trs;
+ timerList.showHead();
+ }
+ epgd.utils.loader.close();
+ $(window).trigger('timerlist_updated', timerList);
+ });
+ },true);
+}
+// ungesyncte Aufträge
+epgd.pages.timerJobList = new epgd.timerListBase({
+ updateUrl: "data/timers?notaction=A",
+ saveUrl: 'data/delete-timerjobs',
+ selectable: true,
+ right: epgd.rights.umTimer
+}, new epgd.timerDialog());
+
+// Suchtimer
+epgd.pages.searchTimerList = new epgd.timerListBase({
+ saveUrl: 'data/save-searchtimer',
+ right: epgd.rights.umSearchTimer
+}, new epgd.searchTimerDialog());
+epgd.pages.searchTimerList.getTable = function () {
+ var tr = epgd.tr.pages.timerList;
+ return '<table id="timerSearchList" class="timerTable"><thead><tr><th data-defaultSort="1">'
+ + epgd.tr.pages.search.searchName + '/' + epgd.tr.pages.search.searchExpression + ' <input type="text" class="filter" />' + this.sortIcons + '</th><th>' + 'hits' + this.sortIcons
+ + '</th><th style="min-width:120px">VDR' + this.sortIcons + '</th><th>'
+ + '<span class="iAsButton i-doc-new edit" title="' + tr.newTimer + '"></span>'
+ + '<span class="iAsButton i-refresh edit" title="' + epgd.tr.reload + '"></span>'
+ + '<span class="iAsButton i-link-ext edit" title="' + tr.searchTimerReload + '"></span>'
+ + '</th></tr></thead><tbody></tbody></table>';
+}
+epgd.pages.searchTimerList.action = function ($el, iconName, data) {
+ epgd.timerListBase.prototype.action.call(this,$el, iconName, data);
+ switch (iconName) {
+ case 'link-ext':
+ this.triggerUpdate();
+ break;
+ case 'down-dir':
+ if (!$el[0].tList) {
+ var dialog={
+ $td: $el.parent().css("position", "relative"),
+ tdHeight: $el.parent().outerHeight() + 10,
+ data: $el.parent().parent()[0].tData,
+ resize: function () {
+ var $table = this.list.$con.find('>table').addClass("sub");
+ $table.width(this.$td.parent().outerWidth());
+ this.$td.height(this.tdHeight + $table.outerHeight(true) + 10);
+ //this.$td.append(this.list.$con);
+ },
+ toggle : function (doShow) {
+ this.list.$con.toggle(doShow);
+ if (doShow) {
+ this.$td.css("height", "100px");
+ this.list.update(this.data);
+ } else
+ this.$td.css("height", "auto");
+ }
+ },
+ options= {
+ conSel: $('<div style="position:absolute;z-index:5;top:' + dialog.tdHeight + 'px" />').appendTo(document.body)
+ };
+ $el[0].tList = dialog.data.type == 'S' ? new epgd.searchResultList(options, dialog) : new epgd.searchTimerTimerList(options, dialog);
+ $el[0].tList.render();
+ dialog.$td.append(dialog.list.$con);
+ }
+ $el[0].tList.dialog.toggle(true);
+ $el.removeClass('i-down-dir').addClass('i-right-dir');
+ break;
+ case 'right-dir':
+ $el.removeClass('i-right-dir').addClass('i-down-dir');
+ if ($el[0].tList)
+ $el[0].tList.dialog.toggle(false);
+ break;
+ }
+}
+epgd.pages.searchTimerList.update = function () {
+ var timerList = this;
+ this.$con.find('tbody').empty();
+ epgd.utils.loader.process(function () {
+ epgd.ajax({ url: epgd.login.url + "data/searchtimers", async: false, cache: false }, function (data) {
+ var trs = [],
+ editIcons = timerList.editIcons,
+ typeIcons = { 'V': 'i-tv', 'R': 'i-record', 'S': 'i-search' };
+ if (!data.searchtimers.length) {
+ timerList.hideHead();
+ } else {
+ $.each(data.searchtimers, function (id, t) {
+ var vdr = epgd.vdrs.list[t.vdruuid] || { name: '--' },
+ tr = $('<tr' + (t.active ? '' : ' class="ui-state-disabled"') + '><td>'
+ + '<span class="iAsButton i-down-dir edit" title="' + epgd.tr.pages.timer.timerList + '"></span>'
+ + '<div class="' + typeIcons[t.type] + '">' + (t.name || t.expression) + '</div></td><td'
+ + (t.type == 'S' ? '>--' : ' data-sort="' + new String('00000' + t.hits).slice(-5) + '">' + t.hits) + '</td><td>'
+ + vdr.name + '</td><td>' + editIcons + '</td></tr>')[0];
+ tr.tData = t;
+ trs.push(tr);
+ });
+ timerList.trs = trs;
+ timerList.showHead();
+ }
+ epgd.utils.loader.close();
+ $(window).trigger('searchTimerList_updated', timerList);
+ });
+ });
+}
+epgd.pages.searchTimerList.triggerUpdate = function () {
+ var timerList = this;
+ epgd.ajax({url: epgd.login.url + 'data/updatesearchtimer'},function (data) {
+ if (data.result.state == 200)
+ epgd.utils.topInfo(epgd.tr.dataSaved);
+ else
+ epgd.utils.topInfo(data.message, { isError: 1 });
+ timerList.update();
+ });
+}
+
+epgd.pages.search = new epgd.searchDialog();
+
+//message List
+epgd.pages.messageList = new epgd.timerListBase({
+ saveUrl: 'data/markmessages',
+ selectable: true
+})
+epgd.pages.messageList.getTable = function () {
+ return '<table id="messageList" class="timerTable"><thead><tr><th style="width:70px">id' + this.sortIcons + '</th>'
+ + '<th style="width:120px">' + 'Typ' + ' <input type="text" class="filter" style="width:18px" />' + this.sortIcons + '</th>'
+ + '<th style="width:140px">' + 'Zeit' + this.sortIcons + '</th>'
+ + '<th style="width:100px">' + 'Titel' + ' <input type="text" class="filter" style="width:50px" />' + this.sortIcons + '</th>'
+ + '<th style="min-width:140px">' + 'infotext' + ' <input type="text" class="filter" />' + this.sortIcons + '</th>'
+ + '<th style="min-width:190px"><div class="selMarkBlock" style="width:auto;float: right;">'
+ +'<b title="' + epgd.tr.markAll + '" class="selected" data-t="1"></b><b title="' + epgd.tr.markNone + '" data-t="0"></b><b title="' + epgd.tr.markToggle + '"><b class="selected"></b></b></div>'
+ + 'Status' + ' <input type="text" class="filter" style="width:20px" />' + '<br />' + this.sortIcons
+ + '<span class="iAsButton i-refresh edit" title="' + epgd.tr.reload + '"></span>'
+ + '<span style="margin-top:3px" class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>'
+ + '<span style="margin-top:3px" class="iAsButton i-check edit" title="' + epgd.tr.pages.timerList.messageStates.R + '"></span>'
+ + '<span style="margin-top:3px" class="iAsButton i-check-empty edit" title="' + epgd.tr.pages.timerList.messageStates.N + '"></span></th>'
+ + '</tr></thead><tbody></tbody></table>';
+}
+epgd.pages.messageList.update = function (d) {
+ var messList = this;
+ epgd.utils.loader.process(function () {
+ epgd.ajax({ url: epgd.login.url + "data/messages", async: false, cache: false }, function (data) {
+ messList.$con.find('tbody').empty();
+ if (!data.messages.length) {
+ messList.hideHead();
+ } else {
+ var trs = [],
+ tr, i, t,
+ icons = {
+ 'N': '<span class="iAsButton i-check-empty edit">' + epgd.tr.pages.timerList.messageStates.N + '</span>',
+ 'R': '<span class="iAsButton i-check edit">' + epgd.tr.pages.timerList.messageStates.R + '</span>'
+ },
+ types = {
+ 'E': '<div class="i-error">' + epgd.tr.pages.timerList.timerStates.E + '</div>',
+ 'F': '<div class="i-flash-outline">' + epgd.tr.pages.timerList.timerStates.F + '</div>',
+ 'I': '<div class="i-info">' + epgd.tr.pages.timerList.messageTypes.I + '</div>',
+ 'W': '<div class="i-warning">' + epgd.tr.pages.timerList.messageTypes.W + '</div>'
+ };
+ for (i in data.messages) {
+ t = data.messages[i];
+ tr = $('<tr><td data-sort="' + new String('0000000' + t.id).slice(-7) + '">' + t.id + '</td>'
+ + '<td>' + (types[t.type] ||'') +'</td>'
+ + '<td data-sort="' + t.updsp + '">'
+ + epgd.utils.formatDateTime(t.updsp) + '</td>'
+ + '<td>' + t.title + '</td>'
+ + '<td>' + t.text + '</td>'
+ + '<td data-sort="' + t.state + t.updsp + '"><span class="iAsButton i-trash edit" title="' + epgd.tr.del + '"></span>' + (icons[t.state] || '') + '</td>'
+ + '</tr>')[0];
+ tr.tData = t;
+ trs.push(tr);
+ };
+ messList.trs = trs;
+ messList.$con.find('>table>tbody').append(trs.sort(function (a,b) {
+ return a.tData.state == b.tData.state
+ ? a.tData.state.updsp > b.tData.state.updsp ? -1 : 1
+ : a.tData.state > b.tData.state
+ }).slice());
+ messList.showHead();
+ }
+ epgd.utils.loader.close();
+ $(window).trigger('messagelist_updated', messList);
+ });
+ }, true);
+};
+epgd.pages.messageList.action = function ($el, iconName, data) {
+ var ids = this.getSelectedIds($el),
+ state= null,
+ i;
+ if (ids) {
+ switch (iconName) {
+ case 'check':
+ state = $el[0].parentNode.nodeName == 'TH' ? 'R' : 'N';
+ break;
+ case 'check-empty':
+ state = $el[0].parentNode.nodeName == 'TH' ? 'N' : 'R';
+ break;
+ case 'trash':
+ state = 'D'
+ break;
+ }
+ if (state) {
+ for (i in ids)
+ ids[i]= {"id":ids[i], "state":state}
+ state == 'D' ? this.del(ids, null,"messages") : this.saveArray(ids, "messages");
+ return true;
+ }
+ }
+ return epgd.timerListBase.prototype.action.call(this, $el, iconName, data);
+}
+
diff --git a/http/src/js/vdr.js b/http/src/js/vdr.js
new file mode 100644
index 0000000..af27b3c
--- /dev/null
+++ b/http/src/js/vdr.js
@@ -0,0 +1,57 @@
+epgd.vdr = function (uuid, data) {
+ this.uuid = uuid;
+ $.extend(this, data);
+}
+epgd.vdr.prototype.switchChannel = function (channelNo) {
+ epgd.ajax({url: epgd.login.url + 'data/channelswitch?uuid=' + this.uuid + '&channel=' + channelNo, cache: false},function (data) {
+ epgd.utils.popup(data.result.message, { title: 'VDR', autoClose:5000 });
+ });
+}
+epgd.vdr.prototype.wol = function () {
+ epgd.ajax({ url: epgd.login.url + 'data/wakeupvdr?uuid=' + this.uuid, cache: false }, function (data) {
+ epgd.utils.popup(data.result.message, { title: 'VDR', autoClose: 5000 });
+ });
+}
+epgd.vdrs = {
+ list: null,
+ current:null,
+ load: function () {
+ if (!this.list) {
+ this.list = {};
+ epgd.ajax({ url: epgd.login.url + "data/vdrs", async: false }, function (data) {
+ var uuid;
+ for (uuid in data.vdrs) {
+ epgd.vdrs.list[uuid] = new epgd.vdr(uuid, data.vdrs[uuid]);
+ }
+ if (!epgd.vdrs.current){
+ if (epgd.profile.defaultVDRuuid){
+ epgd.vdrs.current = epgd.vdrs.list[epgd.profile.defaultVDRuuid];
+ if (!epgd.vdrs.current)
+ epgd.utils.log('the default VDR (' + epgd.profile.defaultVDRuuid + ' is invalid! Please change this in Web Interface/options)');
+ }
+ if (!epgd.vdrs.current){
+ for (uuid in epgd.vdrs.list) {
+ epgd.vdrs.current = epgd.vdrs.list[uuid];
+ break;
+ }
+ }
+ if (!epgd.vdrs.current){
+ epgd.utils.log('no VDR found',2);
+ epgd.vdrs.current = new epgd.vdr("000-missing-vdr-000", { name: "no VDR found" });
+ }
+ }
+ $(window).trigger('vdrs_load');
+ });
+ }
+ },
+ get: function (uuid) {
+ return this.list[(uuid || this.current)] || {};
+ }
+};
+
+
+epgd.pages.vdrs = {
+ render: function () {
+ epgd.$con.html('<div><button class="iAsButton" onclick="epgd.vdrs.current.wol()">WOL</button>');
+ }
+}; \ No newline at end of file
diff --git a/http/src/lang/de.js b/http/src/lang/de.js
new file mode 100644
index 0000000..2ecb9b0
--- /dev/null
+++ b/http/src/lang/de.js
@@ -0,0 +1,299 @@
+epgd.tr = {
+ oClock: "Uhr",
+ minutes: "min",
+ save: "speichern",
+ copy: "kopieren",
+ apply: "übernehmen",
+ close: "schließen",
+ clear: "löschen",
+ yes: "ja",
+ no: "nein",
+ //open: 'öffnen',
+ edit: "bearbeiten",
+ cancel: "abbrechen",
+ del: "löschen",
+ test: "testen",
+ reload: "neu laden",
+ advanced: "erweitert",
+ markAll: "alle markieren",
+ markNone: "keinen markieren",
+ markToggle: "Markierung umdrehen",
+ confirmDelete: "Willst du wirklich löschen?",
+ dataSaved: "Daten wurden gespeichert",
+ dataDeleted: "Daten wurden gelöscht",
+ dataSend: "Daten wurden gesendet",
+ channel: "Kanal",
+ date: "Datum",
+ entries: " Einträge",
+ error: {
+ error: "Fehler",
+ common: "Es ist ein allgemeiner Fehler aufgetreten",
+ serverNotResponse: "Der Server konnte nicht erreicht werden!",
+ notImplemented: "Dieses Feature ist zur Zeit noch nicht implementiert",
+ forbidden: "Zugriff verweigert!",
+ noData: "Für diese Anfrage konnten keine Daten ermittelt werden!",
+ emptyField: "Bitte fülle das Feld $field$ aus!",
+ invalid: "Der eingegebene Wert ist ungültig!"
+ },
+ menu: {
+ now: "Programm",
+ magazine: "Magazin",
+ timer: "Timer",
+ records: "Aufnahmen",
+ search: "Suche",
+ options: "Einstellungen",
+ help: "Hilfe"
+ },
+ pages: {
+ now: {
+ at:'am'
+ },
+ timer: {
+ timerList: "Timer",
+ searchTimerList: "Suchtimer",
+ timersDone: "kürzliche Aufträge",
+ timerListDone: "Auftragshistorie",
+ timerJobList: "asynchrone Aufträge",
+ messageList: "Systemmeldungen"
+ },
+ timerList: {
+ empty: "Keine Timer vorhanden!",
+ startTime: "Anfang",
+ endTime: "Ende",
+ folder: "Verzeichnis",
+ file: "Dateiname",
+ recordTime: "Aufnahmezeit",
+ lifetime: "Lebenszeit",
+ prio: "Priorität",
+ inactive: "Inaktiv",
+ newTimer: "Neuen Timer anlegen",
+ namingMode: "Ermittlung des Dateinamens",
+ namingModes: ["VDR", "Auto", "Constable", "Serie", "Kategorisiert", "Usermode", "Template"],
+ template: 'Template',
+ templateFields: {
+ "%title%": ": Titel (EPG)",
+ "%shorttext%": ": Untertitel (EPG)",
+ "%starttime%": ": Startzeit (EPG)",
+ "%year%": ": Jahr (EPG)",
+ "%category%": ": Kategorie (EPG)",
+ "%episodname%": ": Titel der Serie (constabel)",
+ "%shortname%": ": Kurz-Titel der Serie (constabel, optional)",
+ "%partname%": ": Name der Folge (constabel)",
+ "%season%": ": Staffel (constabel)",
+ "%part%": ": Teil der Staffel (constabel)",
+ "%number%": ": Nummer über alle Staffeln (constabel)",
+ "%extracol1%": ": Zusätzliche Angaben z.B. bei Tatort die Ermittler (constabel, optional)",
+ "%extracol2%": ": ... z.B. bei Tatort der Ort (constabel, optional)",
+ "%extracol3%": ": ... z.B. bei Tatort der Sender (constabel, optional)"
+ },
+ episode: "Serientitel",
+ noEpgMatch: 'Ignoriere fehlende EPG Info',
+ noRepeat: "Wiederholungen vermeiden",
+ searchTimerReload: "Suchtimer updaten",
+ chInclude: "Auf Kanäle einschränken",
+ chExclude: "Kanäle ausschließen",
+ nextDays: "innerhalb der nächsten $field$ Tage",
+ confirmSaveBigResult: "Die Suche ergibt $cnt$ Treffer, trotzdem speichern?",
+ timerStates: {
+ 'D': 'gelöscht',
+ 'E': 'Fehler',
+ 'F': 'Aufnahme erfolgreich',
+ 'P': 'wartet auf Aufnahmebeginn',
+ 'R': 'nimmt gerade auf...',
+ 'U': 'unbekannt'
+ },
+ timerActions: {
+ // 'A': 'VDR und EPGD sind synchron',
+ 'C': 'Timer wurde erstellt und muss noch von einem VDR übernommen werden',
+ 'D': 'Timer wurde gelöscht und muss noch im VDR gelöscht werden',
+ 'F': 'Zuweisung Timer an VDR fehlgeschlagen',
+ 'M': 'Timer wurde verändert und muss noch vom VDR verarbeitet werden'
+ },
+ doneStates: {
+ 'f': 'Timer konnte nicht erstellt werden',
+ 'C': 'Timer bereits erstellt',
+ 'D': 'Timer gelöscht',
+ 'F': 'Aufnahme fehlgeschlagen',
+ 'Q': 'Timer in Vorbereitung',
+ 'R': 'Aufnahme fertig'
+ },
+ messageStates: {
+ 'N': 'Neu',
+ 'R': 'gelesen'
+ },
+ messageTypes: {
+ 'I': 'Information',
+ 'W': 'Warnung',
+ 'E': 'Fehler',
+ 'F': 'Fataler Fehler'
+ }, chFormat: "bevorzugtes Sendeformat"
+ //channelModes: ["SD", "HD", "3D", "HD,SD", "SD,HD", "3D,HD,SD", "SD,HD,3D"]
+ },
+ eventDetail: {
+ record: "Aufnehmen",
+ repeat: "Wiederholungen",
+ ch_switch: "umschalten",
+ eventNext: "nachfolgend",
+ eventPrev: "vorher",
+ parentalrating: 'ab ',
+ mergeSrc: 'Quelle ',
+ genre: 'Genre',
+ category: 'Kategorie',
+ country: 'Land',
+ year: 'Jahr',
+ season: 'Staffel',
+ part: 'Folge',
+ number: 'Folge Insgesamt',
+ extentedInfo: 'weitere Informationen',
+ scrapperMovieInfo: 'Filminformation',
+ scrapperSerieInfo: 'Serieninformation',
+ constabelInfo: 'Constabel Episodenliste',
+ addConstableLink: 'Link erzeugen',
+ loginConstable: 'Login',
+ title: 'Titel',
+ original_title: 'Originaltitel',
+ runtime: 'Laufzeit',
+ lang: 'Sprache',
+ release_date: 'Erscheinungsdatum',
+ actors: 'Schauspieler',
+ network: 'Netzwerk',
+ seriesstatus: 'Status',
+ gueststars: 'Gäste',
+ homepage: 'Webseite',
+ popularity: 'Beliebtheit',
+ vote_average: '&oslash; Bewertung',
+ extInfo: {
+ director: "Regie",
+ camera: "Kamera",
+ screenplay: "Drehbuch",
+ producer: "Produktion",
+ music: "Musik",
+ moderator: "Moderator",
+ commentator: "Kommentator",
+ guest: "Gäste",
+ info: "Info",
+ other: "Sonstige"
+ }
+ },
+ options:{
+ profile: "allgemein",
+ editChannels: "Kanäle bearbeiten",
+ editUser: "Benutzer bearbeiten"
+ },
+ editChannels: {
+ menu: {
+ channelList: "Kanalliste",
+ referenceList: "Referenzliste",
+ insertAsText: "als Text einfügen",
+ extentEmptyChannelNames: "leere Kanalnamen ergänzen",
+ applyAllChannelNames: "Alle Kanalnamen übernehmen",
+ applyChannelSort: "Kanalsortierung übernehmen"
+ },
+ headline: "Sortierung der Kanäle durch drag und drop, Blockmarkierung durch zus. gedrückter shift-Taste", // und der Merge-prioritäten
+ checkWeb: "Kanal in Webansicht anzeigen",
+ checkVDR: "Kanal zum VDR übertragen",
+ desc_insertList: "Kopiere den Inhalt einer channels.conf in das Textfeld unten. Eine vollständige Liste gibt es beispielsweise hier:"
+ },
+ editUser: {
+ user: "Benutzer",
+ sel: "auswählen",
+ add: "neu anlegen",
+ active: "Aktiv",
+ inActive: "Inaktiv",
+ rights: {
+ label: "Rechte",
+ umConfig: "Konfiguration lesen",
+ umConfigEdit: "Konfiguration ändern",
+ umConfigUsers: "Benutzer konfigurieren",
+ umTimer: "Timer lesen",
+ umTimerEdit: "Timer bearbeiten",
+ umSearchTimer: "Suchtimer lesen",
+ umSearchTimerEdit: "Suchtimer bearbeiten",
+ umFsk: "FSK",
+ umRecordings: "Aufnahmen lesen",
+ umRecordingsEdit: "Aufnahmen editieren"
+ }
+ },
+ help: {
+ url: "lang/hilfe.html",
+ noHelp: "Hierzu konnte kein Hilfstext gefunden werden"
+ },
+ search: {
+ search: 'suchen',
+ searchName: 'Name',
+ searchExpression: "Suchausdruck",
+ caseSensitive: "Klein-/Großschreibung",
+ searchModes: ["exakte Übereinstimmung", "regulärer Ausdruck", "Muster", "enthalten in"],
+ searchFields: ["Titel", "Kurztext", "Beschreibung"],
+ empty: "Leider nichts gefunden.",
+ matchdensity: "Treffergenauigkeit"
+ },
+ login: {
+ label: 'Login',
+ userName: 'Benutzername',
+ password: 'Passwort',
+ loggedAlwaysIn: 'angemeldet bleiben',
+ logout: 'Abmelden',
+ error: 'Fehler beim Anmelden!',
+ logoutMessage: 'Du wurdest abgemeldet!',
+ needLogin: 'Login erforderlich'
+ },
+ records: {
+ ddLabel: "Drag und Drop",
+ refreshMessage: "Aufnahmelisten werden neu geladen, Seite lädt in $sec$ Sekunden neu",
+ moveMessage: "Aufnahme verschieben von \n$src$\nnach",
+ notFoundMessage: "Aufnahme nicht gefunden, ggf einmal aktualisieren",
+ deleteMessage: "Soll die Aufnahme $src$ wirklich gelöscht werden?",
+ available: "Verfügbar",
+ commonRecFolder: "gemeinsame Aufnahmen",
+ similarTimer: "ähnliche Sendung aufnehmen"
+ },
+ profile: {
+ mailReceiver: "eMail",
+ sendTCC: "sende Mail bei Timerkonflikten",
+ sendMessages: "sende Mail bei Systemmeldungen",
+ magazinePan: 'Scrollgeschwindigkeit in Minuten<br />(0 = aus)',
+ magazinePanDelay: 'Auslöseverzögerung',
+ maxListEntries: 'maximal Anzahl Einträge, die auf einmal vom Server geladen werden sollen, z.B. bei Suchen, Suchtimern usw.',
+ system: {
+ label: "epgd Backend"
+ },
+ vdr: {
+ startWithSched:'EPG Menü startet mit Schedule'
+ },
+ record: {
+ subFolderSort: 'Sortierung der Unterordner'
+ }
+ }
+ },
+ dateTimePicker: {
+ monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
+ 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
+ monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+ dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
+ dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ weekHeader: 'KW',
+ timeOnlyTitle: 'Zeit wählen',
+ timeText: 'Sendungsbeginn',
+ timeTextBetween: 'zwischen',
+ prevText: '&#x3C;Zurück',
+ nextText: 'Vor&#x3E;',
+ currentText: 'Jetzt',
+ closeText: 'Fertig',
+ hourText: 'Stunde',
+ minuteText: 'Minute',
+ secondText: 'Sekunde',
+ millisecText: 'Millisekunde',
+ microsecText: 'Mikrosekunde',
+ timezoneText: 'Zeitzone',
+ timeFormat: 'HH:mm',
+ dateFormat: 'D, dd.mm.yy',
+ amNames: ['vorm.', 'AM', 'A'],
+ pmNames: ['nachm.', 'PM', 'P'],
+ isRTL: false,
+ showMonthAfterYear: false,
+ yearSuffix: ''
+ }
+};
diff --git a/http/src/lang/hilfe.html b/http/src/lang/hilfe.html
new file mode 100644
index 0000000..ac2d394
--- /dev/null
+++ b/http/src/lang/hilfe.html
@@ -0,0 +1,303 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js">
+ <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>EPGd Hilfe</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1, minimum-scale=1">
+ <link rel="stylesheet" href="../epgd.css">
+ <script src="../common.js"></script>
+ <script src="../epgd.js"></script>
+</head>
+<body>
+ <div id="help">
+ <ul>
+ <li><a href="#h_intro">Allgemein</a></li>
+ <li><a href="#h_now">Aktuell</a></li>
+ <li><a href="#h_magazine">Magazin</a></li>
+ <li><a href="#h_eventDetail">Detailansicht</a></li>
+ <li><a href="#h_records">Aufnahmen</a></li>
+ <li><a href="#h_timer">Timer</a></li>
+ <li><a href="#h_search">Suche</a></li>
+ <li><a href="#h_options">Einstellungen</a></li>
+ <li><a href="#h_about">Über</a></li>
+ </ul>
+ <div id="h_intro">
+ <h3>Electronic Program Guide daemon</h3>
+ <p>
+ Verwaltung von <b>V</b>ideo <b>D</b>isc <b>R</b>ecorder
+ <ul>
+ <li>Anzeige vom aktuellen TV Programm</li>
+ <li>Verwalten deinen Aufnahmn</li>
+ <li>Erzeugen von Timern und Suchtimern</li>
+ </ul></p>
+ <div id="h_datepicker">
+ <h4>Auswahl von Datum und Zeit</h4>
+ Auf der linken Seite werden alle Tage angezeigt, wo Daten vorhanden sind. Auf der rechten Seite kann dann die Uhrzeit eingestellt werden.
+ Das kann dann auf verschiedene Arten passieren. Die obigen Zeiten sind sogenannte Quicklinks, die unter den <a href="#menu_help,h_options">Einstellungen</a> je Nutzer definiert werden können.
+ <br />Wenn das Datum/die Zeit dann eingestellt wurden, muss noch der Knopf "fertig" gedrückt werden oder auch einfach neben dem Datepicker in das Dokument geklickt werden, damit sich die Ansicht aktualisiert.
+ </div>
+ </div>
+ <div id="h_now">
+ <p>In der "Aktuell" Ansicht wird jeweils die aktuelle Sendung von allen für die Web-Oberfläche definierten Kanäle angezeigt.</p>
+ <p>
+ Neben dem Menüpunkt wird dabei <a class="help" id="bh_datepicker"><input type="text" readonly="readonly" value="Datum/Zeit" /></a> angezeigt, auf das sich die aktuelle Anzeige bezieht. Diese kann dort auch durch Anklicken verändert werden.
+ <br />Zusätzlich existiert noch der Knopf <span class="iAsButton i-check-empty">nachfolgend</span>, der jeweils immer die nachfolgende Sendung pro Kanal anzeigt.
+ </p>
+ </div>
+ <div id="h_magazine">
+ <p>In der Magazin-Ansicht wird für die Web-Oberfläche definierten Kanäle das Programm in einer Spaltenansicht angezeigt, je Spalte ein Kanal. Die Anzahl der Spalten/Kanäle richtet sich dabei nach der Bildschirmgröße. Ausgehend von der in der Menüleiste angezeigten <a class="help" id="bh_datepicker"><input type="text" readonly="readonly" value="Datum/Zeit" /></a> wird dann je nach Bildschirmgröße das Programm angezeigt.</p>
+ <p>Das aktuelle Sichtfeld kann dann durch Scrollen nach oben/unten bzw. links/rechts verschoben werden.
+ Auf Desktop-Systemen dazu einfach die Maus in den Randbereich bewegen. Die Empfindlichkeit für dieses Scrollen kann in den Einstellungen angepasst werden.
+ Durch die Buttons oben links/rechts kann dann noch kanalweise oder seitenweise (Anzahl Spalten/Bildschirm) geblättert werden.</p>
+ <p><h5>Warum sind die Programme nicht immer auf gleicher Höhe?</h5>
+ Die Höhe des Kastens für eine Sendung steht in Relation zur Sendedauer. Ist die Sendung kürzer als 10 Minuten, wird sie aber so trotzdem 20 px hoch gezeichnet, als wäre sie 10 Minuten lang, damit zumindest der Titel der vernünftig lesbar ist.
+ Das delta wird dann mit an die nächste Sendung gegeben und diese wird dann in der Höhe um dieses Delta verringert, damit es danach wieder passt. Ggf. wird das aber auch über mehrere Sendung so mitgeschleppt.
+ </p>
+ </div>
+ <div id="h_eventDetail">
+ <p>Hier werden sämtlich Informationen über ein Event/Sendung angezeigt. Dazu werden ggf. spezielle Serieninformtionen oder Filminformationen in einem eigenen Bereich angezeigt. Die Inhalte beschafft das Scraper Plugin.</p>
+ <h3>Constabel Episodenliste</h3>
+ <p>Hier werden alle Episoden aufgelistet, wenn sie bei constabel gepflegt wurden.</p>
+ <div id="h_constabel">
+ <h4>Editieren/ Link hinzufügen</h4>
+ <p>
+ Die Informationen können direkt auf der constabel Seite gepflegt werden. Dazu muss man dort aber bereits eingeloggt sein. Leider kann an dieser Stelle nicht ermittelt werden, ob man bereits eingeloggt ist oder nicht.
+ <br />Den benötigten Account kann man auf dieser Seite auch direkt anfordern.
+ </p>
+ </div>
+ </div>
+ <div id="h_records">
+ <p>
+ Hier werden die Aufnahmen von sämtlichen registrierten VDRs angezeigt.
+ <div id="h_recDD">
+ Die Aufnahmen können hier per Drag and Drop in andere Ordner verschoben oder auch gelöscht werden, indem sie auf die Mülltonne oben links in der Ecke gezogen werden.
+ <br />Für Touchgeräte wird es am Anfang erstmal ausgeschaltet, damit keine versehenliche Aktion ausgelöst wird.
+ </div>
+ Markierte Aufnahmen können auch über einen Klick auf die Mülltonne gelöscht werden.
+ </p>
+ <p>
+ Der Knopf <button class="iAsButton i-refresh">neu laden</button>
+ <span id="h_recRefresh">fordert alle VDRs auf, ihre Aufnahmeverzeichnisse neu einzulesen.
+ <br /> Nach 5 Sekunden wird die Liste neu geladen, da es keine direkte Rückmeldung gibt, wann die mit Einlesen fertig sind.
+ </span>
+ </p>
+ <p>
+ <button class="iAsButton">&nbsp;∗</button><input type="text" /><button class="iAsButton">∗&nbsp;</button><span><button class="iAsButton i-rewind"></button><span id="rSCnt">5</span><button class="iAsButton i-forward"></button></span>
+ <div id="h_recSearch">
+ Hier können Aufnahmen gesucht werden. Die Fundstellen werden dabei markiert.
+ <br />Mit den Sternknöpfen links und rechts kann man das Wort am Anfang und/oder am Ende suchen.
+ <br />Die einzelnen Treffer können mit den Pfeiltasten angesprungen werden.
+ </div>
+ </p>
+ </div>
+ <div id="h_timer" class="accordion">
+ <h3>allgemein</h3>
+ <div>
+ <p>Wenn man im WEB einen Timer für ein Event anlegt und dabei keine Zeiten angibt, wird eine Row in Timers
+ für dieses Event anhand der Event ID erstellt, dabei werden keine Zeiten eingetragen.
+ Übernimmt nun ein VDR bzw. das epg2vdr Plugin den Timer, wird zu dem Event über die Event ID ein Timer angelegt,
+ hierzu werden Funktionen des VDR verwendet, somit kommt alles wie die Zeiten und Titel etc. vom VDR selbst
+ - ohne Einfluss des epgd oder des Plugin.
+ <br />Im Anschluss werden die von VDR gesetzten Daten des angelegten Timers in die Liste übernommen.</p>
+ </div>
+ <h3>Timer</h3>
+ <div>
+ <p>Hier werden alle aktuellen Timer angezeigt, die noch auf Ausführung warten oder die gerade ausgeführt (aufgenommen) werden.</p>
+ </div>
+ <h3>Suchtimer</h3>
+ <div id="h_sTimer">
+ <p>
+ In der Liste sieht man alle gespeicherten Suchtimer. Diese werden unterschieden nach
+ <div class="i-record">Aufnahme-Timer</div>
+ <div class="i-tv">Umschalt-Timer</div>
+ Erzeugt werde diese alle über einen Dialog. Dazu können diverse Parameter eingestellt werden, mit
+ denen regelmäßig das aktuelle Programm durchsucht wird. Aus allen Treffern wird dann automatisch ein Timer erstellt.
+ <div class="i-search">gespeicherte Suche</div>
+ Hier können diverse Parameter in einer Suche gespeichert werden. Diese können dann in der Suche aufgerufen werden oder auch den Quicklinks hinzugefügt werden. Dadurch kann man sich Favoritensuchen erstellen, wie Primetime mit Spielfilmen.
+ </p>
+ Der Dialog beinhaltet folgende Bereiche:
+ <div><h4>Suchausdruck</h4> analog der <a class="help i-help iAsButton" id="bh_sExpr">Suche</a></div>
+ <div id="h_sTRepeat">
+ <h4>Wiederholungen vermeiden</h4>Jeder Treffer wird mit allen bisher aufgenommenen Aufnahmen
+ (siehe auch vorhandene Aufnahmen), bzw. bereits geplanten Aufnahmen anhand der Einstellung Titel, Kurztext und Beschreibung verglichen.
+ Kommt es zu Doppelungen, wird der Treffer verworfen.
+ </div>
+ <div id="h_sTChFormat">
+ <h4>bevorzugtes Sendeformat</h4>Wird eine Sendung sowohl auf einem SD, wie auch auf einem HD Sender gefunden, kann hier eine Priorität vergeben werden, welche Aufnahme genommen werden soll.
+ In dem sich öffnenden Dialog kann per Drag and Drop die Reihenfolge definiert werden
+ </div>
+ <div id="h_sTNameMode">
+ <h4>Ermittlung des Dateinamens</h4>
+ Der Dateinamen wird, mit Ausnahme des Mode 'VDR', über das Python Skript (/etc/epgd/recording.py) ermittelt, er kann bereits Pfadangaben erhalten.
+ <ul>
+ <li>0 VDR: Keine Ermittlung des Dateinamens, die Bezeichnung der Aufnahme wird dem VDR überlassen lediglich das unten angegebene Verzeichnis wird vorangestellt.</li>
+ <li>1 Auto: Automatische Auswahl des Mode Constable, Serie oder Kategorisiert</li>
+ <li>2 Constable: Dateinamen basierend auf Daten von Constabel (Titel/Staffel/xTeil-Nummer/Untertitel) sofern verfügbar</li>
+ <li>3 Serie: Serienaufnahme ohne Verwendung der Constabel Daten (Titel/Untertitel)</li>
+ <li>4 Kategorisiert: Einorden der Aufnahmen entsprechend der Film-Kategorie (Kategorie/Titel)</li>
+ <li>5 User: Hier kann man sich selbst im Python Skript verewigen</li>
+ <li>6 Template: Der Dateiname wird in Eingabefeld unten definiert, hierbei können Platzhalter (%...%) verwendet werden. Bei Eingabe von % erscheint die Auswahl der Platzhalter</li>
+ </ul>
+ <h4>Verzeichnis</h4>Das Verzeichnis wird dem ermittelten Dateinamen (welcher bereits Verzeichnissangaben enthalten kann) vorangestellt. Hier kann entweder aus einem vorhandenen Verzeichnis ausgewählt werden oder es kann ein neuer Verzeichnisname eingegeben werden.
+ </div>
+ <h4>VDR</h4>Es kann direkt ein teilnehmender VDR ausgewählt werden, der aufnehmen soll. Bei auto wird versucht, den VDR aufnehmen zu lassen, der gerade nicht beschäftigt ist.
+ Jörg: wenn aus irgendeinem Grund die Aufnhame nicht stattfindet, wird dann automatisch ein anderer beauftragt?
+ <hr />
+ <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-state-hover" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-transferthick-e-w"></span><span class="ui-button-text">Timer</span></button>
+ Hier kann man aus einem Suchtimer einen normalen (einmaligen) Timer machen. Soweit möglich werden alle Daten übernommen, die restlichen Daten verfallen.
+ <br /><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" role="button"><span class="ui-button-text">testen</span></button>
+ ES wird direkt eine Live-Suche durchgeführt und das Ergebnis im Dialog angezeigt
+ </div>
+ <h3>kürzliche Aufnahmen</h3>
+ <div><p>Alle Aufnahmen, die kürzlich ausgeführt wurden. Dabei werden auch gelöschte oder fehlgeschlagene Timer angezeigt</p></div>
+ <h3>Auftragshistorie</h3>
+ <div><p>Alle Timer, die mal aufgenommen wurden, sind hier zu finden. Wenn neue Sendungen anhand eines Suchtimers gefunden wurden, werden die hiermit abgeglichen und dann ggf. verworfen, wenn sie bereits aufgenommen wurden, also in der Tabelle bereits existieren.</p></div>
+ <h3>asynchrone Aufträge</h3>
+ <div><p>Wenn über das WebIf oder durch Suchtimer durch den epgd neue Timer erzeugt werden oder vorhandene gelöscht werden, stehen diese Aufgaben solange in dieser Liste, bis der entsprechende VDR diese abgeholt hat.</p></div>
+ </div>
+ <div id="h_search">
+ <p>Gezielte Suche nach einer Sendung</p>
+ <div id="h_sExpr">
+ <h4>Suchausdruck</h4>
+ <p>
+ Der in dem Eingabefeld eingegebene Begriff wird je nach Einstellung im Titel, Kurztext oder in der Beschreibung gesucht.
+ Weiter kann eingestellt werden, wie genau der Begriff gefunden werden soll:
+ <ul>
+ <li>exakte Übereinstimmung</li>
+ <li>regulärer Ausdruck<br />Hier kann mittels regulärem Ausdruck gesucht werden, <a href="http://Jörg, kennst du nen passenden InternetLink?" target="_blank">siehe</a></li>
+ <li>Muster<br />Jörg todo</li>
+ <li>enthalten in<br />der Suchbegriff muss nur zum Teil gefunden werden</li>
+ </ul>
+ </p>
+ </div>
+ <div id="h_sTAdv">
+ <h4>erweitert</h4>
+ <h5>Serientitel</h5>
+ Was dort steht, wird mit dem Namen der Folge oder, wenn das Event keine Seriendaten hat, mit dem Kurztext verglichen
+ <h5>Staffel, Folge und Jahr</h5>
+ hier kann nummerisch eine Zahl oder Bereich eingetragen werden, z.B.
+ <br />Folge <b>5</b> für genau Folge 5
+ <br />Staffel <b>2-</b> für alles ab der 2. Staffel
+ <br />Jahr <b>-2012</b> für alle Folgen bis einschließlich 2012
+ <br />Folge<b>5-10</b> für die Folgen 5 bis 10
+ <h5>Kategorie und Genre</h5>
+ Hier werden alle Kategorien und Genres aufgelistet, die aktuell in den Events gefunden wurden
+ <h5>Tipp, TagesTipp und TopTipp</h5>
+ Jörg: werden die hier verodert?
+ <h5>Ignoriere fehlende EPG Info</h5>
+ Jörg todo
+ </div>
+ <div id="h_sTChannels">
+ <h4>Kanäle</h4>
+ <h5>Kanäle einschränken oder auschließen</h5>Hier können ein oder mehrere Kanäle definiert werden, die entweder aus der Suche ausgeschlossen werden oder auf denen die Suche eingeschränkt wird.
+ </div>
+ <div id="h_sTime">
+ <h4>Sendungsbeginn</h4>
+ Zeitspanne, in der die Sendung beginnen kann bzw. muss.
+ Zusätzlich kann man noch auf Wochentage einschränken.
+ Für die Favoriten-Suchen kann man dann das Ergebnis z.B. nur auf heute begrenzen, in dem man nur <i>innerhalb der nächsten</i> <b>1</b> Tage sucht.
+ </div>
+ <div id="h_sName">
+ <h4>Name des Timers</h4>
+ Hier kann ein aussagekräftiger Name vergeben werden, der auch in den Listen immer angezeigt wird.
+ </div>
+ </div>
+ <div id="h_options">
+ <h3>allgemein</h3>
+ <div id="h_opt_wif">
+ <p>Hier können diverse Einstellungen gemacht werden. Diese könne sowohl das WebIf als auch das Backend betreffen.</p>
+ </div>
+ <h3>Kanäle bearbeiten</h3>
+ <div><p>Zur Zeit können hier nur die Kanalinformationen für die Weboberfläche bearbeitet werden, zum einen die Reihenfolge und ob sie überhaupt im Web angezeigt werden soll.
+ <br />Dazu kann man sich Referenzlisten von channelpedia laden oder per Textfeld eine beliebig andere einfügen. Daraus können dann leere oder generell auch alle Kanalnamen übernommen werden.
+ Zusätzlich kann auch die Sortierung übernommen werden.</p></div>
+ <h3>Benutzer bearbeiten</h3>
+ <div><p>Hier können die Benutzer für die Weboberfläche verwaltet werden.</p></div>
+ </div>
+ <div id="h_about" class="accordion">
+ <h3>Programmierung</h3>
+ <div id="h_develop">
+ Backend (epg daemon, http daemon): Jörg Wendel
+ <br />SQL/Procedures: Christian Kaiser
+ <br />Frontend (Web): Dirk Hermes
+ <br />VDR Plugin <a href="https://projects.vdr-developer.org/git/vdr-epg-daemon.git/">epg2vdr</a>: Jörg Wendel
+ <br />VDR Plugin <a href="https://projects.vdr-developer.org/projects/plg-scraper2vdr/wiki">scraper2vdr</a>: Stefan Braun
+ </div>
+ <h3>Historie</h3>
+ <div id="h_history"><pre></pre></div>
+ <h3>ToDo's</h3>
+ <div id="h_todo"><pre></pre></div>
+ <h3>Fonts</h3>
+ <div id="h_fonts"><h4>Die Fonts wurden von <a href="http://fontello.com/">Fontello.com</a> eingebunden:</h4><pre></pre></div>
+ </div>
+ <script type="text/javascript">
+
+ </script>
+ </div>
+<script type="text/javascript" id="help_js">
+ epgd.pages.help.init = function () {
+ this.$con.tabs({
+ heightStyle: "content",
+ activate: function (event, ui) {
+ var panel = ui.newPanel[0],
+ hash = panel.id;
+ ui.newPanel.parents('.ui-widget-content').each(function () { hash = this.id + ',' + hash });
+ location.hash = '#menu_' + hash;
+ }
+ });
+ this.initButtons(epgd.pages.help.$con);
+ $('.accordion').accordion({
+ heightStyle: "content",
+ collapsible: true,
+ activate: function (event, ui) {
+ var panel = ui.newPanel[0],
+ hash = panel.id;
+ if (!panel.hasLoaded) {
+ panel.hasLoaded = true;
+ switch (hash) {
+ case "h_fonts":
+ $("pre", panel).load('/font/LICENSE.txt', function () { $('#help').tabs('refresh'); });
+ break;
+ case "h_history":
+ epgd.ajax({ url: '/HISTORY.h', dataType: "html", contentType: "text/plain; charset=utf-8", cache: false }, function (data) {
+ if (data.indexOf('Error:') == -1) {
+ $(panel).html('<pre>' + data.replace(/^#.*\n/gm, '') + '</pre>');
+ }
+ });
+ break;
+ case "h_todo":
+ epgd.ajax({ url: '/TODO', dataType: "html", contentType: "text/plain; charset=utf-8", cache: false }, function (data) {
+ if (data.indexOf('Error:') == -1) {
+ $(panel).html('<pre>' + data.replace(/^#.*\n/gm, '') + '</pre>');
+ }
+ });
+ break;
+ }
+ }
+ ui.newPanel.parents('.ui-widget-content').each(function () { hash = this.id + ',' + hash });
+ location.hash = '#menu_' + hash;
+ }
+ });
+ }
+</script>
+<script type="text/javascript">
+ epgd.pages.help.$con = $('#help');
+ epgd.pages.help.init();
+ try {
+ location.hash && location.hash.length > 10 && $(location.hash.slice(10).replace(/,/g, '],[aria-controls=').slice(2) + ']').each(function () {
+ if (this.className.indexOf('accordion-header') >= 0)
+ $(this).click();
+ else
+ $(this).find('a:first').click();
+ });
+ } catch (e) { }
+</script>
+</body>
+</html>
diff --git a/http/tools/less-rhino-1.7.0.js b/http/tools/less-rhino-1.7.0.js
new file mode 100644
index 0000000..e95026f
--- /dev/null
+++ b/http/tools/less-rhino-1.7.0.js
@@ -0,0 +1,9301 @@
+/* LESS.js v1.7.0 RHINO | Copyright (c) 2009-2014, Alexis Sellier <self@cloudhead.net> */
+
+//
+// Stub out `require` in rhino
+//
+function require(arg) {
+ var split = arg.split('/');
+ var resultModule = split.length == 1 ? less.modules[split[0]] : less[split[1]];
+ if (!resultModule) {
+ throw { message: "Cannot find module '" + arg + "'"};
+ }
+ return resultModule;
+}
+
+
+if (typeof(window) === 'undefined') { less = {} }
+else { less = window.less = {} }
+tree = less.tree = {};
+less.mode = 'rhino';
+
+(function() {
+
+ console = function() {
+ var stdout = java.lang.System.out;
+ var stderr = java.lang.System.err;
+
+ function doLog(out, type) {
+ return function() {
+ var args = java.lang.reflect.Array.newInstance(java.lang.Object, arguments.length - 1);
+ var format = arguments[0];
+ var conversionIndex = 0;
+ // need to look for %d (integer) conversions because in Javascript all numbers are doubles
+ for (var i = 1; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (conversionIndex != -1) {
+ conversionIndex = format.indexOf('%', conversionIndex);
+ }
+ if (conversionIndex >= 0 && conversionIndex < format.length) {
+ var conversion = format.charAt(conversionIndex + 1);
+ if (conversion === 'd' && typeof arg === 'number') {
+ arg = new java.lang.Integer(new java.lang.Double(arg).intValue());
+ }
+ conversionIndex++;
+ }
+ args[i-1] = arg;
+ }
+ try {
+ out.println(type + java.lang.String.format(format, args));
+ } catch(ex) {
+ stderr.println(ex);
+ }
+ }
+ }
+ return {
+ log: doLog(stdout, ''),
+ info: doLog(stdout, 'INFO: '),
+ error: doLog(stderr, 'ERROR: '),
+ warn: doLog(stderr, 'WARN: ')
+ };
+ }();
+
+ less.modules = {};
+
+ less.modules.path = {
+ join: function() {
+ var parts = [];
+ for (i in arguments) {
+ parts = parts.concat(arguments[i].split(/\/|\\/));
+ }
+ var result = [];
+ for (i in parts) {
+ var part = parts[i];
+ if (part === '..' && result.length > 0) {
+ result.pop();
+ } else if (part === '' && result.length > 0) {
+ // skip
+ } else if (part !== '.') {
+ if (part.slice(-1)==='\\' || part.slice(-1)==='/') {
+ part = part.slice(0, -1);
+ }
+ result.push(part);
+ }
+ }
+ return result.join('/');
+ },
+ dirname: function(p) {
+ var path = p.split('/');
+ path.pop();
+ return path.join('/');
+ },
+ basename: function(p, ext) {
+ var base = p.split('/').pop();
+ if (ext) {
+ var index = base.lastIndexOf(ext);
+ if (base.length === index + ext.length) {
+ base = base.substr(0, index);
+ }
+ }
+ return base;
+ },
+ extname: function(p) {
+ var index = p.lastIndexOf('.');
+ return index > 0 ? p.substring(index) : '';
+ }
+ };
+
+ less.modules.fs = {
+ readFileSync: function(name) {
+ // read a file into a byte array
+ var file = new java.io.File(name);
+ var stream = new java.io.FileInputStream(file);
+ var buffer = [];
+ var c;
+ while ((c = stream.read()) != -1) {
+ buffer.push(c);
+ }
+ stream.close();
+ return {
+ length: buffer.length,
+ toString: function(enc) {
+ if (enc === 'base64') {
+ return encodeBase64Bytes(buffer);
+ } else if (enc) {
+ return java.lang.String["(byte[],java.lang.String)"](buffer, enc);
+ } else {
+ return java.lang.String["(byte[])"](buffer);
+ }
+ }
+ };
+ }
+ };
+
+ less.encoder = {
+ encodeBase64: function(str) {
+ return encodeBase64String(str);
+ }
+ };
+
+ // ---------------------------------------------------------------------------------------------
+ // private helper functions
+ // ---------------------------------------------------------------------------------------------
+
+ function encodeBase64Bytes(bytes) {
+ // requires at least a JRE Platform 6 (or JAXB 1.0 on the classpath)
+ return javax.xml.bind.DatatypeConverter.printBase64Binary(bytes)
+ }
+ function encodeBase64String(str) {
+ return encodeBase64Bytes(new java.lang.String(str).getBytes());
+ }
+
+})();
+
+var less, tree;
+
+// Node.js does not have a header file added which defines less
+if (less === undefined) {
+ less = exports;
+ tree = require('./tree');
+ less.mode = 'node';
+}
+//
+// less.js - parser
+//
+// A relatively straight-forward predictive parser.
+// There is no tokenization/lexing stage, the input is parsed
+// in one sweep.
+//
+// To make the parser fast enough to run in the browser, several
+// optimization had to be made:
+//
+// - Matching and slicing on a huge input is often cause of slowdowns.
+// The solution is to chunkify the input into smaller strings.
+// The chunks are stored in the `chunks` var,
+// `j` holds the current chunk index, and `currentPos` holds
+// the index of the current chunk in relation to `input`.
+// This gives us an almost 4x speed-up.
+//
+// - In many cases, we don't need to match individual tokens;
+// for example, if a value doesn't hold any variables, operations
+// or dynamic references, the parser can effectively 'skip' it,
+// treating it as a literal.
+// An example would be '1px solid #000' - which evaluates to itself,
+// we don't need to know what the individual components are.
+// The drawback, of course is that you don't get the benefits of
+// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
+// and a smaller speed-up in the code-gen.
+//
+//
+// Token matching is done with the `$` function, which either takes
+// a terminal string or regexp, or a non-terminal function to call.
+// It also takes care of moving all the indices forwards.
+//
+//
+less.Parser = function Parser(env) {
+ var input, // LeSS input string
+ i, // current index in `input`
+ j, // current chunk
+ saveStack = [], // holds state for backtracking
+ furthest, // furthest index the parser has gone to
+ chunks, // chunkified input
+ current, // current chunk
+ currentPos, // index of current chunk, in `input`
+ parser,
+ parsers,
+ rootFilename = env && env.filename;
+
+ // Top parser on an import tree must be sure there is one "env"
+ // which will then be passed around by reference.
+ if (!(env instanceof tree.parseEnv)) {
+ env = new tree.parseEnv(env);
+ }
+
+ var imports = this.imports = {
+ paths: env.paths || [], // Search paths, when importing
+ queue: [], // Files which haven't been imported yet
+ files: env.files, // Holds the imported parse trees
+ contents: env.contents, // Holds the imported file contents
+ contentsIgnoredChars: env.contentsIgnoredChars, // lines inserted, not in the original less
+ mime: env.mime, // MIME type of .less files
+ error: null, // Error in parsing/evaluating an import
+ push: function (path, currentFileInfo, importOptions, callback) {
+ var parserImports = this;
+ this.queue.push(path);
+
+ var fileParsedFunc = function (e, root, fullPath) {
+ parserImports.queue.splice(parserImports.queue.indexOf(path), 1); // Remove the path from the queue
+
+ var importedPreviously = fullPath === rootFilename;
+
+ parserImports.files[fullPath] = root; // Store the root
+
+ if (e && !parserImports.error) { parserImports.error = e; }
+
+ callback(e, root, importedPreviously, fullPath);
+ };
+
+ if (less.Parser.importer) {
+ less.Parser.importer(path, currentFileInfo, fileParsedFunc, env);
+ } else {
+ less.Parser.fileLoader(path, currentFileInfo, function(e, contents, fullPath, newFileInfo) {
+ if (e) {fileParsedFunc(e); return;}
+
+ var newEnv = new tree.parseEnv(env);
+
+ newEnv.currentFileInfo = newFileInfo;
+ newEnv.processImports = false;
+ newEnv.contents[fullPath] = contents;
+
+ if (currentFileInfo.reference || importOptions.reference) {
+ newFileInfo.reference = true;
+ }
+
+ if (importOptions.inline) {
+ fileParsedFunc(null, contents, fullPath);
+ } else {
+ new(less.Parser)(newEnv).parse(contents, function (e, root) {
+ fileParsedFunc(e, root, fullPath);
+ });
+ }
+ }, env);
+ }
+ }
+ };
+
+ function save() { currentPos = i; saveStack.push( { current: current, i: i, j: j }); }
+ function restore() { var state = saveStack.pop(); current = state.current; currentPos = i = state.i; j = state.j; }
+ function forget() { saveStack.pop(); }
+
+ function sync() {
+ if (i > currentPos) {
+ current = current.slice(i - currentPos);
+ currentPos = i;
+ }
+ }
+ function isWhitespace(str, pos) {
+ var code = str.charCodeAt(pos | 0);
+ return (code <= 32) && (code === 32 || code === 10 || code === 9);
+ }
+ //
+ // Parse from a token, regexp or string, and move forward if match
+ //
+ function $(tok) {
+ var tokType = typeof tok,
+ match, length;
+
+ // Either match a single character in the input,
+ // or match a regexp in the current chunk (`current`).
+ //
+ if (tokType === "string") {
+ if (input.charAt(i) !== tok) {
+ return null;
+ }
+ skipWhitespace(1);
+ return tok;
+ }
+
+ // regexp
+ sync ();
+ if (! (match = tok.exec(current))) {
+ return null;
+ }
+
+ length = match[0].length;
+
+ // The match is confirmed, add the match length to `i`,
+ // and consume any extra white-space characters (' ' || '\n')
+ // which come after that. The reason for this is that LeSS's
+ // grammar is mostly white-space insensitive.
+ //
+ skipWhitespace(length);
+
+ if(typeof(match) === 'string') {
+ return match;
+ } else {
+ return match.length === 1 ? match[0] : match;
+ }
+ }
+
+ // Specialization of $(tok)
+ function $re(tok) {
+ if (i > currentPos) {
+ current = current.slice(i - currentPos);
+ currentPos = i;
+ }
+ var m = tok.exec(current);
+ if (!m) {
+ return null;
+ }
+
+ skipWhitespace(m[0].length);
+ if(typeof m === "string") {
+ return m;
+ }
+
+ return m.length === 1 ? m[0] : m;
+ }
+
+ var _$re = $re;
+
+ // Specialization of $(tok)
+ function $char(tok) {
+ if (input.charAt(i) !== tok) {
+ return null;
+ }
+ skipWhitespace(1);
+ return tok;
+ }
+
+ function skipWhitespace(length) {
+ var oldi = i, oldj = j,
+ curr = i - currentPos,
+ endIndex = i + current.length - curr,
+ mem = (i += length),
+ inp = input,
+ c;
+
+ for (; i < endIndex; i++) {
+ c = inp.charCodeAt(i);
+ if (c > 32) {
+ break;
+ }
+
+ if ((c !== 32) && (c !== 10) && (c !== 9) && (c !== 13)) {
+ break;
+ }
+ }
+
+ current = current.slice(length + i - mem + curr);
+ currentPos = i;
+
+ if (!current.length && (j < chunks.length - 1)) {
+ current = chunks[++j];
+ skipWhitespace(0); // skip space at the beginning of a chunk
+ return true; // things changed
+ }
+
+ return oldi !== i || oldj !== j;
+ }
+
+ function expect(arg, msg) {
+ // some older browsers return typeof 'function' for RegExp
+ var result = (Object.prototype.toString.call(arg) === '[object Function]') ? arg.call(parsers) : $(arg);
+ if (result) {
+ return result;
+ }
+ error(msg || (typeof(arg) === 'string' ? "expected '" + arg + "' got '" + input.charAt(i) + "'"
+ : "unexpected token"));
+ }
+
+ // Specialization of expect()
+ function expectChar(arg, msg) {
+ if (input.charAt(i) === arg) {
+ skipWhitespace(1);
+ return arg;
+ }
+ error(msg || "expected '" + arg + "' got '" + input.charAt(i) + "'");
+ }
+
+ function error(msg, type) {
+ var e = new Error(msg);
+ e.index = i;
+ e.type = type || 'Syntax';
+ throw e;
+ }
+
+ // Same as $(), but don't change the state of the parser,
+ // just return the match.
+ function peek(tok) {
+ if (typeof(tok) === 'string') {
+ return input.charAt(i) === tok;
+ } else {
+ return tok.test(current);
+ }
+ }
+
+ // Specialization of peek()
+ function peekChar(tok) {
+ return input.charAt(i) === tok;
+ }
+
+
+ function getInput(e, env) {
+ if (e.filename && env.currentFileInfo.filename && (e.filename !== env.currentFileInfo.filename)) {
+ return parser.imports.contents[e.filename];
+ } else {
+ return input;
+ }
+ }
+
+ function getLocation(index, inputStream) {
+ var n = index + 1,
+ line = null,
+ column = -1;
+
+ while (--n >= 0 && inputStream.charAt(n) !== '\n') {
+ column++;
+ }
+
+ if (typeof index === 'number') {
+ line = (inputStream.slice(0, index).match(/\n/g) || "").length;
+ }
+
+ return {
+ line: line,
+ column: column
+ };
+ }
+
+ function getDebugInfo(index, inputStream, env) {
+ var filename = env.currentFileInfo.filename;
+ if(less.mode !== 'browser' && less.mode !== 'rhino') {
+ filename = require('path').resolve(filename);
+ }
+
+ return {
+ lineNumber: getLocation(index, inputStream).line + 1,
+ fileName: filename
+ };
+ }
+
+ function LessError(e, env) {
+ var input = getInput(e, env),
+ loc = getLocation(e.index, input),
+ line = loc.line,
+ col = loc.column,
+ callLine = e.call && getLocation(e.call, input).line,
+ lines = input.split('\n');
+
+ this.type = e.type || 'Syntax';
+ this.message = e.message;
+ this.filename = e.filename || env.currentFileInfo.filename;
+ this.index = e.index;
+ this.line = typeof(line) === 'number' ? line + 1 : null;
+ this.callLine = callLine + 1;
+ this.callExtract = lines[callLine];
+ this.stack = e.stack;
+ this.column = col;
+ this.extract = [
+ lines[line - 1],
+ lines[line],
+ lines[line + 1]
+ ];
+ }
+
+ LessError.prototype = new Error();
+ LessError.prototype.constructor = LessError;
+
+ this.env = env = env || {};
+
+ // The optimization level dictates the thoroughness of the parser,
+ // the lower the number, the less nodes it will create in the tree.
+ // This could matter for debugging, or if you want to access
+ // the individual nodes in the tree.
+ this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
+
+ //
+ // The Parser
+ //
+ parser = {
+
+ imports: imports,
+ //
+ // Parse an input string into an abstract syntax tree,
+ // @param str A string containing 'less' markup
+ // @param callback call `callback` when done.
+ // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply
+ //
+ parse: function (str, callback, additionalData) {
+ var root, line, lines, error = null, globalVars, modifyVars, preText = "";
+
+ i = j = currentPos = furthest = 0;
+
+ globalVars = (additionalData && additionalData.globalVars) ? less.Parser.serializeVars(additionalData.globalVars) + '\n' : '';
+ modifyVars = (additionalData && additionalData.modifyVars) ? '\n' + less.Parser.serializeVars(additionalData.modifyVars) : '';
+
+ if (globalVars || (additionalData && additionalData.banner)) {
+ preText = ((additionalData && additionalData.banner) ? additionalData.banner : "") + globalVars;
+ parser.imports.contentsIgnoredChars[env.currentFileInfo.filename] = preText.length;
+ }
+
+ str = str.replace(/\r\n/g, '\n');
+ // Remove potential UTF Byte Order Mark
+ input = str = preText + str.replace(/^\uFEFF/, '') + modifyVars;
+ parser.imports.contents[env.currentFileInfo.filename] = str;
+
+ // Split the input into chunks.
+ chunks = (function (input) {
+ var len = input.length, level = 0, parenLevel = 0,
+ lastOpening, lastOpeningParen, lastMultiComment, lastMultiCommentEndBrace,
+ chunks = [], emitFrom = 0,
+ parserCurrentIndex, currentChunkStartIndex, cc, cc2, matched;
+
+ function fail(msg, index) {
+ error = new(LessError)({
+ index: index || parserCurrentIndex,
+ type: 'Parse',
+ message: msg,
+ filename: env.currentFileInfo.filename
+ }, env);
+ }
+
+ function emitChunk(force) {
+ var len = parserCurrentIndex - emitFrom;
+ if (((len < 512) && !force) || !len) {
+ return;
+ }
+ chunks.push(input.slice(emitFrom, parserCurrentIndex + 1));
+ emitFrom = parserCurrentIndex + 1;
+ }
+
+ for (parserCurrentIndex = 0; parserCurrentIndex < len; parserCurrentIndex++) {
+ cc = input.charCodeAt(parserCurrentIndex);
+ if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {
+ // a-z or whitespace
+ continue;
+ }
+
+ switch (cc) {
+ case 40: // (
+ parenLevel++;
+ lastOpeningParen = parserCurrentIndex;
+ continue;
+ case 41: // )
+ if (--parenLevel < 0) {
+ return fail("missing opening `(`");
+ }
+ continue;
+ case 59: // ;
+ if (!parenLevel) { emitChunk(); }
+ continue;
+ case 123: // {
+ level++;
+ lastOpening = parserCurrentIndex;
+ continue;
+ case 125: // }
+ if (--level < 0) {
+ return fail("missing opening `{`");
+ }
+ if (!level && !parenLevel) { emitChunk(); }
+ continue;
+ case 92: // \
+ if (parserCurrentIndex < len - 1) { parserCurrentIndex++; continue; }
+ return fail("unescaped `\\`");
+ case 34:
+ case 39:
+ case 96: // ", ' and `
+ matched = 0;
+ currentChunkStartIndex = parserCurrentIndex;
+ for (parserCurrentIndex = parserCurrentIndex + 1; parserCurrentIndex < len; parserCurrentIndex++) {
+ cc2 = input.charCodeAt(parserCurrentIndex);
+ if (cc2 > 96) { continue; }
+ if (cc2 == cc) { matched = 1; break; }
+ if (cc2 == 92) { // \
+ if (parserCurrentIndex == len - 1) {
+ return fail("unescaped `\\`");
+ }
+ parserCurrentIndex++;
+ }
+ }
+ if (matched) { continue; }
+ return fail("unmatched `" + String.fromCharCode(cc) + "`", currentChunkStartIndex);
+ case 47: // /, check for comment
+ if (parenLevel || (parserCurrentIndex == len - 1)) { continue; }
+ cc2 = input.charCodeAt(parserCurrentIndex + 1);
+ if (cc2 == 47) {
+ // //, find lnfeed
+ for (parserCurrentIndex = parserCurrentIndex + 2; parserCurrentIndex < len; parserCurrentIndex++) {
+ cc2 = input.charCodeAt(parserCurrentIndex);
+ if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }
+ }
+ } else if (cc2 == 42) {
+ // /*, find */
+ lastMultiComment = currentChunkStartIndex = parserCurrentIndex;
+ for (parserCurrentIndex = parserCurrentIndex + 2; parserCurrentIndex < len - 1; parserCurrentIndex++) {
+ cc2 = input.charCodeAt(parserCurrentIndex);
+ if (cc2 == 125) { lastMultiCommentEndBrace = parserCurrentIndex; }
+ if (cc2 != 42) { continue; }
+ if (input.charCodeAt(parserCurrentIndex + 1) == 47) { break; }
+ }
+ if (parserCurrentIndex == len - 1) {
+ return fail("missing closing `*/`", currentChunkStartIndex);
+ }
+ parserCurrentIndex++;
+ }
+ continue;
+ case 42: // *, check for unmatched */
+ if ((parserCurrentIndex < len - 1) && (input.charCodeAt(parserCurrentIndex + 1) == 47)) {
+ return fail("unmatched `/*`");
+ }
+ continue;
+ }
+ }
+
+ if (level !== 0) {
+ if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {
+ return fail("missing closing `}` or `*/`", lastOpening);
+ } else {
+ return fail("missing closing `}`", lastOpening);
+ }
+ } else if (parenLevel !== 0) {
+ return fail("missing closing `)`", lastOpeningParen);
+ }
+
+ emitChunk(true);
+ return chunks;
+ })(str);
+
+ if (error) {
+ return callback(new(LessError)(error, env));
+ }
+
+ current = chunks[0];
+
+ // Start with the primary rule.
+ // The whole syntax tree is held under a Ruleset node,
+ // with the `root` property set to true, so no `{}` are
+ // output. The callback is called when the input is parsed.
+ try {
+ root = new(tree.Ruleset)(null, this.parsers.primary());
+ root.root = true;
+ root.firstRoot = true;
+ } catch (e) {
+ return callback(new(LessError)(e, env));
+ }
+
+ root.toCSS = (function (evaluate) {
+ return function (options, variables) {
+ options = options || {};
+ var evaldRoot,
+ css,
+ evalEnv = new tree.evalEnv(options);
+
+ //
+ // Allows setting variables with a hash, so:
+ //
+ // `{ color: new(tree.Color)('#f01') }` will become:
+ //
+ // new(tree.Rule)('@color',
+ // new(tree.Value)([
+ // new(tree.Expression)([
+ // new(tree.Color)('#f01')
+ // ])
+ // ])
+ // )
+ //
+ if (typeof(variables) === 'object' && !Array.isArray(variables)) {
+ variables = Object.keys(variables).map(function (k) {
+ var value = variables[k];
+
+ if (! (value instanceof tree.Value)) {
+ if (! (value instanceof tree.Expression)) {
+ value = new(tree.Expression)([value]);
+ }
+ value = new(tree.Value)([value]);
+ }
+ return new(tree.Rule)('@' + k, value, false, null, 0);
+ });
+ evalEnv.frames = [new(tree.Ruleset)(null, variables)];
+ }
+
+ try {
+ var preEvalVisitors = [],
+ visitors = [
+ new(tree.joinSelectorVisitor)(),
+ new(tree.processExtendsVisitor)(),
+ new(tree.toCSSVisitor)({compress: Boolean(options.compress)})
+ ], i, root = this;
+
+ if (options.plugins) {
+ for(i =0; i < options.plugins.length; i++) {
+ if (options.plugins[i].isPreEvalVisitor) {
+ preEvalVisitors.push(options.plugins[i]);
+ } else {
+ if (options.plugins[i].isPreVisitor) {
+ visitors.splice(0, 0, options.plugins[i]);
+ } else {
+ visitors.push(options.plugins[i]);
+ }
+ }
+ }
+ }
+
+ for(i = 0; i < preEvalVisitors.length; i++) {
+ preEvalVisitors[i].run(root);
+ }
+
+ evaldRoot = evaluate.call(root, evalEnv);
+
+ for(i = 0; i < visitors.length; i++) {
+ visitors[i].run(evaldRoot);
+ }
+
+ if (options.sourceMap) {
+ evaldRoot = new tree.sourceMapOutput(
+ {
+ contentsIgnoredCharsMap: parser.imports.contentsIgnoredChars,
+ writeSourceMap: options.writeSourceMap,
+ rootNode: evaldRoot,
+ contentsMap: parser.imports.contents,
+ sourceMapFilename: options.sourceMapFilename,
+ sourceMapURL: options.sourceMapURL,
+ outputFilename: options.sourceMapOutputFilename,
+ sourceMapBasepath: options.sourceMapBasepath,
+ sourceMapRootpath: options.sourceMapRootpath,
+ outputSourceFiles: options.outputSourceFiles,
+ sourceMapGenerator: options.sourceMapGenerator
+ });
+ }
+
+ css = evaldRoot.toCSS({
+ compress: Boolean(options.compress),
+ dumpLineNumbers: env.dumpLineNumbers,
+ strictUnits: Boolean(options.strictUnits),
+ numPrecision: 8});
+ } catch (e) {
+ throw new(LessError)(e, env);
+ }
+
+ if (options.cleancss && less.mode === 'node') {
+ var CleanCSS = require('clean-css'),
+ cleancssOptions = options.cleancssOptions || {};
+
+ if (cleancssOptions.keepSpecialComments === undefined) {
+ cleancssOptions.keepSpecialComments = "*";
+ }
+ cleancssOptions.processImport = false;
+ cleancssOptions.noRebase = true;
+ if (cleancssOptions.noAdvanced === undefined) {
+ cleancssOptions.noAdvanced = true;
+ }
+
+ return new CleanCSS(cleancssOptions).minify(css);
+ } else if (options.compress) {
+ return css.replace(/(^(\s)+)|((\s)+$)/g, "");
+ } else {
+ return css;
+ }
+ };
+ })(root.eval);
+
+ // If `i` is smaller than the `input.length - 1`,
+ // it means the parser wasn't able to parse the whole
+ // string, so we've got a parsing error.
+ //
+ // We try to extract a \n delimited string,
+ // showing the line where the parse error occured.
+ // We split it up into two parts (the part which parsed,
+ // and the part which didn't), so we can color them differently.
+ if (i < input.length - 1) {
+ i = furthest;
+ var loc = getLocation(i, input);
+ lines = input.split('\n');
+ line = loc.line + 1;
+
+ error = {
+ type: "Parse",
+ message: "Unrecognised input",
+ index: i,
+ filename: env.currentFileInfo.filename,
+ line: line,
+ column: loc.column,
+ extract: [
+ lines[line - 2],
+ lines[line - 1],
+ lines[line]
+ ]
+ };
+ }
+
+ var finish = function (e) {
+ e = error || e || parser.imports.error;
+
+ if (e) {
+ if (!(e instanceof LessError)) {
+ e = new(LessError)(e, env);
+ }
+
+ return callback(e);
+ }
+ else {
+ return callback(null, root);
+ }
+ };
+
+ if (env.processImports !== false) {
+ new tree.importVisitor(this.imports, finish)
+ .run(root);
+ } else {
+ return finish();
+ }
+ },
+
+ //
+ // Here in, the parsing rules/functions
+ //
+ // The basic structure of the syntax tree generated is as follows:
+ //
+ // Ruleset -> Rule -> Value -> Expression -> Entity
+ //
+ // Here's some LESS code:
+ //
+ // .class {
+ // color: #fff;
+ // border: 1px solid #000;
+ // width: @w + 4px;
+ // > .child {...}
+ // }
+ //
+ // And here's what the parse tree might look like:
+ //
+ // Ruleset (Selector '.class', [
+ // Rule ("color", Value ([Expression [Color #fff]]))
+ // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
+ // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
+ // Ruleset (Selector [Element '>', '.child'], [...])
+ // ])
+ //
+ // In general, most rules will try to parse a token with the `$()` function, and if the return
+ // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
+ // first, before parsing, that's when we use `peek()`.
+ //
+ parsers: parsers = {
+ //
+ // The `primary` rule is the *entry* and *exit* point of the parser.
+ // The rules here can appear at any level of the parse tree.
+ //
+ // The recursive nature of the grammar is an interplay between the `block`
+ // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
+ // as represented by this simplified grammar:
+ //
+ // primary → (ruleset | rule)+
+ // ruleset → selector+ block
+ // block → '{' primary '}'
+ //
+ // Only at one point is the primary rule not called from the
+ // block rule: at the root level.
+ //
+ primary: function () {
+ var mixin = this.mixin, $re = _$re, root = [], node;
+
+ while (current)
+ {
+ node = this.extendRule() || mixin.definition() || this.rule() || this.ruleset() ||
+ mixin.call() || this.comment() || this.rulesetCall() || this.directive();
+ if (node) {
+ root.push(node);
+ } else {
+ if (!($re(/^[\s\n]+/) || $re(/^;+/))) {
+ break;
+ }
+ }
+ if (peekChar('}')) {
+ break;
+ }
+ }
+
+ return root;
+ },
+
+ // We create a Comment node for CSS comments `/* */`,
+ // but keep the LeSS comments `//` silent, by just skipping
+ // over them.
+ comment: function () {
+ var comment;
+
+ if (input.charAt(i) !== '/') { return; }
+
+ if (input.charAt(i + 1) === '/') {
+ return new(tree.Comment)($re(/^\/\/.*/), true, i, env.currentFileInfo);
+ }
+ comment = $re(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/);
+ if (comment) {
+ return new(tree.Comment)(comment, false, i, env.currentFileInfo);
+ }
+ },
+
+ comments: function () {
+ var comment, comments = [];
+
+ while(true) {
+ comment = this.comment();
+ if (!comment) {
+ break;
+ }
+ comments.push(comment);
+ }
+
+ return comments;
+ },
+
+ //
+ // Entities are tokens which can be found inside an Expression
+ //
+ entities: {
+ //
+ // A string, which supports escaping " and '
+ //
+ // "milky way" 'he\'s the one!'
+ //
+ quoted: function () {
+ var str, j = i, e, index = i;
+
+ if (input.charAt(j) === '~') { j++; e = true; } // Escaped strings
+ if (input.charAt(j) !== '"' && input.charAt(j) !== "'") { return; }
+
+ if (e) { $char('~'); }
+
+ str = $re(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
+ if (str) {
+ return new(tree.Quoted)(str[0], str[1] || str[2], e, index, env.currentFileInfo);
+ }
+ },
+
+ //
+ // A catch-all word, such as:
+ //
+ // black border-collapse
+ //
+ keyword: function () {
+ var k;
+
+ k = $re(/^%|^[_A-Za-z-][_A-Za-z0-9-]*/);
+ if (k) {
+ var color = tree.Color.fromKeyword(k);
+ if (color) {
+ return color;
+ }
+ return new(tree.Keyword)(k);
+ }
+ },
+
+ //
+ // A function call
+ //
+ // rgb(255, 0, 255)
+ //
+ // We also try to catch IE's `alpha()`, but let the `alpha` parser
+ // deal with the details.
+ //
+ // The arguments are parsed with the `entities.arguments` parser.
+ //
+ call: function () {
+ var name, nameLC, args, alpha_ret, index = i;
+
+ name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(current);
+ if (!name) { return; }
+
+ name = name[1];
+ nameLC = name.toLowerCase();
+ if (nameLC === 'url') {
+ return null;
+ }
+
+ i += name.length;
+
+ if (nameLC === 'alpha') {
+ alpha_ret = parsers.alpha();
+ if(typeof alpha_ret !== 'undefined') {
+ return alpha_ret;
+ }
+ }
+
+ $char('('); // Parse the '(' and consume whitespace.
+
+ args = this.arguments();
+
+ if (! $char(')')) {
+ return;
+ }
+
+ if (name) { return new(tree.Call)(name, args, index, env.currentFileInfo); }
+ },
+ arguments: function () {
+ var args = [], arg;
+
+ while (true) {
+ arg = this.assignment() || parsers.expression();
+ if (!arg) {
+ break;
+ }
+ args.push(arg);
+ if (! $char(',')) {
+ break;
+ }
+ }
+ return args;
+ },
+ literal: function () {
+ return this.dimension() ||
+ this.color() ||
+ this.quoted() ||
+ this.unicodeDescriptor();
+ },
+
+ // Assignments are argument entities for calls.
+ // They are present in ie filter properties as shown below.
+ //
+ // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )
+ //
+
+ assignment: function () {
+ var key, value;
+ key = $re(/^\w+(?=\s?=)/i);
+ if (!key) {
+ return;
+ }
+ if (!$char('=')) {
+ return;
+ }
+ value = parsers.entity();
+ if (value) {
+ return new(tree.Assignment)(key, value);
+ }
+ },
+
+ //
+ // Parse url() tokens
+ //
+ // We use a specific rule for urls, because they don't really behave like
+ // standard function calls. The difference is that the argument doesn't have
+ // to be enclosed within a string, so it can't be parsed as an Expression.
+ //
+ url: function () {
+ var value;
+
+ if (input.charAt(i) !== 'u' || !$re(/^url\(/)) {
+ return;
+ }
+
+ value = this.quoted() || this.variable() ||
+ $re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || "";
+
+ expectChar(')');
+
+ return new(tree.URL)((value.value != null || value instanceof tree.Variable)
+ ? value : new(tree.Anonymous)(value), env.currentFileInfo);
+ },
+
+ //
+ // A Variable entity, such as `@fink`, in
+ //
+ // width: @fink + 2px
+ //
+ // We use a different parser for variable definitions,
+ // see `parsers.variable`.
+ //
+ variable: function () {
+ var name, index = i;
+
+ if (input.charAt(i) === '@' && (name = $re(/^@@?[\w-]+/))) {
+ return new(tree.Variable)(name, index, env.currentFileInfo);
+ }
+ },
+
+ // A variable entity useing the protective {} e.g. @{var}
+ variableCurly: function () {
+ var curly, index = i;
+
+ if (input.charAt(i) === '@' && (curly = $re(/^@\{([\w-]+)\}/))) {
+ return new(tree.Variable)("@" + curly[1], index, env.currentFileInfo);
+ }
+ },
+
+ //
+ // A Hexadecimal color
+ //
+ // #4F3C2F
+ //
+ // `rgb` and `hsl` colors are parsed through the `entities.call` parser.
+ //
+ color: function () {
+ var rgb;
+
+ if (input.charAt(i) === '#' && (rgb = $re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) {
+ return new(tree.Color)(rgb[1]);
+ }
+ },
+
+ //
+ // A Dimension, that is, a number and a unit
+ //
+ // 0.5em 95%
+ //
+ dimension: function () {
+ var value, c = input.charCodeAt(i);
+ //Is the first char of the dimension 0-9, '.', '+' or '-'
+ if ((c > 57 || c < 43) || c === 47 || c == 44) {
+ return;
+ }
+
+ value = $re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/);
+ if (value) {
+ return new(tree.Dimension)(value[1], value[2]);
+ }
+ },
+
+ //
+ // A unicode descriptor, as is used in unicode-range
+ //
+ // U+0?? or U+00A1-00A9
+ //
+ unicodeDescriptor: function () {
+ var ud;
+
+ ud = $re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/);
+ if (ud) {
+ return new(tree.UnicodeDescriptor)(ud[0]);
+ }
+ },
+
+ //
+ // JavaScript code to be evaluated
+ //
+ // `window.location.href`
+ //
+ javascript: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++; e = true; } // Escaped strings
+ if (input.charAt(j) !== '`') { return; }
+ if (env.javascriptEnabled !== undefined && !env.javascriptEnabled) {
+ error("You are using JavaScript, which has been disabled.");
+ }
+
+ if (e) { $char('~'); }
+
+ str = $re(/^`([^`]*)`/);
+ if (str) {
+ return new(tree.JavaScript)(str[1], i, e);
+ }
+ }
+ },
+
+ //
+ // The variable part of a variable definition. Used in the `rule` parser
+ //
+ // @fink:
+ //
+ variable: function () {
+ var name;
+
+ if (input.charAt(i) === '@' && (name = $re(/^(@[\w-]+)\s*:/))) { return name[1]; }
+ },
+
+ //
+ // The variable part of a variable definition. Used in the `rule` parser
+ //
+ // @fink();
+ //
+ rulesetCall: function () {
+ var name;
+
+ if (input.charAt(i) === '@' && (name = $re(/^(@[\w-]+)\s*\(\s*\)\s*;/))) {
+ return new tree.RulesetCall(name[1]);
+ }
+ },
+
+ //
+ // extend syntax - used to extend selectors
+ //
+ extend: function(isRule) {
+ var elements, e, index = i, option, extendList, extend;
+
+ if (!(isRule ? $re(/^&:extend\(/) : $re(/^:extend\(/))) { return; }
+
+ do {
+ option = null;
+ elements = null;
+ while (! (option = $re(/^(all)(?=\s*(\)|,))/))) {
+ e = this.element();
+ if (!e) { break; }
+ if (elements) { elements.push(e); } else { elements = [ e ]; }
+ }
+
+ option = option && option[1];
+
+ extend = new(tree.Extend)(new(tree.Selector)(elements), option, index);
+ if (extendList) { extendList.push(extend); } else { extendList = [ extend ]; }
+
+ } while($char(","));
+
+ expect(/^\)/);
+
+ if (isRule) {
+ expect(/^;/);
+ }
+
+ return extendList;
+ },
+
+ //
+ // extendRule - used in a rule to extend all the parent selectors
+ //
+ extendRule: function() {
+ return this.extend(true);
+ },
+
+ //
+ // Mixins
+ //
+ mixin: {
+ //
+ // A Mixin call, with an optional argument list
+ //
+ // #mixins > .square(#fff);
+ // .rounded(4px, black);
+ // .button;
+ //
+ // The `while` loop is there because mixins can be
+ // namespaced, but we only support the child and descendant
+ // selector for now.
+ //
+ call: function () {
+ var s = input.charAt(i), important = false, index = i, elemIndex,
+ elements, elem, e, c, args;
+
+ if (s !== '.' && s !== '#') { return; }
+
+ save(); // stop us absorbing part of an invalid selector
+
+ while (true) {
+ elemIndex = i;
+ e = $re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/);
+ if (!e) {
+ break;
+ }
+ elem = new(tree.Element)(c, e, elemIndex, env.currentFileInfo);
+ if (elements) { elements.push(elem); } else { elements = [ elem ]; }
+ c = $char('>');
+ }
+
+ if (elements) {
+ if ($char('(')) {
+ args = this.args(true).args;
+ expectChar(')');
+ }
+
+ if (parsers.important()) {
+ important = true;
+ }
+
+ if (parsers.end()) {
+ forget();
+ return new(tree.mixin.Call)(elements, args, index, env.currentFileInfo, important);
+ }
+ }
+
+ restore();
+ },
+ args: function (isCall) {
+ var parsers = parser.parsers, entities = parsers.entities,
+ returner = { args:null, variadic: false },
+ expressions = [], argsSemiColon = [], argsComma = [],
+ isSemiColonSeperated, expressionContainsNamed, name, nameLoop, value, arg;
+
+ save();
+
+ while (true) {
+ if (isCall) {
+ arg = parsers.detachedRuleset() || parsers.expression();
+ } else {
+ parsers.comments();
+ if (input.charAt(i) === '.' && $re(/^\.{3}/)) {
+ returner.variadic = true;
+ if ($char(";") && !isSemiColonSeperated) {
+ isSemiColonSeperated = true;
+ }
+ (isSemiColonSeperated ? argsSemiColon : argsComma)
+ .push({ variadic: true });
+ break;
+ }
+ arg = entities.variable() || entities.literal() || entities.keyword();
+ }
+
+ if (!arg) {
+ break;
+ }
+
+ nameLoop = null;
+ if (arg.throwAwayComments) {
+ arg.throwAwayComments();
+ }
+ value = arg;
+ var val = null;
+
+ if (isCall) {
+ // Variable
+ if (arg.value && arg.value.length == 1) {
+ val = arg.value[0];
+ }
+ } else {
+ val = arg;
+ }
+
+ if (val && val instanceof tree.Variable) {
+ if ($char(':')) {
+ if (expressions.length > 0) {
+ if (isSemiColonSeperated) {
+ error("Cannot mix ; and , as delimiter types");
+ }
+ expressionContainsNamed = true;
+ }
+
+ // we do not support setting a ruleset as a default variable - it doesn't make sense
+ // However if we do want to add it, there is nothing blocking it, just don't error
+ // and remove isCall dependency below
+ value = (isCall && parsers.detachedRuleset()) || parsers.expression();
+
+ if (!value) {
+ if (isCall) {
+ error("could not understand value for named argument");
+ } else {
+ restore();
+ returner.args = [];
+ return returner;
+ }
+ }
+ nameLoop = (name = val.name);
+ } else if (!isCall && $re(/^\.{3}/)) {
+ returner.variadic = true;
+ if ($char(";") && !isSemiColonSeperated) {
+ isSemiColonSeperated = true;
+ }
+ (isSemiColonSeperated ? argsSemiColon : argsComma)
+ .push({ name: arg.name, variadic: true });
+ break;
+ } else if (!isCall) {
+ name = nameLoop = val.name;
+ value = null;
+ }
+ }
+
+ if (value) {
+ expressions.push(value);
+ }
+
+ argsComma.push({ name:nameLoop, value:value });
+
+ if ($char(',')) {
+ continue;
+ }
+
+ if ($char(';') || isSemiColonSeperated) {
+
+ if (expressionContainsNamed) {
+ error("Cannot mix ; and , as delimiter types");
+ }
+
+ isSemiColonSeperated = true;
+
+ if (expressions.length > 1) {
+ value = new(tree.Value)(expressions);
+ }
+ argsSemiColon.push({ name:name, value:value });
+
+ name = null;
+ expressions = [];
+ expressionContainsNamed = false;
+ }
+ }
+
+ forget();
+ returner.args = isSemiColonSeperated ? argsSemiColon : argsComma;
+ return returner;
+ },
+ //
+ // A Mixin definition, with a list of parameters
+ //
+ // .rounded (@radius: 2px, @color) {
+ // ...
+ // }
+ //
+ // Until we have a finer grained state-machine, we have to
+ // do a look-ahead, to make sure we don't have a mixin call.
+ // See the `rule` function for more information.
+ //
+ // We start by matching `.rounded (`, and then proceed on to
+ // the argument list, which has optional default values.
+ // We store the parameters in `params`, with a `value` key,
+ // if there is a value, such as in the case of `@radius`.
+ //
+ // Once we've got our params list, and a closing `)`, we parse
+ // the `{...}` block.
+ //
+ definition: function () {
+ var name, params = [], match, ruleset, cond, variadic = false;
+ if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
+ peek(/^[^{]*\}/)) {
+ return;
+ }
+
+ save();
+
+ match = $re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/);
+ if (match) {
+ name = match[1];
+
+ var argInfo = this.args(false);
+ params = argInfo.args;
+ variadic = argInfo.variadic;
+
+ // .mixincall("@{a}");
+ // looks a bit like a mixin definition..
+ // also
+ // .mixincall(@a: {rule: set;});
+ // so we have to be nice and restore
+ if (!$char(')')) {
+ furthest = i;
+ restore();
+ return;
+ }
+
+ parsers.comments();
+
+ if ($re(/^when/)) { // Guard
+ cond = expect(parsers.conditions, 'expected condition');
+ }
+
+ ruleset = parsers.block();
+
+ if (ruleset) {
+ forget();
+ return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);
+ } else {
+ restore();
+ }
+ } else {
+ forget();
+ }
+ }
+ },
+
+ //
+ // Entities are the smallest recognized token,
+ // and can be found inside a rule's value.
+ //
+ entity: function () {
+ var entities = this.entities;
+
+ return entities.literal() || entities.variable() || entities.url() ||
+ entities.call() || entities.keyword() || entities.javascript() ||
+ this.comment();
+ },
+
+ //
+ // A Rule terminator. Note that we use `peek()` to check for '}',
+ // because the `block` rule will be expecting it, but we still need to make sure
+ // it's there, if ';' was ommitted.
+ //
+ end: function () {
+ return $char(';') || peekChar('}');
+ },
+
+ //
+ // IE's alpha function
+ //
+ // alpha(opacity=88)
+ //
+ alpha: function () {
+ var value;
+
+ if (! $re(/^\(opacity=/i)) { return; }
+ value = $re(/^\d+/) || this.entities.variable();
+ if (value) {
+ expectChar(')');
+ return new(tree.Alpha)(value);
+ }
+ },
+
+ //
+ // A Selector Element
+ //
+ // div
+ // + h1
+ // #socks
+ // input[type="text"]
+ //
+ // Elements are the building blocks for Selectors,
+ // they are made out of a `Combinator` (see combinator rule),
+ // and an element name, such as a tag a class, or `*`.
+ //
+ element: function () {
+ var e, c, v, index = i;
+
+ c = this.combinator();
+
+ e = $re(/^(?:\d+\.\d+|\d+)%/) || $re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
+ $char('*') || $char('&') || this.attribute() || $re(/^\([^()@]+\)/) || $re(/^[\.#](?=@)/) ||
+ this.entities.variableCurly();
+
+ if (! e) {
+ save();
+ if ($char('(')) {
+ if ((v = this.selector()) && $char(')')) {
+ e = new(tree.Paren)(v);
+ forget();
+ } else {
+ restore();
+ }
+ } else {
+ forget();
+ }
+ }
+
+ if (e) { return new(tree.Element)(c, e, index, env.currentFileInfo); }
+ },
+
+ //
+ // Combinators combine elements together, in a Selector.
+ //
+ // Because our parser isn't white-space sensitive, special care
+ // has to be taken, when parsing the descendant combinator, ` `,
+ // as it's an empty space. We have to check the previous character
+ // in the input, to see if it's a ` ` character. More info on how
+ // we deal with this in *combinator.js*.
+ //
+ combinator: function () {
+ var c = input.charAt(i);
+
+ if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {
+ i++;
+ if (input.charAt(i) === '^') {
+ c = '^^';
+ i++;
+ }
+ while (isWhitespace(input, i)) { i++; }
+ return new(tree.Combinator)(c);
+ } else if (isWhitespace(input, i - 1)) {
+ return new(tree.Combinator)(" ");
+ } else {
+ return new(tree.Combinator)(null);
+ }
+ },
+ //
+ // A CSS selector (see selector below)
+ // with less extensions e.g. the ability to extend and guard
+ //
+ lessSelector: function () {
+ return this.selector(true);
+ },
+ //
+ // A CSS Selector
+ //
+ // .class > div + h1
+ // li a:hover
+ //
+ // Selectors are made out of one or more Elements, see above.
+ //
+ selector: function (isLess) {
+ var index = i, $re = _$re, elements, extendList, c, e, extend, when, condition;
+
+ while ((isLess && (extend = this.extend())) || (isLess && (when = $re(/^when/))) || (e = this.element())) {
+ if (when) {
+ condition = expect(this.conditions, 'expected condition');
+ } else if (condition) {
+ error("CSS guard can only be used at the end of selector");
+ } else if (extend) {
+ if (extendList) { extendList.push(extend); } else { extendList = [ extend ]; }
+ } else {
+ if (extendList) { error("Extend can only be used at the end of selector"); }
+ c = input.charAt(i);
+ if (elements) { elements.push(e); } else { elements = [ e ]; }
+ e = null;
+ }
+ if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {
+ break;
+ }
+ }
+
+ if (elements) { return new(tree.Selector)(elements, extendList, condition, index, env.currentFileInfo); }
+ if (extendList) { error("Extend must be used to extend a selector, it cannot be used on its own"); }
+ },
+ attribute: function () {
+ if (! $char('[')) { return; }
+
+ var entities = this.entities,
+ key, val, op;
+
+ if (!(key = entities.variableCurly())) {
+ key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/);
+ }
+
+ op = $re(/^[|~*$^]?=/);
+ if (op) {
+ val = entities.quoted() || $re(/^[0-9]+%/) || $re(/^[\w-]+/) || entities.variableCurly();
+ }
+
+ expectChar(']');
+
+ return new(tree.Attribute)(key, op, val);
+ },
+
+ //
+ // The `block` rule is used by `ruleset` and `mixin.definition`.
+ // It's a wrapper around the `primary` rule, with added `{}`.
+ //
+ block: function () {
+ var content;
+ if ($char('{') && (content = this.primary()) && $char('}')) {
+ return content;
+ }
+ },
+
+ blockRuleset: function() {
+ var block = this.block();
+
+ if (block) {
+ block = new tree.Ruleset(null, block);
+ }
+ return block;
+ },
+
+ detachedRuleset: function() {
+ var blockRuleset = this.blockRuleset();
+ if (blockRuleset) {
+ return new tree.DetachedRuleset(blockRuleset);
+ }
+ },
+
+ //
+ // div, .class, body > p {...}
+ //
+ ruleset: function () {
+ var selectors, s, rules, debugInfo;
+
+ save();
+
+ if (env.dumpLineNumbers) {
+ debugInfo = getDebugInfo(i, input, env);
+ }
+
+ while (true) {
+ s = this.lessSelector();
+ if (!s) {
+ break;
+ }
+ if (selectors) { selectors.push(s); } else { selectors = [ s ]; }
+ this.comments();
+ if (s.condition && selectors.length > 1) {
+ error("Guards are only currently allowed on a single selector.");
+ }
+ if (! $char(',')) { break; }
+ if (s.condition) {
+ error("Guards are only currently allowed on a single selector.");
+ }
+ this.comments();
+ }
+
+ if (selectors && (rules = this.block())) {
+ forget();
+ var ruleset = new(tree.Ruleset)(selectors, rules, env.strictImports);
+ if (env.dumpLineNumbers) {
+ ruleset.debugInfo = debugInfo;
+ }
+ return ruleset;
+ } else {
+ // Backtrack
+ furthest = i;
+ restore();
+ }
+ },
+ rule: function (tryAnonymous) {
+ var name, value, startOfRule = i, c = input.charAt(startOfRule), important, merge, isVariable;
+
+ if (c === '.' || c === '#' || c === '&') { return; }
+
+ save();
+
+ name = this.variable() || this.ruleProperty();
+ if (name) {
+ isVariable = typeof name === "string";
+
+ if (isVariable) {
+ value = this.detachedRuleset();
+ }
+
+ if (!value) {
+ // prefer to try to parse first if its a variable or we are compressing
+ // but always fallback on the other one
+ value = !tryAnonymous && (env.compress || isVariable) ?
+ (this.value() || this.anonymousValue()) :
+ (this.anonymousValue() || this.value());
+
+ important = this.important();
+
+ // a name returned by this.ruleProperty() is always an array of the form:
+ // [string-1, ..., string-n, ""] or [string-1, ..., string-n, "+"]
+ // where each item is a tree.Keyword or tree.Variable
+ merge = !isVariable && name.pop().value;
+ }
+
+ if (value && this.end()) {
+ forget();
+ return new (tree.Rule)(name, value, important, merge, startOfRule, env.currentFileInfo);
+ } else {
+ furthest = i;
+ restore();
+ if (value && !tryAnonymous) {
+ return this.rule(true);
+ }
+ }
+ } else {
+ forget();
+ }
+ },
+ anonymousValue: function () {
+ var match;
+ match = /^([^@+\/'"*`(;{}-]*);/.exec(current);
+ if (match) {
+ i += match[0].length - 1;
+ return new(tree.Anonymous)(match[1]);
+ }
+ },
+
+ //
+ // An @import directive
+ //
+ // @import "lib";
+ //
+ // Depending on our environemnt, importing is done differently:
+ // In the browser, it's an XHR request, in Node, it would be a
+ // file-system operation. The function used for importing is
+ // stored in `import`, which we pass to the Import constructor.
+ //
+ "import": function () {
+ var path, features, index = i;
+
+ save();
+
+ var dir = $re(/^@import?\s+/);
+
+ var options = (dir ? this.importOptions() : null) || {};
+
+ if (dir && (path = this.entities.quoted() || this.entities.url())) {
+ features = this.mediaFeatures();
+ if ($char(';')) {
+ forget();
+ features = features && new(tree.Value)(features);
+ return new(tree.Import)(path, features, options, index, env.currentFileInfo);
+ }
+ }
+
+ restore();
+ },
+
+ importOptions: function() {
+ var o, options = {}, optionName, value;
+
+ // list of options, surrounded by parens
+ if (! $char('(')) { return null; }
+ do {
+ o = this.importOption();
+ if (o) {
+ optionName = o;
+ value = true;
+ switch(optionName) {
+ case "css":
+ optionName = "less";
+ value = false;
+ break;
+ case "once":
+ optionName = "multiple";
+ value = false;
+ break;
+ }
+ options[optionName] = value;
+ if (! $char(',')) { break; }
+ }
+ } while (o);
+ expectChar(')');
+ return options;
+ },
+
+ importOption: function() {
+ var opt = $re(/^(less|css|multiple|once|inline|reference)/);
+ if (opt) {
+ return opt[1];
+ }
+ },
+
+ mediaFeature: function () {
+ var entities = this.entities, nodes = [], e, p;
+ do {
+ e = entities.keyword() || entities.variable();
+ if (e) {
+ nodes.push(e);
+ } else if ($char('(')) {
+ p = this.property();
+ e = this.value();
+ if ($char(')')) {
+ if (p && e) {
+ nodes.push(new(tree.Paren)(new(tree.Rule)(p, e, null, null, i, env.currentFileInfo, true)));
+ } else if (e) {
+ nodes.push(new(tree.Paren)(e));
+ } else {
+ return null;
+ }
+ } else { return null; }
+ }
+ } while (e);
+
+ if (nodes.length > 0) {
+ return new(tree.Expression)(nodes);
+ }
+ },
+
+ mediaFeatures: function () {
+ var entities = this.entities, features = [], e;
+ do {
+ e = this.mediaFeature();
+ if (e) {
+ features.push(e);
+ if (! $char(',')) { break; }
+ } else {
+ e = entities.variable();
+ if (e) {
+ features.push(e);
+ if (! $char(',')) { break; }
+ }
+ }
+ } while (e);
+
+ return features.length > 0 ? features : null;
+ },
+
+ media: function () {
+ var features, rules, media, debugInfo;
+
+ if (env.dumpLineNumbers) {
+ debugInfo = getDebugInfo(i, input, env);
+ }
+
+ if ($re(/^@media/)) {
+ features = this.mediaFeatures();
+
+ rules = this.block();
+ if (rules) {
+ media = new(tree.Media)(rules, features, i, env.currentFileInfo);
+ if (env.dumpLineNumbers) {
+ media.debugInfo = debugInfo;
+ }
+ return media;
+ }
+ }
+ },
+
+ //
+ // A CSS Directive
+ //
+ // @charset "utf-8";
+ //
+ directive: function () {
+ var index = i, name, value, rules, nonVendorSpecificName,
+ hasIdentifier, hasExpression, hasUnknown, hasBlock = true;
+
+ if (input.charAt(i) !== '@') { return; }
+
+ value = this['import']() || this.media();
+ if (value) {
+ return value;
+ }
+
+ save();
+
+ name = $re(/^@[a-z-]+/);
+
+ if (!name) { return; }
+
+ nonVendorSpecificName = name;
+ if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
+ nonVendorSpecificName = "@" + name.slice(name.indexOf('-', 2) + 1);
+ }
+
+ switch(nonVendorSpecificName) {
+ /*
+ case "@font-face":
+ case "@viewport":
+ case "@top-left":
+ case "@top-left-corner":
+ case "@top-center":
+ case "@top-right":
+ case "@top-right-corner":
+ case "@bottom-left":
+ case "@bottom-left-corner":
+ case "@bottom-center":
+ case "@bottom-right":
+ case "@bottom-right-corner":
+ case "@left-top":
+ case "@left-middle":
+ case "@left-bottom":
+ case "@right-top":
+ case "@right-middle":
+ case "@right-bottom":
+ hasBlock = true;
+ break;
+ */
+ case "@charset":
+ hasIdentifier = true;
+ hasBlock = false;
+ break;
+ case "@namespace":
+ hasExpression = true;
+ hasBlock = false;
+ break;
+ case "@keyframes":
+ hasIdentifier = true;
+ break;
+ case "@host":
+ case "@page":
+ case "@document":
+ case "@supports":
+ hasUnknown = true;
+ break;
+ }
+
+ if (hasIdentifier) {
+ value = this.entity();
+ if (!value) {
+ error("expected " + name + " identifier");
+ }
+ } else if (hasExpression) {
+ value = this.expression();
+ if (!value) {
+ error("expected " + name + " expression");
+ }
+ } else if (hasUnknown) {
+ value = ($re(/^[^{;]+/) || '').trim();
+ if (value) {
+ value = new(tree.Anonymous)(value);
+ }
+ }
+
+ if (hasBlock) {
+ rules = this.blockRuleset();
+ }
+
+ if (rules || (!hasBlock && value && $char(';'))) {
+ forget();
+ return new(tree.Directive)(name, value, rules, index, env.currentFileInfo,
+ env.dumpLineNumbers ? getDebugInfo(index, input, env) : null);
+ }
+
+ restore();
+ },
+
+ //
+ // A Value is a comma-delimited list of Expressions
+ //
+ // font-family: Baskerville, Georgia, serif;
+ //
+ // In a Rule, a Value represents everything after the `:`,
+ // and before the `;`.
+ //
+ value: function () {
+ var e, expressions = [];
+
+ do {
+ e = this.expression();
+ if (e) {
+ expressions.push(e);
+ if (! $char(',')) { break; }
+ }
+ } while(e);
+
+ if (expressions.length > 0) {
+ return new(tree.Value)(expressions);
+ }
+ },
+ important: function () {
+ if (input.charAt(i) === '!') {
+ return $re(/^! *important/);
+ }
+ },
+ sub: function () {
+ var a, e;
+
+ if ($char('(')) {
+ a = this.addition();
+ if (a) {
+ e = new(tree.Expression)([a]);
+ expectChar(')');
+ e.parens = true;
+ return e;
+ }
+ }
+ },
+ multiplication: function () {
+ var m, a, op, operation, isSpaced;
+ m = this.operand();
+ if (m) {
+ isSpaced = isWhitespace(input, i - 1);
+ while (true) {
+ if (peek(/^\/[*\/]/)) {
+ break;
+ }
+ op = $char('/') || $char('*');
+
+ if (!op) { break; }
+
+ a = this.operand();
+
+ if (!a) { break; }
+
+ m.parensInOp = true;
+ a.parensInOp = true;
+ operation = new(tree.Operation)(op, [operation || m, a], isSpaced);
+ isSpaced = isWhitespace(input, i - 1);
+ }
+ return operation || m;
+ }
+ },
+ addition: function () {
+ var m, a, op, operation, isSpaced;
+ m = this.multiplication();
+ if (m) {
+ isSpaced = isWhitespace(input, i - 1);
+ while (true) {
+ op = $re(/^[-+]\s+/) || (!isSpaced && ($char('+') || $char('-')));
+ if (!op) {
+ break;
+ }
+ a = this.multiplication();
+ if (!a) {
+ break;
+ }
+
+ m.parensInOp = true;
+ a.parensInOp = true;
+ operation = new(tree.Operation)(op, [operation || m, a], isSpaced);
+ isSpaced = isWhitespace(input, i - 1);
+ }
+ return operation || m;
+ }
+ },
+ conditions: function () {
+ var a, b, index = i, condition;
+
+ a = this.condition();
+ if (a) {
+ while (true) {
+ if (!peek(/^,\s*(not\s*)?\(/) || !$char(',')) {
+ break;
+ }
+ b = this.condition();
+ if (!b) {
+ break;
+ }
+ condition = new(tree.Condition)('or', condition || a, b, index);
+ }
+ return condition || a;
+ }
+ },
+ condition: function () {
+ var entities = this.entities, index = i, negate = false,
+ a, b, c, op;
+
+ if ($re(/^not/)) { negate = true; }
+ expectChar('(');
+ a = this.addition() || entities.keyword() || entities.quoted();
+ if (a) {
+ op = $re(/^(?:>=|<=|=<|[<=>])/);
+ if (op) {
+ b = this.addition() || entities.keyword() || entities.quoted();
+ if (b) {
+ c = new(tree.Condition)(op, a, b, index, negate);
+ } else {
+ error('expected expression');
+ }
+ } else {
+ c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, negate);
+ }
+ expectChar(')');
+ return $re(/^and/) ? new(tree.Condition)('and', c, this.condition()) : c;
+ }
+ },
+
+ //
+ // An operand is anything that can be part of an operation,
+ // such as a Color, or a Variable
+ //
+ operand: function () {
+ var entities = this.entities,
+ p = input.charAt(i + 1), negate;
+
+ if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $char('-'); }
+ var o = this.sub() || entities.dimension() ||
+ entities.color() || entities.variable() ||
+ entities.call();
+
+ if (negate) {
+ o.parensInOp = true;
+ o = new(tree.Negative)(o);
+ }
+
+ return o;
+ },
+
+ //
+ // Expressions either represent mathematical operations,
+ // or white-space delimited Entities.
+ //
+ // 1px solid black
+ // @var * 2
+ //
+ expression: function () {
+ var entities = [], e, delim;
+
+ do {
+ e = this.addition() || this.entity();
+ if (e) {
+ entities.push(e);
+ // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
+ if (!peek(/^\/[\/*]/)) {
+ delim = $char('/');
+ if (delim) {
+ entities.push(new(tree.Anonymous)(delim));
+ }
+ }
+ }
+ } while (e);
+ if (entities.length > 0) {
+ return new(tree.Expression)(entities);
+ }
+ },
+ property: function () {
+ var name = $re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);
+ if (name) {
+ return name[1];
+ }
+ },
+ ruleProperty: function () {
+ var c = current, name = [], index = [], length = 0, s, k;
+
+ function match(re) {
+ var a = re.exec(c);
+ if (a) {
+ index.push(i + length);
+ length += a[0].length;
+ c = c.slice(a[1].length);
+ return name.push(a[1]);
+ }
+ }
+
+ match(/^(\*?)/);
+ while (match(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/)); // !
+ if ((name.length > 1) && match(/^\s*((?:\+_|\+)?)\s*:/)) {
+ // at last, we have the complete match now. move forward,
+ // convert name particles to tree objects and return:
+ skipWhitespace(length);
+ if (name[0] === '') {
+ name.shift();
+ index.shift();
+ }
+ for (k = 0; k < name.length; k++) {
+ s = name[k];
+ name[k] = (s.charAt(0) !== '@')
+ ? new(tree.Keyword)(s)
+ : new(tree.Variable)('@' + s.slice(2, -1),
+ index[k], env.currentFileInfo);
+ }
+ return name;
+ }
+ }
+ }
+ };
+ return parser;
+};
+less.Parser.serializeVars = function(vars) {
+ var s = '';
+
+ for (var name in vars) {
+ if (Object.hasOwnProperty.call(vars, name)) {
+ var value = vars[name];
+ s += ((name[0] === '@') ? '' : '@') + name +': '+ value +
+ ((('' + value).slice(-1) === ';') ? '' : ';');
+ }
+ }
+
+ return s;
+};
+
+(function (tree) {
+
+tree.functions = {
+ rgb: function (r, g, b) {
+ return this.rgba(r, g, b, 1.0);
+ },
+ rgba: function (r, g, b, a) {
+ var rgb = [r, g, b].map(function (c) { return scaled(c, 255); });
+ a = number(a);
+ return new(tree.Color)(rgb, a);
+ },
+ hsl: function (h, s, l) {
+ return this.hsla(h, s, l, 1.0);
+ },
+ hsla: function (h, s, l, a) {
+ function hue(h) {
+ h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
+ if (h * 6 < 1) { return m1 + (m2 - m1) * h * 6; }
+ else if (h * 2 < 1) { return m2; }
+ else if (h * 3 < 2) { return m1 + (m2 - m1) * (2/3 - h) * 6; }
+ else { return m1; }
+ }
+
+ h = (number(h) % 360) / 360;
+ s = clamp(number(s)); l = clamp(number(l)); a = clamp(number(a));
+
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
+ var m1 = l * 2 - m2;
+
+ return this.rgba(hue(h + 1/3) * 255,
+ hue(h) * 255,
+ hue(h - 1/3) * 255,
+ a);
+ },
+
+ hsv: function(h, s, v) {
+ return this.hsva(h, s, v, 1.0);
+ },
+
+ hsva: function(h, s, v, a) {
+ h = ((number(h) % 360) / 360) * 360;
+ s = number(s); v = number(v); a = number(a);
+
+ var i, f;
+ i = Math.floor((h / 60) % 6);
+ f = (h / 60) - i;
+
+ var vs = [v,
+ v * (1 - s),
+ v * (1 - f * s),
+ v * (1 - (1 - f) * s)];
+ var perm = [[0, 3, 1],
+ [2, 0, 1],
+ [1, 0, 3],
+ [1, 2, 0],
+ [3, 1, 0],
+ [0, 1, 2]];
+
+ return this.rgba(vs[perm[i][0]] * 255,
+ vs[perm[i][1]] * 255,
+ vs[perm[i][2]] * 255,
+ a);
+ },
+
+ hue: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().h));
+ },
+ saturation: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
+ },
+ lightness: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
+ },
+ hsvhue: function(color) {
+ return new(tree.Dimension)(Math.round(color.toHSV().h));
+ },
+ hsvsaturation: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSV().s * 100), '%');
+ },
+ hsvvalue: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSV().v * 100), '%');
+ },
+ red: function (color) {
+ return new(tree.Dimension)(color.rgb[0]);
+ },
+ green: function (color) {
+ return new(tree.Dimension)(color.rgb[1]);
+ },
+ blue: function (color) {
+ return new(tree.Dimension)(color.rgb[2]);
+ },
+ alpha: function (color) {
+ return new(tree.Dimension)(color.toHSL().a);
+ },
+ luma: function (color) {
+ return new(tree.Dimension)(Math.round(color.luma() * color.alpha * 100), '%');
+ },
+ luminance: function (color) {
+ var luminance =
+ (0.2126 * color.rgb[0] / 255)
+ + (0.7152 * color.rgb[1] / 255)
+ + (0.0722 * color.rgb[2] / 255);
+
+ return new(tree.Dimension)(Math.round(luminance * color.alpha * 100), '%');
+ },
+ saturate: function (color, amount) {
+ // filter: saturate(3.2);
+ // should be kept as is, so check for color
+ if (!color.rgb) {
+ return null;
+ }
+ var hsl = color.toHSL();
+
+ hsl.s += amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ desaturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s -= amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ lighten: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l += amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ darken: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l -= amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ fadein: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a += amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ fadeout: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a -= amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ fade: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a = amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ spin: function (color, amount) {
+ var hsl = color.toHSL();
+ var hue = (hsl.h + amount.value) % 360;
+
+ hsl.h = hue < 0 ? 360 + hue : hue;
+
+ return hsla(hsl);
+ },
+ //
+ // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
+ // http://sass-lang.com
+ //
+ mix: function (color1, color2, weight) {
+ if (!weight) {
+ weight = new(tree.Dimension)(50);
+ }
+ var p = weight.value / 100.0;
+ var w = p * 2 - 1;
+ var a = color1.toHSL().a - color2.toHSL().a;
+
+ var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
+ var w2 = 1 - w1;
+
+ var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
+ color1.rgb[1] * w1 + color2.rgb[1] * w2,
+ color1.rgb[2] * w1 + color2.rgb[2] * w2];
+
+ var alpha = color1.alpha * p + color2.alpha * (1 - p);
+
+ return new(tree.Color)(rgb, alpha);
+ },
+ greyscale: function (color) {
+ return this.desaturate(color, new(tree.Dimension)(100));
+ },
+ contrast: function (color, dark, light, threshold) {
+ // filter: contrast(3.2);
+ // should be kept as is, so check for color
+ if (!color.rgb) {
+ return null;
+ }
+ if (typeof light === 'undefined') {
+ light = this.rgba(255, 255, 255, 1.0);
+ }
+ if (typeof dark === 'undefined') {
+ dark = this.rgba(0, 0, 0, 1.0);
+ }
+ //Figure out which is actually light and dark!
+ if (dark.luma() > light.luma()) {
+ var t = light;
+ light = dark;
+ dark = t;
+ }
+ if (typeof threshold === 'undefined') {
+ threshold = 0.43;
+ } else {
+ threshold = number(threshold);
+ }
+ if (color.luma() < threshold) {
+ return light;
+ } else {
+ return dark;
+ }
+ },
+ e: function (str) {
+ return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
+ },
+ escape: function (str) {
+ return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
+ },
+ replace: function (string, pattern, replacement, flags) {
+ var result = string.value;
+
+ result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement.value);
+ return new(tree.Quoted)(string.quote || '', result, string.escaped);
+ },
+ '%': function (string /* arg, arg, ...*/) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ result = string.value;
+
+ for (var i = 0; i < args.length; i++) {
+ /*jshint loopfunc:true */
+ result = result.replace(/%[sda]/i, function(token) {
+ var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
+ return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
+ });
+ }
+ result = result.replace(/%%/g, '%');
+ return new(tree.Quoted)(string.quote || '', result, string.escaped);
+ },
+ unit: function (val, unit) {
+ if(!(val instanceof tree.Dimension)) {
+ throw { type: "Argument", message: "the first argument to unit must be a number" + (val instanceof tree.Operation ? ". Have you forgotten parenthesis?" : "") };
+ }
+ if (unit) {
+ if (unit instanceof tree.Keyword) {
+ unit = unit.value;
+ } else {
+ unit = unit.toCSS();
+ }
+ } else {
+ unit = "";
+ }
+ return new(tree.Dimension)(val.value, unit);
+ },
+ convert: function (val, unit) {
+ return val.convertTo(unit.value);
+ },
+ round: function (n, f) {
+ var fraction = typeof(f) === "undefined" ? 0 : f.value;
+ return _math(function(num) { return num.toFixed(fraction); }, null, n);
+ },
+ pi: function () {
+ return new(tree.Dimension)(Math.PI);
+ },
+ mod: function(a, b) {
+ return new(tree.Dimension)(a.value % b.value, a.unit);
+ },
+ pow: function(x, y) {
+ if (typeof x === "number" && typeof y === "number") {
+ x = new(tree.Dimension)(x);
+ y = new(tree.Dimension)(y);
+ } else if (!(x instanceof tree.Dimension) || !(y instanceof tree.Dimension)) {
+ throw { type: "Argument", message: "arguments must be numbers" };
+ }
+
+ return new(tree.Dimension)(Math.pow(x.value, y.value), x.unit);
+ },
+ _minmax: function (isMin, args) {
+ args = Array.prototype.slice.call(args);
+ switch(args.length) {
+ case 0: throw { type: "Argument", message: "one or more arguments required" };
+ }
+ var i, j, current, currentUnified, referenceUnified, unit, unitStatic, unitClone,
+ order = [], // elems only contains original argument values.
+ values = {}; // key is the unit.toString() for unified tree.Dimension values,
+ // value is the index into the order array.
+ for (i = 0; i < args.length; i++) {
+ current = args[i];
+ if (!(current instanceof tree.Dimension)) {
+ if(Array.isArray(args[i].value)) {
+ Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
+ }
+ continue;
+ }
+ currentUnified = current.unit.toString() === "" && unitClone !== undefined ? new(tree.Dimension)(current.value, unitClone).unify() : current.unify();
+ unit = currentUnified.unit.toString() === "" && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
+ unitStatic = unit !== "" && unitStatic === undefined || unit !== "" && order[0].unify().unit.toString() === "" ? unit : unitStatic;
+ unitClone = unit !== "" && unitClone === undefined ? current.unit.toString() : unitClone;
+ j = values[""] !== undefined && unit !== "" && unit === unitStatic ? values[""] : values[unit];
+ if (j === undefined) {
+ if(unitStatic !== undefined && unit !== unitStatic) {
+ throw{ type: "Argument", message: "incompatible types" };
+ }
+ values[unit] = order.length;
+ order.push(current);
+ continue;
+ }
+ referenceUnified = order[j].unit.toString() === "" && unitClone !== undefined ? new(tree.Dimension)(order[j].value, unitClone).unify() : order[j].unify();
+ if ( isMin && currentUnified.value < referenceUnified.value ||
+ !isMin && currentUnified.value > referenceUnified.value) {
+ order[j] = current;
+ }
+ }
+ if (order.length == 1) {
+ return order[0];
+ }
+ args = order.map(function (a) { return a.toCSS(this.env); }).join(this.env.compress ? "," : ", ");
+ return new(tree.Anonymous)((isMin ? "min" : "max") + "(" + args + ")");
+ },
+ min: function () {
+ return this._minmax(true, arguments);
+ },
+ max: function () {
+ return this._minmax(false, arguments);
+ },
+ "get-unit": function (n) {
+ return new(tree.Anonymous)(n.unit);
+ },
+ argb: function (color) {
+ return new(tree.Anonymous)(color.toARGB());
+ },
+ percentage: function (n) {
+ return new(tree.Dimension)(n.value * 100, '%');
+ },
+ color: function (n) {
+ if (n instanceof tree.Quoted) {
+ var colorCandidate = n.value,
+ returnColor;
+ returnColor = tree.Color.fromKeyword(colorCandidate);
+ if (returnColor) {
+ return returnColor;
+ }
+ if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(colorCandidate)) {
+ return new(tree.Color)(colorCandidate.slice(1));
+ }
+ throw { type: "Argument", message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF" };
+ } else {
+ throw { type: "Argument", message: "argument must be a string" };
+ }
+ },
+ iscolor: function (n) {
+ return this._isa(n, tree.Color);
+ },
+ isnumber: function (n) {
+ return this._isa(n, tree.Dimension);
+ },
+ isstring: function (n) {
+ return this._isa(n, tree.Quoted);
+ },
+ iskeyword: function (n) {
+ return this._isa(n, tree.Keyword);
+ },
+ isurl: function (n) {
+ return this._isa(n, tree.URL);
+ },
+ ispixel: function (n) {
+ return this.isunit(n, 'px');
+ },
+ ispercentage: function (n) {
+ return this.isunit(n, '%');
+ },
+ isem: function (n) {
+ return this.isunit(n, 'em');
+ },
+ isunit: function (n, unit) {
+ return (n instanceof tree.Dimension) && n.unit.is(unit.value || unit) ? tree.True : tree.False;
+ },
+ _isa: function (n, Type) {
+ return (n instanceof Type) ? tree.True : tree.False;
+ },
+ tint: function(color, amount) {
+ return this.mix(this.rgb(255,255,255), color, amount);
+ },
+ shade: function(color, amount) {
+ return this.mix(this.rgb(0, 0, 0), color, amount);
+ },
+ extract: function(values, index) {
+ index = index.value - 1; // (1-based index)
+ // handle non-array values as an array of length 1
+ // return 'undefined' if index is invalid
+ return Array.isArray(values.value)
+ ? values.value[index] : Array(values)[index];
+ },
+ length: function(values) {
+ var n = Array.isArray(values.value) ? values.value.length : 1;
+ return new tree.Dimension(n);
+ },
+
+ "data-uri": function(mimetypeNode, filePathNode) {
+
+ if (typeof window !== 'undefined') {
+ return new tree.URL(filePathNode || mimetypeNode, this.currentFileInfo).eval(this.env);
+ }
+
+ var mimetype = mimetypeNode.value;
+ var filePath = (filePathNode && filePathNode.value);
+
+ var fs = require('fs'),
+ path = require('path'),
+ useBase64 = false;
+
+ if (arguments.length < 2) {
+ filePath = mimetype;
+ }
+
+ if (this.env.isPathRelative(filePath)) {
+ if (this.currentFileInfo.relativeUrls) {
+ filePath = path.join(this.currentFileInfo.currentDirectory, filePath);
+ } else {
+ filePath = path.join(this.currentFileInfo.entryPath, filePath);
+ }
+ }
+
+ // detect the mimetype if not given
+ if (arguments.length < 2) {
+ var mime;
+ try {
+ mime = require('mime');
+ } catch (ex) {
+ mime = tree._mime;
+ }
+
+ mimetype = mime.lookup(filePath);
+
+ // use base 64 unless it's an ASCII or UTF-8 format
+ var charset = mime.charsets.lookup(mimetype);
+ useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;
+ if (useBase64) { mimetype += ';base64'; }
+ }
+ else {
+ useBase64 = /;base64$/.test(mimetype);
+ }
+
+ var buf = fs.readFileSync(filePath);
+
+ // IE8 cannot handle a data-uri larger than 32KB. If this is exceeded
+ // and the --ieCompat flag is enabled, return a normal url() instead.
+ var DATA_URI_MAX_KB = 32,
+ fileSizeInKB = parseInt((buf.length / 1024), 10);
+ if (fileSizeInKB >= DATA_URI_MAX_KB) {
+
+ if (this.env.ieCompat !== false) {
+ if (!this.env.silent) {
+ console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!", filePath, fileSizeInKB, DATA_URI_MAX_KB);
+ }
+
+ return new tree.URL(filePathNode || mimetypeNode, this.currentFileInfo).eval(this.env);
+ }
+ }
+
+ buf = useBase64 ? buf.toString('base64')
+ : encodeURIComponent(buf);
+
+ var uri = "\"data:" + mimetype + ',' + buf + "\"";
+ return new(tree.URL)(new(tree.Anonymous)(uri));
+ },
+
+ "svg-gradient": function(direction) {
+
+ function throwArgumentDescriptor() {
+ throw { type: "Argument", message: "svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]" };
+ }
+
+ if (arguments.length < 3) {
+ throwArgumentDescriptor();
+ }
+ var stops = Array.prototype.slice.call(arguments, 1),
+ gradientDirectionSvg,
+ gradientType = "linear",
+ rectangleDimension = 'x="0" y="0" width="1" height="1"',
+ useBase64 = true,
+ renderEnv = {compress: false},
+ returner,
+ directionValue = direction.toCSS(renderEnv),
+ i, color, position, positionValue, alpha;
+
+ switch (directionValue) {
+ case "to bottom":
+ gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"';
+ break;
+ case "to right":
+ gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"';
+ break;
+ case "to bottom right":
+ gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"';
+ break;
+ case "to top right":
+ gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
+ break;
+ case "ellipse":
+ case "ellipse at center":
+ gradientType = "radial";
+ gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';
+ rectangleDimension = 'x="-50" y="-50" width="101" height="101"';
+ break;
+ default:
+ throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" };
+ }
+ returner = '<?xml version="1.0" ?>' +
+ '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">' +
+ '<' + gradientType + 'Gradient id="gradient" gradientUnits="userSpaceOnUse" ' + gradientDirectionSvg + '>';
+
+ for (i = 0; i < stops.length; i+= 1) {
+ if (stops[i].value) {
+ color = stops[i].value[0];
+ position = stops[i].value[1];
+ } else {
+ color = stops[i];
+ position = undefined;
+ }
+
+ if (!(color instanceof tree.Color) || (!((i === 0 || i+1 === stops.length) && position === undefined) && !(position instanceof tree.Dimension))) {
+ throwArgumentDescriptor();
+ }
+ positionValue = position ? position.toCSS(renderEnv) : i === 0 ? "0%" : "100%";
+ alpha = color.alpha;
+ returner += '<stop offset="' + positionValue + '" stop-color="' + color.toRGB() + '"' + (alpha < 1 ? ' stop-opacity="' + alpha + '"' : '') + '/>';
+ }
+ returner += '</' + gradientType + 'Gradient>' +
+ '<rect ' + rectangleDimension + ' fill="url(#gradient)" /></svg>';
+
+ if (useBase64) {
+ try {
+ returner = require('./encoder').encodeBase64(returner); // TODO browser implementation
+ } catch(e) {
+ useBase64 = false;
+ }
+ }
+
+ returner = "'data:image/svg+xml" + (useBase64 ? ";base64" : "") + "," + returner + "'";
+ return new(tree.URL)(new(tree.Anonymous)(returner));
+ }
+};
+
+// these static methods are used as a fallback when the optional 'mime' dependency is missing
+tree._mime = {
+ // this map is intentionally incomplete
+ // if you want more, install 'mime' dep
+ _types: {
+ '.htm' : 'text/html',
+ '.html': 'text/html',
+ '.gif' : 'image/gif',
+ '.jpg' : 'image/jpeg',
+ '.jpeg': 'image/jpeg',
+ '.png' : 'image/png'
+ },
+ lookup: function (filepath) {
+ var ext = require('path').extname(filepath),
+ type = tree._mime._types[ext];
+ if (type === undefined) {
+ throw new Error('Optional dependency "mime" is required for ' + ext);
+ }
+ return type;
+ },
+ charsets: {
+ lookup: function (type) {
+ // assumes all text types are UTF-8
+ return type && (/^text\//).test(type) ? 'UTF-8' : '';
+ }
+ }
+};
+
+// Math
+
+var mathFunctions = {
+ // name, unit
+ ceil: null,
+ floor: null,
+ sqrt: null,
+ abs: null,
+ tan: "",
+ sin: "",
+ cos: "",
+ atan: "rad",
+ asin: "rad",
+ acos: "rad"
+};
+
+function _math(fn, unit, n) {
+ if (!(n instanceof tree.Dimension)) {
+ throw { type: "Argument", message: "argument must be a number" };
+ }
+ if (unit == null) {
+ unit = n.unit;
+ } else {
+ n = n.unify();
+ }
+ return new(tree.Dimension)(fn(parseFloat(n.value)), unit);
+}
+
+// ~ End of Math
+
+// Color Blending
+// ref: http://www.w3.org/TR/compositing-1
+
+function colorBlend(mode, color1, color2) {
+ var ab = color1.alpha, cb, // backdrop
+ as = color2.alpha, cs, // source
+ ar, cr, r = []; // result
+
+ ar = as + ab * (1 - as);
+ for (var i = 0; i < 3; i++) {
+ cb = color1.rgb[i] / 255;
+ cs = color2.rgb[i] / 255;
+ cr = mode(cb, cs);
+ if (ar) {
+ cr = (as * cs + ab * (cb
+ - as * (cb + cs - cr))) / ar;
+ }
+ r[i] = cr * 255;
+ }
+
+ return new(tree.Color)(r, ar);
+}
+
+var colorBlendMode = {
+ multiply: function(cb, cs) {
+ return cb * cs;
+ },
+ screen: function(cb, cs) {
+ return cb + cs - cb * cs;
+ },
+ overlay: function(cb, cs) {
+ cb *= 2;
+ return (cb <= 1)
+ ? colorBlendMode.multiply(cb, cs)
+ : colorBlendMode.screen(cb - 1, cs);
+ },
+ softlight: function(cb, cs) {
+ var d = 1, e = cb;
+ if (cs > 0.5) {
+ e = 1;
+ d = (cb > 0.25) ? Math.sqrt(cb)
+ : ((16 * cb - 12) * cb + 4) * cb;
+ }
+ return cb - (1 - 2 * cs) * e * (d - cb);
+ },
+ hardlight: function(cb, cs) {
+ return colorBlendMode.overlay(cs, cb);
+ },
+ difference: function(cb, cs) {
+ return Math.abs(cb - cs);
+ },
+ exclusion: function(cb, cs) {
+ return cb + cs - 2 * cb * cs;
+ },
+
+ // non-w3c functions:
+ average: function(cb, cs) {
+ return (cb + cs) / 2;
+ },
+ negation: function(cb, cs) {
+ return 1 - Math.abs(cb + cs - 1);
+ }
+};
+
+// ~ End of Color Blending
+
+tree.defaultFunc = {
+ eval: function () {
+ var v = this.value_, e = this.error_;
+ if (e) {
+ throw e;
+ }
+ if (v != null) {
+ return v ? tree.True : tree.False;
+ }
+ },
+ value: function (v) {
+ this.value_ = v;
+ },
+ error: function (e) {
+ this.error_ = e;
+ },
+ reset: function () {
+ this.value_ = this.error_ = null;
+ }
+};
+
+function initFunctions() {
+ var f, tf = tree.functions;
+
+ // math
+ for (f in mathFunctions) {
+ if (mathFunctions.hasOwnProperty(f)) {
+ tf[f] = _math.bind(null, Math[f], mathFunctions[f]);
+ }
+ }
+
+ // color blending
+ for (f in colorBlendMode) {
+ if (colorBlendMode.hasOwnProperty(f)) {
+ tf[f] = colorBlend.bind(null, colorBlendMode[f]);
+ }
+ }
+
+ // default
+ f = tree.defaultFunc;
+ tf["default"] = f.eval.bind(f);
+
+} initFunctions();
+
+function hsla(color) {
+ return tree.functions.hsla(color.h, color.s, color.l, color.a);
+}
+
+function scaled(n, size) {
+ if (n instanceof tree.Dimension && n.unit.is('%')) {
+ return parseFloat(n.value * size / 100);
+ } else {
+ return number(n);
+ }
+}
+
+function number(n) {
+ if (n instanceof tree.Dimension) {
+ return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
+ } else if (typeof(n) === 'number') {
+ return n;
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "color functions take numbers as parameters"
+ };
+ }
+}
+
+function clamp(val) {
+ return Math.min(1, Math.max(0, val));
+}
+
+tree.fround = function(env, value) {
+ var p;
+ if (env && (env.numPrecision != null)) {
+ p = Math.pow(10, env.numPrecision);
+ return Math.round(value * p) / p;
+ } else {
+ return value;
+ }
+};
+
+tree.functionCall = function(env, currentFileInfo) {
+ this.env = env;
+ this.currentFileInfo = currentFileInfo;
+};
+
+tree.functionCall.prototype = tree.functions;
+
+})(require('./tree'));
+
+(function (tree) {
+ tree.colors = {
+ 'aliceblue':'#f0f8ff',
+ 'antiquewhite':'#faebd7',
+ 'aqua':'#00ffff',
+ 'aquamarine':'#7fffd4',
+ 'azure':'#f0ffff',
+ 'beige':'#f5f5dc',
+ 'bisque':'#ffe4c4',
+ 'black':'#000000',
+ 'blanchedalmond':'#ffebcd',
+ 'blue':'#0000ff',
+ 'blueviolet':'#8a2be2',
+ 'brown':'#a52a2a',
+ 'burlywood':'#deb887',
+ 'cadetblue':'#5f9ea0',
+ 'chartreuse':'#7fff00',
+ 'chocolate':'#d2691e',
+ 'coral':'#ff7f50',
+ 'cornflowerblue':'#6495ed',
+ 'cornsilk':'#fff8dc',
+ 'crimson':'#dc143c',
+ 'cyan':'#00ffff',
+ 'darkblue':'#00008b',
+ 'darkcyan':'#008b8b',
+ 'darkgoldenrod':'#b8860b',
+ 'darkgray':'#a9a9a9',
+ 'darkgrey':'#a9a9a9',
+ 'darkgreen':'#006400',
+ 'darkkhaki':'#bdb76b',
+ 'darkmagenta':'#8b008b',
+ 'darkolivegreen':'#556b2f',
+ 'darkorange':'#ff8c00',
+ 'darkorchid':'#9932cc',
+ 'darkred':'#8b0000',
+ 'darksalmon':'#e9967a',
+ 'darkseagreen':'#8fbc8f',
+ 'darkslateblue':'#483d8b',
+ 'darkslategray':'#2f4f4f',
+ 'darkslategrey':'#2f4f4f',
+ 'darkturquoise':'#00ced1',
+ 'darkviolet':'#9400d3',
+ 'deeppink':'#ff1493',
+ 'deepskyblue':'#00bfff',
+ 'dimgray':'#696969',
+ 'dimgrey':'#696969',
+ 'dodgerblue':'#1e90ff',
+ 'firebrick':'#b22222',
+ 'floralwhite':'#fffaf0',
+ 'forestgreen':'#228b22',
+ 'fuchsia':'#ff00ff',
+ 'gainsboro':'#dcdcdc',
+ 'ghostwhite':'#f8f8ff',
+ 'gold':'#ffd700',
+ 'goldenrod':'#daa520',
+ 'gray':'#808080',
+ 'grey':'#808080',
+ 'green':'#008000',
+ 'greenyellow':'#adff2f',
+ 'honeydew':'#f0fff0',
+ 'hotpink':'#ff69b4',
+ 'indianred':'#cd5c5c',
+ 'indigo':'#4b0082',
+ 'ivory':'#fffff0',
+ 'khaki':'#f0e68c',
+ 'lavender':'#e6e6fa',
+ 'lavenderblush':'#fff0f5',
+ 'lawngreen':'#7cfc00',
+ 'lemonchiffon':'#fffacd',
+ 'lightblue':'#add8e6',
+ 'lightcoral':'#f08080',
+ 'lightcyan':'#e0ffff',
+ 'lightgoldenrodyellow':'#fafad2',
+ 'lightgray':'#d3d3d3',
+ 'lightgrey':'#d3d3d3',
+ 'lightgreen':'#90ee90',
+ 'lightpink':'#ffb6c1',
+ 'lightsalmon':'#ffa07a',
+ 'lightseagreen':'#20b2aa',
+ 'lightskyblue':'#87cefa',
+ 'lightslategray':'#778899',
+ 'lightslategrey':'#778899',
+ 'lightsteelblue':'#b0c4de',
+ 'lightyellow':'#ffffe0',
+ 'lime':'#00ff00',
+ 'limegreen':'#32cd32',
+ 'linen':'#faf0e6',
+ 'magenta':'#ff00ff',
+ 'maroon':'#800000',
+ 'mediumaquamarine':'#66cdaa',
+ 'mediumblue':'#0000cd',
+ 'mediumorchid':'#ba55d3',
+ 'mediumpurple':'#9370d8',
+ 'mediumseagreen':'#3cb371',
+ 'mediumslateblue':'#7b68ee',
+ 'mediumspringgreen':'#00fa9a',
+ 'mediumturquoise':'#48d1cc',
+ 'mediumvioletred':'#c71585',
+ 'midnightblue':'#191970',
+ 'mintcream':'#f5fffa',
+ 'mistyrose':'#ffe4e1',
+ 'moccasin':'#ffe4b5',
+ 'navajowhite':'#ffdead',
+ 'navy':'#000080',
+ 'oldlace':'#fdf5e6',
+ 'olive':'#808000',
+ 'olivedrab':'#6b8e23',
+ 'orange':'#ffa500',
+ 'orangered':'#ff4500',
+ 'orchid':'#da70d6',
+ 'palegoldenrod':'#eee8aa',
+ 'palegreen':'#98fb98',
+ 'paleturquoise':'#afeeee',
+ 'palevioletred':'#d87093',
+ 'papayawhip':'#ffefd5',
+ 'peachpuff':'#ffdab9',
+ 'peru':'#cd853f',
+ 'pink':'#ffc0cb',
+ 'plum':'#dda0dd',
+ 'powderblue':'#b0e0e6',
+ 'purple':'#800080',
+ 'red':'#ff0000',
+ 'rosybrown':'#bc8f8f',
+ 'royalblue':'#4169e1',
+ 'saddlebrown':'#8b4513',
+ 'salmon':'#fa8072',
+ 'sandybrown':'#f4a460',
+ 'seagreen':'#2e8b57',
+ 'seashell':'#fff5ee',
+ 'sienna':'#a0522d',
+ 'silver':'#c0c0c0',
+ 'skyblue':'#87ceeb',
+ 'slateblue':'#6a5acd',
+ 'slategray':'#708090',
+ 'slategrey':'#708090',
+ 'snow':'#fffafa',
+ 'springgreen':'#00ff7f',
+ 'steelblue':'#4682b4',
+ 'tan':'#d2b48c',
+ 'teal':'#008080',
+ 'thistle':'#d8bfd8',
+ 'tomato':'#ff6347',
+ 'turquoise':'#40e0d0',
+ 'violet':'#ee82ee',
+ 'wheat':'#f5deb3',
+ 'white':'#ffffff',
+ 'whitesmoke':'#f5f5f5',
+ 'yellow':'#ffff00',
+ 'yellowgreen':'#9acd32'
+ };
+})(require('./tree'));
+
+(function (tree) {
+
+tree.debugInfo = function(env, ctx, lineSeperator) {
+ var result="";
+ if (env.dumpLineNumbers && !env.compress) {
+ switch(env.dumpLineNumbers) {
+ case 'comments':
+ result = tree.debugInfo.asComment(ctx);
+ break;
+ case 'mediaquery':
+ result = tree.debugInfo.asMediaQuery(ctx);
+ break;
+ case 'all':
+ result = tree.debugInfo.asComment(ctx) + (lineSeperator || "") + tree.debugInfo.asMediaQuery(ctx);
+ break;
+ }
+ }
+ return result;
+};
+
+tree.debugInfo.asComment = function(ctx) {
+ return '/* line ' + ctx.debugInfo.lineNumber + ', ' + ctx.debugInfo.fileName + ' */\n';
+};
+
+tree.debugInfo.asMediaQuery = function(ctx) {
+ return '@media -sass-debug-info{filename{font-family:' +
+ ('file://' + ctx.debugInfo.fileName).replace(/([.:\/\\])/g, function (a) {
+ if (a == '\\') {
+ a = '\/';
+ }
+ return '\\' + a;
+ }) +
+ '}line{font-family:\\00003' + ctx.debugInfo.lineNumber + '}}\n';
+};
+
+tree.find = function (obj, fun) {
+ for (var i = 0, r; i < obj.length; i++) {
+ r = fun.call(obj, obj[i]);
+ if (r) { return r; }
+ }
+ return null;
+};
+
+tree.jsify = function (obj) {
+ if (Array.isArray(obj.value) && (obj.value.length > 1)) {
+ return '[' + obj.value.map(function (v) { return v.toCSS(false); }).join(', ') + ']';
+ } else {
+ return obj.toCSS(false);
+ }
+};
+
+tree.toCSS = function (env) {
+ var strs = [];
+ this.genCSS(env, {
+ add: function(chunk, fileInfo, index) {
+ strs.push(chunk);
+ },
+ isEmpty: function () {
+ return strs.length === 0;
+ }
+ });
+ return strs.join('');
+};
+
+tree.outputRuleset = function (env, output, rules) {
+ var ruleCnt = rules.length, i;
+ env.tabLevel = (env.tabLevel | 0) + 1;
+
+ // Compressed
+ if (env.compress) {
+ output.add('{');
+ for (i = 0; i < ruleCnt; i++) {
+ rules[i].genCSS(env, output);
+ }
+ output.add('}');
+ env.tabLevel--;
+ return;
+ }
+
+ // Non-compressed
+ var tabSetStr = '\n' + Array(env.tabLevel).join(" "), tabRuleStr = tabSetStr + " ";
+ if (!ruleCnt) {
+ output.add(" {" + tabSetStr + '}');
+ } else {
+ output.add(" {" + tabRuleStr);
+ rules[0].genCSS(env, output);
+ for (i = 1; i < ruleCnt; i++) {
+ output.add(tabRuleStr);
+ rules[i].genCSS(env, output);
+ }
+ output.add(tabSetStr + '}');
+ }
+
+ env.tabLevel--;
+};
+
+})(require('./tree'));
+
+(function (tree) {
+
+tree.Alpha = function (val) {
+ this.value = val;
+};
+tree.Alpha.prototype = {
+ type: "Alpha",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ eval: function (env) {
+ if (this.value.eval) { return new tree.Alpha(this.value.eval(env)); }
+ return this;
+ },
+ genCSS: function (env, output) {
+ output.add("alpha(opacity=");
+
+ if (this.value.genCSS) {
+ this.value.genCSS(env, output);
+ } else {
+ output.add(this.value);
+ }
+
+ output.add(")");
+ },
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Anonymous = function (string, index, currentFileInfo, mapLines) {
+ this.value = string.value || string;
+ this.index = index;
+ this.mapLines = mapLines;
+ this.currentFileInfo = currentFileInfo;
+};
+tree.Anonymous.prototype = {
+ type: "Anonymous",
+ eval: function () {
+ return new tree.Anonymous(this.value, this.index, this.currentFileInfo, this.mapLines);
+ },
+ compare: function (x) {
+ if (!x.toCSS) {
+ return -1;
+ }
+
+ var left = this.toCSS(),
+ right = x.toCSS();
+
+ if (left === right) {
+ return 0;
+ }
+
+ return left < right ? -1 : 1;
+ },
+ genCSS: function (env, output) {
+ output.add(this.value, this.currentFileInfo, this.index, this.mapLines);
+ },
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Assignment = function (key, val) {
+ this.key = key;
+ this.value = val;
+};
+tree.Assignment.prototype = {
+ type: "Assignment",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ eval: function (env) {
+ if (this.value.eval) {
+ return new(tree.Assignment)(this.key, this.value.eval(env));
+ }
+ return this;
+ },
+ genCSS: function (env, output) {
+ output.add(this.key + '=');
+ if (this.value.genCSS) {
+ this.value.genCSS(env, output);
+ } else {
+ output.add(this.value);
+ }
+ },
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+//
+// A function call node.
+//
+tree.Call = function (name, args, index, currentFileInfo) {
+ this.name = name;
+ this.args = args;
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+};
+tree.Call.prototype = {
+ type: "Call",
+ accept: function (visitor) {
+ if (this.args) {
+ this.args = visitor.visitArray(this.args);
+ }
+ },
+ //
+ // When evaluating a function call,
+ // we either find the function in `tree.functions` [1],
+ // in which case we call it, passing the evaluated arguments,
+ // if this returns null or we cannot find the function, we
+ // simply print it out as it appeared originally [2].
+ //
+ // The *functions.js* file contains the built-in functions.
+ //
+ // The reason why we evaluate the arguments, is in the case where
+ // we try to pass a variable to a function, like: `saturate(@color)`.
+ // The function should receive the value, not the variable.
+ //
+ eval: function (env) {
+ var args = this.args.map(function (a) { return a.eval(env); }),
+ nameLC = this.name.toLowerCase(),
+ result, func;
+
+ if (nameLC in tree.functions) { // 1.
+ try {
+ func = new tree.functionCall(env, this.currentFileInfo);
+ result = func[nameLC].apply(func, args);
+ if (result != null) {
+ return result;
+ }
+ } catch (e) {
+ throw { type: e.type || "Runtime",
+ message: "error evaluating function `" + this.name + "`" +
+ (e.message ? ': ' + e.message : ''),
+ index: this.index, filename: this.currentFileInfo.filename };
+ }
+ }
+
+ return new tree.Call(this.name, args, this.index, this.currentFileInfo);
+ },
+
+ genCSS: function (env, output) {
+ output.add(this.name + "(", this.currentFileInfo, this.index);
+
+ for(var i = 0; i < this.args.length; i++) {
+ this.args[i].genCSS(env, output);
+ if (i + 1 < this.args.length) {
+ output.add(", ");
+ }
+ }
+
+ output.add(")");
+ },
+
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+//
+// RGB Colors - #ff0014, #eee
+//
+tree.Color = function (rgb, a) {
+ //
+ // The end goal here, is to parse the arguments
+ // into an integer triplet, such as `128, 255, 0`
+ //
+ // This facilitates operations and conversions.
+ //
+ if (Array.isArray(rgb)) {
+ this.rgb = rgb;
+ } else if (rgb.length == 6) {
+ this.rgb = rgb.match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else {
+ this.rgb = rgb.split('').map(function (c) {
+ return parseInt(c + c, 16);
+ });
+ }
+ this.alpha = typeof(a) === 'number' ? a : 1;
+};
+
+var transparentKeyword = "transparent";
+
+tree.Color.prototype = {
+ type: "Color",
+ eval: function () { return this; },
+ luma: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255;
+
+ r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);
+ g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);
+ b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);
+
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
+ },
+
+ genCSS: function (env, output) {
+ output.add(this.toCSS(env));
+ },
+ toCSS: function (env, doNotCompress) {
+ var compress = env && env.compress && !doNotCompress,
+ alpha = tree.fround(env, this.alpha);
+
+ // If we have some transparency, the only way to represent it
+ // is via `rgba`. Otherwise, we use the hex representation,
+ // which has better compatibility with older browsers.
+ // Values are capped between `0` and `255`, rounded and zero-padded.
+ if (alpha < 1) {
+ if (alpha === 0 && this.isTransparentKeyword) {
+ return transparentKeyword;
+ }
+ return "rgba(" + this.rgb.map(function (c) {
+ return clamp(Math.round(c), 255);
+ }).concat(clamp(alpha, 1))
+ .join(',' + (compress ? '' : ' ')) + ")";
+ } else {
+ var color = this.toRGB();
+
+ if (compress) {
+ var splitcolor = color.split('');
+
+ // Convert color to short format
+ if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {
+ color = '#' + splitcolor[1] + splitcolor[3] + splitcolor[5];
+ }
+ }
+
+ return color;
+ }
+ },
+
+ //
+ // Operations have to be done per-channel, if not,
+ // channels will spill onto each other. Once we have
+ // our result, in the form of an integer triplet,
+ // we create a new Color node to hold the result.
+ //
+ operate: function (env, op, other) {
+ var rgb = [];
+ var alpha = this.alpha * (1 - other.alpha) + other.alpha;
+ for (var c = 0; c < 3; c++) {
+ rgb[c] = tree.operate(env, op, this.rgb[c], other.rgb[c]);
+ }
+ return new(tree.Color)(rgb, alpha);
+ },
+
+ toRGB: function () {
+ return toHex(this.rgb);
+ },
+
+ toHSL: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255,
+ a = this.alpha;
+
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
+ var h, s, l = (max + min) / 2, d = max - min;
+
+ if (max === min) {
+ h = s = 0;
+ } else {
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+
+ switch (max) {
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+ case g: h = (b - r) / d + 2; break;
+ case b: h = (r - g) / d + 4; break;
+ }
+ h /= 6;
+ }
+ return { h: h * 360, s: s, l: l, a: a };
+ },
+ //Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
+ toHSV: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255,
+ a = this.alpha;
+
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
+ var h, s, v = max;
+
+ var d = max - min;
+ if (max === 0) {
+ s = 0;
+ } else {
+ s = d / max;
+ }
+
+ if (max === min) {
+ h = 0;
+ } else {
+ switch(max){
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+ case g: h = (b - r) / d + 2; break;
+ case b: h = (r - g) / d + 4; break;
+ }
+ h /= 6;
+ }
+ return { h: h * 360, s: s, v: v, a: a };
+ },
+ toARGB: function () {
+ return toHex([this.alpha * 255].concat(this.rgb));
+ },
+ compare: function (x) {
+ if (!x.rgb) {
+ return -1;
+ }
+
+ return (x.rgb[0] === this.rgb[0] &&
+ x.rgb[1] === this.rgb[1] &&
+ x.rgb[2] === this.rgb[2] &&
+ x.alpha === this.alpha) ? 0 : -1;
+ }
+};
+
+tree.Color.fromKeyword = function(keyword) {
+ keyword = keyword.toLowerCase();
+
+ if (tree.colors.hasOwnProperty(keyword)) {
+ // detect named color
+ return new(tree.Color)(tree.colors[keyword].slice(1));
+ }
+ if (keyword === transparentKeyword) {
+ var transparent = new(tree.Color)([0, 0, 0], 0);
+ transparent.isTransparentKeyword = true;
+ return transparent;
+ }
+};
+
+function toHex(v) {
+ return '#' + v.map(function (c) {
+ c = clamp(Math.round(c), 255);
+ return (c < 16 ? '0' : '') + c.toString(16);
+ }).join('');
+}
+
+function clamp(v, max) {
+ return Math.min(Math.max(v, 0), max);
+}
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Comment = function (value, silent, index, currentFileInfo) {
+ this.value = value;
+ this.silent = !!silent;
+ this.currentFileInfo = currentFileInfo;
+};
+tree.Comment.prototype = {
+ type: "Comment",
+ genCSS: function (env, output) {
+ if (this.debugInfo) {
+ output.add(tree.debugInfo(env, this), this.currentFileInfo, this.index);
+ }
+ output.add(this.value.trim()); //TODO shouldn't need to trim, we shouldn't grab the \n
+ },
+ toCSS: tree.toCSS,
+ isSilent: function(env) {
+ var isReference = (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced),
+ isCompressed = env.compress && !this.value.match(/^\/\*!/);
+ return this.silent || isReference || isCompressed;
+ },
+ eval: function () { return this; },
+ markReferenced: function () {
+ this.isReferenced = true;
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Condition = function (op, l, r, i, negate) {
+ this.op = op.trim();
+ this.lvalue = l;
+ this.rvalue = r;
+ this.index = i;
+ this.negate = negate;
+};
+tree.Condition.prototype = {
+ type: "Condition",
+ accept: function (visitor) {
+ this.lvalue = visitor.visit(this.lvalue);
+ this.rvalue = visitor.visit(this.rvalue);
+ },
+ eval: function (env) {
+ var a = this.lvalue.eval(env),
+ b = this.rvalue.eval(env);
+
+ var i = this.index, result;
+
+ result = (function (op) {
+ switch (op) {
+ case 'and':
+ return a && b;
+ case 'or':
+ return a || b;
+ default:
+ if (a.compare) {
+ result = a.compare(b);
+ } else if (b.compare) {
+ result = b.compare(a);
+ } else {
+ throw { type: "Type",
+ message: "Unable to perform comparison",
+ index: i };
+ }
+ switch (result) {
+ case -1: return op === '<' || op === '=<' || op === '<=';
+ case 0: return op === '=' || op === '>=' || op === '=<' || op === '<=';
+ case 1: return op === '>' || op === '>=';
+ }
+ }
+ })(this.op);
+ return this.negate ? !result : result;
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.DetachedRuleset = function (ruleset, frames) {
+ this.ruleset = ruleset;
+ this.frames = frames;
+};
+tree.DetachedRuleset.prototype = {
+ type: "DetachedRuleset",
+ accept: function (visitor) {
+ this.ruleset = visitor.visit(this.ruleset);
+ },
+ eval: function (env) {
+ var frames = this.frames || env.frames.slice(0);
+ return new tree.DetachedRuleset(this.ruleset, frames);
+ },
+ callEval: function (env) {
+ return this.ruleset.eval(this.frames ? new(tree.evalEnv)(env, this.frames.concat(env.frames)) : env);
+ }
+};
+})(require('../tree'));
+
+(function (tree) {
+
+//
+// A number with a unit
+//
+tree.Dimension = function (value, unit) {
+ this.value = parseFloat(value);
+ this.unit = (unit && unit instanceof tree.Unit) ? unit :
+ new(tree.Unit)(unit ? [unit] : undefined);
+};
+
+tree.Dimension.prototype = {
+ type: "Dimension",
+ accept: function (visitor) {
+ this.unit = visitor.visit(this.unit);
+ },
+ eval: function (env) {
+ return this;
+ },
+ toColor: function () {
+ return new(tree.Color)([this.value, this.value, this.value]);
+ },
+ genCSS: function (env, output) {
+ if ((env && env.strictUnits) && !this.unit.isSingular()) {
+ throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());
+ }
+
+ var value = tree.fround(env, this.value),
+ strValue = String(value);
+
+ if (value !== 0 && value < 0.000001 && value > -0.000001) {
+ // would be output 1e-6 etc.
+ strValue = value.toFixed(20).replace(/0+$/, "");
+ }
+
+ if (env && env.compress) {
+ // Zero values doesn't need a unit
+ if (value === 0 && this.unit.isLength()) {
+ output.add(strValue);
+ return;
+ }
+
+ // Float values doesn't need a leading zero
+ if (value > 0 && value < 1) {
+ strValue = (strValue).substr(1);
+ }
+ }
+
+ output.add(strValue);
+ this.unit.genCSS(env, output);
+ },
+ toCSS: tree.toCSS,
+
+ // In an operation between two Dimensions,
+ // we default to the first Dimension's unit,
+ // so `1px + 2` will yield `3px`.
+ operate: function (env, op, other) {
+ /*jshint noempty:false */
+ var value = tree.operate(env, op, this.value, other.value),
+ unit = this.unit.clone();
+
+ if (op === '+' || op === '-') {
+ if (unit.numerator.length === 0 && unit.denominator.length === 0) {
+ unit.numerator = other.unit.numerator.slice(0);
+ unit.denominator = other.unit.denominator.slice(0);
+ } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {
+ // do nothing
+ } else {
+ other = other.convertTo(this.unit.usedUnits());
+
+ if(env.strictUnits && other.unit.toString() !== unit.toString()) {
+ throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + unit.toString() +
+ "' and '" + other.unit.toString() + "'.");
+ }
+
+ value = tree.operate(env, op, this.value, other.value);
+ }
+ } else if (op === '*') {
+ unit.numerator = unit.numerator.concat(other.unit.numerator).sort();
+ unit.denominator = unit.denominator.concat(other.unit.denominator).sort();
+ unit.cancel();
+ } else if (op === '/') {
+ unit.numerator = unit.numerator.concat(other.unit.denominator).sort();
+ unit.denominator = unit.denominator.concat(other.unit.numerator).sort();
+ unit.cancel();
+ }
+ return new(tree.Dimension)(value, unit);
+ },
+
+ compare: function (other) {
+ if (other instanceof tree.Dimension) {
+ var a, b,
+ aValue, bValue;
+
+ if (this.unit.isEmpty() || other.unit.isEmpty()) {
+ a = this;
+ b = other;
+ } else {
+ a = this.unify();
+ b = other.unify();
+ if (a.unit.compare(b.unit) !== 0) {
+ return -1;
+ }
+ }
+ aValue = a.value;
+ bValue = b.value;
+
+ if (bValue > aValue) {
+ return -1;
+ } else if (bValue < aValue) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } else {
+ return -1;
+ }
+ },
+
+ unify: function () {
+ return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });
+ },
+
+ convertTo: function (conversions) {
+ var value = this.value, unit = this.unit.clone(),
+ i, groupName, group, targetUnit, derivedConversions = {}, applyUnit;
+
+ if (typeof conversions === 'string') {
+ for(i in tree.UnitConversions) {
+ if (tree.UnitConversions[i].hasOwnProperty(conversions)) {
+ derivedConversions = {};
+ derivedConversions[i] = conversions;
+ }
+ }
+ conversions = derivedConversions;
+ }
+ applyUnit = function (atomicUnit, denominator) {
+ /*jshint loopfunc:true */
+ if (group.hasOwnProperty(atomicUnit)) {
+ if (denominator) {
+ value = value / (group[atomicUnit] / group[targetUnit]);
+ } else {
+ value = value * (group[atomicUnit] / group[targetUnit]);
+ }
+
+ return targetUnit;
+ }
+
+ return atomicUnit;
+ };
+
+ for (groupName in conversions) {
+ if (conversions.hasOwnProperty(groupName)) {
+ targetUnit = conversions[groupName];
+ group = tree.UnitConversions[groupName];
+
+ unit.map(applyUnit);
+ }
+ }
+
+ unit.cancel();
+
+ return new(tree.Dimension)(value, unit);
+ }
+};
+
+// http://www.w3.org/TR/css3-values/#absolute-lengths
+tree.UnitConversions = {
+ length: {
+ 'm': 1,
+ 'cm': 0.01,
+ 'mm': 0.001,
+ 'in': 0.0254,
+ 'px': 0.0254 / 96,
+ 'pt': 0.0254 / 72,
+ 'pc': 0.0254 / 72 * 12
+ },
+ duration: {
+ 's': 1,
+ 'ms': 0.001
+ },
+ angle: {
+ 'rad': 1/(2*Math.PI),
+ 'deg': 1/360,
+ 'grad': 1/400,
+ 'turn': 1
+ }
+};
+
+tree.Unit = function (numerator, denominator, backupUnit) {
+ this.numerator = numerator ? numerator.slice(0).sort() : [];
+ this.denominator = denominator ? denominator.slice(0).sort() : [];
+ this.backupUnit = backupUnit;
+};
+
+tree.Unit.prototype = {
+ type: "Unit",
+ clone: function () {
+ return new tree.Unit(this.numerator.slice(0), this.denominator.slice(0), this.backupUnit);
+ },
+ genCSS: function (env, output) {
+ if (this.numerator.length >= 1) {
+ output.add(this.numerator[0]);
+ } else
+ if (this.denominator.length >= 1) {
+ output.add(this.denominator[0]);
+ } else
+ if ((!env || !env.strictUnits) && this.backupUnit) {
+ output.add(this.backupUnit);
+ }
+ },
+ toCSS: tree.toCSS,
+
+ toString: function () {
+ var i, returnStr = this.numerator.join("*");
+ for (i = 0; i < this.denominator.length; i++) {
+ returnStr += "/" + this.denominator[i];
+ }
+ return returnStr;
+ },
+
+ compare: function (other) {
+ return this.is(other.toString()) ? 0 : -1;
+ },
+
+ is: function (unitString) {
+ return this.toString() === unitString;
+ },
+
+ isLength: function () {
+ return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/));
+ },
+
+ isEmpty: function () {
+ return this.numerator.length === 0 && this.denominator.length === 0;
+ },
+
+ isSingular: function() {
+ return this.numerator.length <= 1 && this.denominator.length === 0;
+ },
+
+ map: function(callback) {
+ var i;
+
+ for (i = 0; i < this.numerator.length; i++) {
+ this.numerator[i] = callback(this.numerator[i], false);
+ }
+
+ for (i = 0; i < this.denominator.length; i++) {
+ this.denominator[i] = callback(this.denominator[i], true);
+ }
+ },
+
+ usedUnits: function() {
+ var group, result = {}, mapUnit;
+
+ mapUnit = function (atomicUnit) {
+ /*jshint loopfunc:true */
+ if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {
+ result[groupName] = atomicUnit;
+ }
+
+ return atomicUnit;
+ };
+
+ for (var groupName in tree.UnitConversions) {
+ if (tree.UnitConversions.hasOwnProperty(groupName)) {
+ group = tree.UnitConversions[groupName];
+
+ this.map(mapUnit);
+ }
+ }
+
+ return result;
+ },
+
+ cancel: function () {
+ var counter = {}, atomicUnit, i, backup;
+
+ for (i = 0; i < this.numerator.length; i++) {
+ atomicUnit = this.numerator[i];
+ if (!backup) {
+ backup = atomicUnit;
+ }
+ counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;
+ }
+
+ for (i = 0; i < this.denominator.length; i++) {
+ atomicUnit = this.denominator[i];
+ if (!backup) {
+ backup = atomicUnit;
+ }
+ counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;
+ }
+
+ this.numerator = [];
+ this.denominator = [];
+
+ for (atomicUnit in counter) {
+ if (counter.hasOwnProperty(atomicUnit)) {
+ var count = counter[atomicUnit];
+
+ if (count > 0) {
+ for (i = 0; i < count; i++) {
+ this.numerator.push(atomicUnit);
+ }
+ } else if (count < 0) {
+ for (i = 0; i < -count; i++) {
+ this.denominator.push(atomicUnit);
+ }
+ }
+ }
+ }
+
+ if (this.numerator.length === 0 && this.denominator.length === 0 && backup) {
+ this.backupUnit = backup;
+ }
+
+ this.numerator.sort();
+ this.denominator.sort();
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Directive = function (name, value, rules, index, currentFileInfo, debugInfo) {
+ this.name = name;
+ this.value = value;
+ if (rules) {
+ this.rules = rules;
+ this.rules.allowImports = true;
+ }
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+ this.debugInfo = debugInfo;
+};
+
+tree.Directive.prototype = {
+ type: "Directive",
+ accept: function (visitor) {
+ var value = this.value, rules = this.rules;
+ if (rules) {
+ rules = visitor.visit(rules);
+ }
+ if (value) {
+ value = visitor.visit(value);
+ }
+ },
+ genCSS: function (env, output) {
+ var value = this.value, rules = this.rules;
+ output.add(this.name, this.currentFileInfo, this.index);
+ if (value) {
+ output.add(' ');
+ value.genCSS(env, output);
+ }
+ if (rules) {
+ tree.outputRuleset(env, output, [rules]);
+ } else {
+ output.add(';');
+ }
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ var value = this.value, rules = this.rules;
+ if (value) {
+ value = value.eval(env);
+ }
+ if (rules) {
+ rules = rules.eval(env);
+ rules.root = true;
+ }
+ return new(tree.Directive)(this.name, value, rules,
+ this.index, this.currentFileInfo, this.debugInfo);
+ },
+ variable: function (name) { if (this.rules) return tree.Ruleset.prototype.variable.call(this.rules, name); },
+ find: function () { if (this.rules) return tree.Ruleset.prototype.find.apply(this.rules, arguments); },
+ rulesets: function () { if (this.rules) return tree.Ruleset.prototype.rulesets.apply(this.rules); },
+ markReferenced: function () {
+ var i, rules;
+ this.isReferenced = true;
+ if (this.rules) {
+ rules = this.rules.rules;
+ for (i = 0; i < rules.length; i++) {
+ if (rules[i].markReferenced) {
+ rules[i].markReferenced();
+ }
+ }
+ }
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Element = function (combinator, value, index, currentFileInfo) {
+ this.combinator = combinator instanceof tree.Combinator ?
+ combinator : new(tree.Combinator)(combinator);
+
+ if (typeof(value) === 'string') {
+ this.value = value.trim();
+ } else if (value) {
+ this.value = value;
+ } else {
+ this.value = "";
+ }
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+};
+tree.Element.prototype = {
+ type: "Element",
+ accept: function (visitor) {
+ var value = this.value;
+ this.combinator = visitor.visit(this.combinator);
+ if (typeof value === "object") {
+ this.value = visitor.visit(value);
+ }
+ },
+ eval: function (env) {
+ return new(tree.Element)(this.combinator,
+ this.value.eval ? this.value.eval(env) : this.value,
+ this.index,
+ this.currentFileInfo);
+ },
+ genCSS: function (env, output) {
+ output.add(this.toCSS(env), this.currentFileInfo, this.index);
+ },
+ toCSS: function (env) {
+ var value = (this.value.toCSS ? this.value.toCSS(env) : this.value);
+ if (value === '' && this.combinator.value.charAt(0) === '&') {
+ return '';
+ } else {
+ return this.combinator.toCSS(env || {}) + value;
+ }
+ }
+};
+
+tree.Attribute = function (key, op, value) {
+ this.key = key;
+ this.op = op;
+ this.value = value;
+};
+tree.Attribute.prototype = {
+ type: "Attribute",
+ eval: function (env) {
+ return new(tree.Attribute)(this.key.eval ? this.key.eval(env) : this.key,
+ this.op, (this.value && this.value.eval) ? this.value.eval(env) : this.value);
+ },
+ genCSS: function (env, output) {
+ output.add(this.toCSS(env));
+ },
+ toCSS: function (env) {
+ var value = this.key.toCSS ? this.key.toCSS(env) : this.key;
+
+ if (this.op) {
+ value += this.op;
+ value += (this.value.toCSS ? this.value.toCSS(env) : this.value);
+ }
+
+ return '[' + value + ']';
+ }
+};
+
+tree.Combinator = function (value) {
+ if (value === ' ') {
+ this.value = ' ';
+ } else {
+ this.value = value ? value.trim() : "";
+ }
+};
+tree.Combinator.prototype = {
+ type: "Combinator",
+ _outputMap: {
+ '' : '',
+ ' ' : ' ',
+ ':' : ' :',
+ '+' : ' + ',
+ '~' : ' ~ ',
+ '>' : ' > ',
+ '|' : '|',
+ '^' : ' ^ ',
+ '^^' : ' ^^ '
+ },
+ _outputMapCompressed: {
+ '' : '',
+ ' ' : ' ',
+ ':' : ' :',
+ '+' : '+',
+ '~' : '~',
+ '>' : '>',
+ '|' : '|',
+ '^' : '^',
+ '^^' : '^^'
+ },
+ genCSS: function (env, output) {
+ output.add((env.compress ? this._outputMapCompressed : this._outputMap)[this.value]);
+ },
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Expression = function (value) { this.value = value; };
+tree.Expression.prototype = {
+ type: "Expression",
+ accept: function (visitor) {
+ if (this.value) {
+ this.value = visitor.visitArray(this.value);
+ }
+ },
+ eval: function (env) {
+ var returnValue,
+ inParenthesis = this.parens && !this.parensInOp,
+ doubleParen = false;
+ if (inParenthesis) {
+ env.inParenthesis();
+ }
+ if (this.value.length > 1) {
+ returnValue = new(tree.Expression)(this.value.map(function (e) {
+ return e.eval(env);
+ }));
+ } else if (this.value.length === 1) {
+ if (this.value[0].parens && !this.value[0].parensInOp) {
+ doubleParen = true;
+ }
+ returnValue = this.value[0].eval(env);
+ } else {
+ returnValue = this;
+ }
+ if (inParenthesis) {
+ env.outOfParenthesis();
+ }
+ if (this.parens && this.parensInOp && !(env.isMathOn()) && !doubleParen) {
+ returnValue = new(tree.Paren)(returnValue);
+ }
+ return returnValue;
+ },
+ genCSS: function (env, output) {
+ for(var i = 0; i < this.value.length; i++) {
+ this.value[i].genCSS(env, output);
+ if (i + 1 < this.value.length) {
+ output.add(" ");
+ }
+ }
+ },
+ toCSS: tree.toCSS,
+ throwAwayComments: function () {
+ this.value = this.value.filter(function(v) {
+ return !(v instanceof tree.Comment);
+ });
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Extend = function Extend(selector, option, index) {
+ this.selector = selector;
+ this.option = option;
+ this.index = index;
+ this.object_id = tree.Extend.next_id++;
+ this.parent_ids = [this.object_id];
+
+ switch(option) {
+ case "all":
+ this.allowBefore = true;
+ this.allowAfter = true;
+ break;
+ default:
+ this.allowBefore = false;
+ this.allowAfter = false;
+ break;
+ }
+};
+tree.Extend.next_id = 0;
+
+tree.Extend.prototype = {
+ type: "Extend",
+ accept: function (visitor) {
+ this.selector = visitor.visit(this.selector);
+ },
+ eval: function (env) {
+ return new(tree.Extend)(this.selector.eval(env), this.option, this.index);
+ },
+ clone: function (env) {
+ return new(tree.Extend)(this.selector, this.option, this.index);
+ },
+ findSelfSelectors: function (selectors) {
+ var selfElements = [],
+ i,
+ selectorElements;
+
+ for(i = 0; i < selectors.length; i++) {
+ selectorElements = selectors[i].elements;
+ // duplicate the logic in genCSS function inside the selector node.
+ // future TODO - move both logics into the selector joiner visitor
+ if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === "") {
+ selectorElements[0].combinator.value = ' ';
+ }
+ selfElements = selfElements.concat(selectors[i].elements);
+ }
+
+ this.selfSelectors = [{ elements: selfElements }];
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+//
+// CSS @import node
+//
+// The general strategy here is that we don't want to wait
+// for the parsing to be completed, before we start importing
+// the file. That's because in the context of a browser,
+// most of the time will be spent waiting for the server to respond.
+//
+// On creation, we push the import path to our import queue, though
+// `import,push`, we also pass it a callback, which it'll call once
+// the file has been fetched, and parsed.
+//
+tree.Import = function (path, features, options, index, currentFileInfo) {
+ this.options = options;
+ this.index = index;
+ this.path = path;
+ this.features = features;
+ this.currentFileInfo = currentFileInfo;
+
+ if (this.options.less !== undefined || this.options.inline) {
+ this.css = !this.options.less || this.options.inline;
+ } else {
+ var pathValue = this.getPath();
+ if (pathValue && /css([\?;].*)?$/.test(pathValue)) {
+ this.css = true;
+ }
+ }
+};
+
+//
+// The actual import node doesn't return anything, when converted to CSS.
+// The reason is that it's used at the evaluation stage, so that the rules
+// it imports can be treated like any other rules.
+//
+// In `eval`, we make sure all Import nodes get evaluated, recursively, so
+// we end up with a flat structure, which can easily be imported in the parent
+// ruleset.
+//
+tree.Import.prototype = {
+ type: "Import",
+ accept: function (visitor) {
+ if (this.features) {
+ this.features = visitor.visit(this.features);
+ }
+ this.path = visitor.visit(this.path);
+ if (!this.options.inline && this.root) {
+ this.root = visitor.visit(this.root);
+ }
+ },
+ genCSS: function (env, output) {
+ if (this.css) {
+ output.add("@import ", this.currentFileInfo, this.index);
+ this.path.genCSS(env, output);
+ if (this.features) {
+ output.add(" ");
+ this.features.genCSS(env, output);
+ }
+ output.add(';');
+ }
+ },
+ toCSS: tree.toCSS,
+ getPath: function () {
+ if (this.path instanceof tree.Quoted) {
+ var path = this.path.value;
+ return (this.css !== undefined || /(\.[a-z]*$)|([\?;].*)$/.test(path)) ? path : path + '.less';
+ } else if (this.path instanceof tree.URL) {
+ return this.path.value.value;
+ }
+ return null;
+ },
+ evalForImport: function (env) {
+ return new(tree.Import)(this.path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
+ },
+ evalPath: function (env) {
+ var path = this.path.eval(env);
+ var rootpath = this.currentFileInfo && this.currentFileInfo.rootpath;
+
+ if (!(path instanceof tree.URL)) {
+ if (rootpath) {
+ var pathValue = path.value;
+ // Add the base path if the import is relative
+ if (pathValue && env.isPathRelative(pathValue)) {
+ path.value = rootpath +pathValue;
+ }
+ }
+ path.value = env.normalizePath(path.value);
+ }
+
+ return path;
+ },
+ eval: function (env) {
+ var ruleset, features = this.features && this.features.eval(env);
+
+ if (this.skip) {
+ if (typeof this.skip === "function") {
+ this.skip = this.skip();
+ }
+ if (this.skip) {
+ return [];
+ }
+ }
+
+ if (this.options.inline) {
+ //todo needs to reference css file not import
+ var contents = new(tree.Anonymous)(this.root, 0, {filename: this.importedFilename}, true);
+ return this.features ? new(tree.Media)([contents], this.features.value) : [contents];
+ } else if (this.css) {
+ var newImport = new(tree.Import)(this.evalPath(env), features, this.options, this.index);
+ if (!newImport.css && this.error) {
+ throw this.error;
+ }
+ return newImport;
+ } else {
+ ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
+
+ ruleset.evalImports(env);
+
+ return this.features ? new(tree.Media)(ruleset.rules, this.features.value) : ruleset.rules;
+ }
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.JavaScript = function (string, index, escaped) {
+ this.escaped = escaped;
+ this.expression = string;
+ this.index = index;
+};
+tree.JavaScript.prototype = {
+ type: "JavaScript",
+ eval: function (env) {
+ var result,
+ that = this,
+ context = {};
+
+ var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env));
+ });
+
+ try {
+ expression = new(Function)('return (' + expression + ')');
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`" ,
+ index: this.index };
+ }
+
+ var variables = env.frames[0].variables();
+ for (var k in variables) {
+ if (variables.hasOwnProperty(k)) {
+ /*jshint loopfunc:true */
+ context[k.slice(1)] = {
+ value: variables[k].value,
+ toJS: function () {
+ return this.value.eval(env).toCSS();
+ }
+ };
+ }
+ }
+
+ try {
+ result = expression.call(context);
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message.replace(/["]/g, "'") + "'" ,
+ index: this.index };
+ }
+ if (typeof(result) === 'number') {
+ return new(tree.Dimension)(result);
+ } else if (typeof(result) === 'string') {
+ return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
+ } else if (Array.isArray(result)) {
+ return new(tree.Anonymous)(result.join(', '));
+ } else {
+ return new(tree.Anonymous)(result);
+ }
+ }
+};
+
+})(require('../tree'));
+
+
+(function (tree) {
+
+tree.Keyword = function (value) { this.value = value; };
+tree.Keyword.prototype = {
+ type: "Keyword",
+ eval: function () { return this; },
+ genCSS: function (env, output) {
+ if (this.value === '%') { throw { type: "Syntax", message: "Invalid % without number" }; }
+ output.add(this.value);
+ },
+ toCSS: tree.toCSS,
+ compare: function (other) {
+ if (other instanceof tree.Keyword) {
+ return other.value === this.value ? 0 : 1;
+ } else {
+ return -1;
+ }
+ }
+};
+
+tree.True = new(tree.Keyword)('true');
+tree.False = new(tree.Keyword)('false');
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Media = function (value, features, index, currentFileInfo) {
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+
+ var selectors = this.emptySelectors();
+
+ this.features = new(tree.Value)(features);
+ this.rules = [new(tree.Ruleset)(selectors, value)];
+ this.rules[0].allowImports = true;
+};
+tree.Media.prototype = {
+ type: "Media",
+ accept: function (visitor) {
+ if (this.features) {
+ this.features = visitor.visit(this.features);
+ }
+ if (this.rules) {
+ this.rules = visitor.visitArray(this.rules);
+ }
+ },
+ genCSS: function (env, output) {
+ output.add('@media ', this.currentFileInfo, this.index);
+ this.features.genCSS(env, output);
+ tree.outputRuleset(env, output, this.rules);
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ if (!env.mediaBlocks) {
+ env.mediaBlocks = [];
+ env.mediaPath = [];
+ }
+
+ var media = new(tree.Media)(null, [], this.index, this.currentFileInfo);
+ if(this.debugInfo) {
+ this.rules[0].debugInfo = this.debugInfo;
+ media.debugInfo = this.debugInfo;
+ }
+ var strictMathBypass = false;
+ if (!env.strictMath) {
+ strictMathBypass = true;
+ env.strictMath = true;
+ }
+ try {
+ media.features = this.features.eval(env);
+ }
+ finally {
+ if (strictMathBypass) {
+ env.strictMath = false;
+ }
+ }
+
+ env.mediaPath.push(media);
+ env.mediaBlocks.push(media);
+
+ env.frames.unshift(this.rules[0]);
+ media.rules = [this.rules[0].eval(env)];
+ env.frames.shift();
+
+ env.mediaPath.pop();
+
+ return env.mediaPath.length === 0 ? media.evalTop(env) :
+ media.evalNested(env);
+ },
+ variable: function (name) { return tree.Ruleset.prototype.variable.call(this.rules[0], name); },
+ find: function () { return tree.Ruleset.prototype.find.apply(this.rules[0], arguments); },
+ rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.rules[0]); },
+ emptySelectors: function() {
+ var el = new(tree.Element)('', '&', this.index, this.currentFileInfo),
+ sels = [new(tree.Selector)([el], null, null, this.index, this.currentFileInfo)];
+ sels[0].mediaEmpty = true;
+ return sels;
+ },
+ markReferenced: function () {
+ var i, rules = this.rules[0].rules;
+ this.rules[0].markReferenced();
+ this.isReferenced = true;
+ for (i = 0; i < rules.length; i++) {
+ if (rules[i].markReferenced) {
+ rules[i].markReferenced();
+ }
+ }
+ },
+
+ evalTop: function (env) {
+ var result = this;
+
+ // Render all dependent Media blocks.
+ if (env.mediaBlocks.length > 1) {
+ var selectors = this.emptySelectors();
+ result = new(tree.Ruleset)(selectors, env.mediaBlocks);
+ result.multiMedia = true;
+ }
+
+ delete env.mediaBlocks;
+ delete env.mediaPath;
+
+ return result;
+ },
+ evalNested: function (env) {
+ var i, value,
+ path = env.mediaPath.concat([this]);
+
+ // Extract the media-query conditions separated with `,` (OR).
+ for (i = 0; i < path.length; i++) {
+ value = path[i].features instanceof tree.Value ?
+ path[i].features.value : path[i].features;
+ path[i] = Array.isArray(value) ? value : [value];
+ }
+
+ // Trace all permutations to generate the resulting media-query.
+ //
+ // (a, b and c) with nested (d, e) ->
+ // a and d
+ // a and e
+ // b and c and d
+ // b and c and e
+ this.features = new(tree.Value)(this.permute(path).map(function (path) {
+ path = path.map(function (fragment) {
+ return fragment.toCSS ? fragment : new(tree.Anonymous)(fragment);
+ });
+
+ for(i = path.length - 1; i > 0; i--) {
+ path.splice(i, 0, new(tree.Anonymous)("and"));
+ }
+
+ return new(tree.Expression)(path);
+ }));
+
+ // Fake a tree-node that doesn't output anything.
+ return new(tree.Ruleset)([], []);
+ },
+ permute: function (arr) {
+ if (arr.length === 0) {
+ return [];
+ } else if (arr.length === 1) {
+ return arr[0];
+ } else {
+ var result = [];
+ var rest = this.permute(arr.slice(1));
+ for (var i = 0; i < rest.length; i++) {
+ for (var j = 0; j < arr[0].length; j++) {
+ result.push([arr[0][j]].concat(rest[i]));
+ }
+ }
+ return result;
+ }
+ },
+ bubbleSelectors: function (selectors) {
+ if (!selectors)
+ return;
+ this.rules = [new(tree.Ruleset)(selectors.slice(0), [this.rules[0]])];
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.mixin = {};
+tree.mixin.Call = function (elements, args, index, currentFileInfo, important) {
+ this.selector = new(tree.Selector)(elements);
+ this.arguments = (args && args.length) ? args : null;
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+ this.important = important;
+};
+tree.mixin.Call.prototype = {
+ type: "MixinCall",
+ accept: function (visitor) {
+ if (this.selector) {
+ this.selector = visitor.visit(this.selector);
+ }
+ if (this.arguments) {
+ this.arguments = visitor.visitArray(this.arguments);
+ }
+ },
+ eval: function (env) {
+ var mixins, mixin, args, rules = [], match = false, i, m, f, isRecursive, isOneFound, rule,
+ candidates = [], candidate, conditionResult = [], defaultFunc = tree.defaultFunc,
+ defaultResult, defNone = 0, defTrue = 1, defFalse = 2, count;
+
+ args = this.arguments && this.arguments.map(function (a) {
+ return { name: a.name, value: a.value.eval(env) };
+ });
+
+ for (i = 0; i < env.frames.length; i++) {
+ if ((mixins = env.frames[i].find(this.selector)).length > 0) {
+ isOneFound = true;
+
+ // To make `default()` function independent of definition order we have two "subpasses" here.
+ // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),
+ // and build candidate list with corresponding flags. Then, when we know all possible matches,
+ // we make a final decision.
+
+ for (m = 0; m < mixins.length; m++) {
+ mixin = mixins[m];
+ isRecursive = false;
+ for(f = 0; f < env.frames.length; f++) {
+ if ((!(mixin instanceof tree.mixin.Definition)) && mixin === (env.frames[f].originalRuleset || env.frames[f])) {
+ isRecursive = true;
+ break;
+ }
+ }
+ if (isRecursive) {
+ continue;
+ }
+
+ if (mixin.matchArgs(args, env)) {
+ candidate = {mixin: mixin, group: defNone};
+
+ if (mixin.matchCondition) {
+ for (f = 0; f < 2; f++) {
+ defaultFunc.value(f);
+ conditionResult[f] = mixin.matchCondition(args, env);
+ }
+ if (conditionResult[0] || conditionResult[1]) {
+ if (conditionResult[0] != conditionResult[1]) {
+ candidate.group = conditionResult[1] ?
+ defTrue : defFalse;
+ }
+
+ candidates.push(candidate);
+ }
+ }
+ else {
+ candidates.push(candidate);
+ }
+
+ match = true;
+ }
+ }
+
+ defaultFunc.reset();
+
+ count = [0, 0, 0];
+ for (m = 0; m < candidates.length; m++) {
+ count[candidates[m].group]++;
+ }
+
+ if (count[defNone] > 0) {
+ defaultResult = defFalse;
+ } else {
+ defaultResult = defTrue;
+ if ((count[defTrue] + count[defFalse]) > 1) {
+ throw { type: 'Runtime',
+ message: 'Ambiguous use of `default()` found when matching for `'
+ + this.format(args) + '`',
+ index: this.index, filename: this.currentFileInfo.filename };
+ }
+ }
+
+ for (m = 0; m < candidates.length; m++) {
+ candidate = candidates[m].group;
+ if ((candidate === defNone) || (candidate === defaultResult)) {
+ try {
+ mixin = candidates[m].mixin;
+ if (!(mixin instanceof tree.mixin.Definition)) {
+ mixin = new tree.mixin.Definition("", [], mixin.rules, null, false);
+ mixin.originalRuleset = mixins[m].originalRuleset || mixins[m];
+ }
+ Array.prototype.push.apply(
+ rules, mixin.evalCall(env, args, this.important).rules);
+ } catch (e) {
+ throw { message: e.message, index: this.index, filename: this.currentFileInfo.filename, stack: e.stack };
+ }
+ }
+ }
+
+ if (match) {
+ if (!this.currentFileInfo || !this.currentFileInfo.reference) {
+ for (i = 0; i < rules.length; i++) {
+ rule = rules[i];
+ if (rule.markReferenced) {
+ rule.markReferenced();
+ }
+ }
+ }
+ return rules;
+ }
+ }
+ }
+ if (isOneFound) {
+ throw { type: 'Runtime',
+ message: 'No matching definition was found for `' + this.format(args) + '`',
+ index: this.index, filename: this.currentFileInfo.filename };
+ } else {
+ throw { type: 'Name',
+ message: this.selector.toCSS().trim() + " is undefined",
+ index: this.index, filename: this.currentFileInfo.filename };
+ }
+ },
+ format: function (args) {
+ return this.selector.toCSS().trim() + '(' +
+ (args ? args.map(function (a) {
+ var argValue = "";
+ if (a.name) {
+ argValue += a.name + ":";
+ }
+ if (a.value.toCSS) {
+ argValue += a.value.toCSS();
+ } else {
+ argValue += "???";
+ }
+ return argValue;
+ }).join(', ') : "") + ")";
+ }
+};
+
+tree.mixin.Definition = function (name, params, rules, condition, variadic, frames) {
+ this.name = name;
+ this.selectors = [new(tree.Selector)([new(tree.Element)(null, name, this.index, this.currentFileInfo)])];
+ this.params = params;
+ this.condition = condition;
+ this.variadic = variadic;
+ this.arity = params.length;
+ this.rules = rules;
+ this._lookups = {};
+ this.required = params.reduce(function (count, p) {
+ if (!p.name || (p.name && !p.value)) { return count + 1; }
+ else { return count; }
+ }, 0);
+ this.parent = tree.Ruleset.prototype;
+ this.frames = frames;
+};
+tree.mixin.Definition.prototype = {
+ type: "MixinDefinition",
+ accept: function (visitor) {
+ if (this.params && this.params.length) {
+ this.params = visitor.visitArray(this.params);
+ }
+ this.rules = visitor.visitArray(this.rules);
+ if (this.condition) {
+ this.condition = visitor.visit(this.condition);
+ }
+ },
+ variable: function (name) { return this.parent.variable.call(this, name); },
+ variables: function () { return this.parent.variables.call(this); },
+ find: function () { return this.parent.find.apply(this, arguments); },
+ rulesets: function () { return this.parent.rulesets.apply(this); },
+
+ evalParams: function (env, mixinEnv, args, evaldArguments) {
+ /*jshint boss:true */
+ var frame = new(tree.Ruleset)(null, null),
+ varargs, arg,
+ params = this.params.slice(0),
+ i, j, val, name, isNamedFound, argIndex, argsLength = 0;
+
+ mixinEnv = new tree.evalEnv(mixinEnv, [frame].concat(mixinEnv.frames));
+
+ if (args) {
+ args = args.slice(0);
+ argsLength = args.length;
+
+ for(i = 0; i < argsLength; i++) {
+ arg = args[i];
+ if (name = (arg && arg.name)) {
+ isNamedFound = false;
+ for(j = 0; j < params.length; j++) {
+ if (!evaldArguments[j] && name === params[j].name) {
+ evaldArguments[j] = arg.value.eval(env);
+ frame.prependRule(new(tree.Rule)(name, arg.value.eval(env)));
+ isNamedFound = true;
+ break;
+ }
+ }
+ if (isNamedFound) {
+ args.splice(i, 1);
+ i--;
+ continue;
+ } else {
+ throw { type: 'Runtime', message: "Named argument for " + this.name +
+ ' ' + args[i].name + ' not found' };
+ }
+ }
+ }
+ }
+ argIndex = 0;
+ for (i = 0; i < params.length; i++) {
+ if (evaldArguments[i]) { continue; }
+
+ arg = args && args[argIndex];
+
+ if (name = params[i].name) {
+ if (params[i].variadic) {
+ varargs = [];
+ for (j = argIndex; j < argsLength; j++) {
+ varargs.push(args[j].value.eval(env));
+ }
+ frame.prependRule(new(tree.Rule)(name, new(tree.Expression)(varargs).eval(env)));
+ } else {
+ val = arg && arg.value;
+ if (val) {
+ val = val.eval(env);
+ } else if (params[i].value) {
+ val = params[i].value.eval(mixinEnv);
+ frame.resetCache();
+ } else {
+ throw { type: 'Runtime', message: "wrong number of arguments for " + this.name +
+ ' (' + argsLength + ' for ' + this.arity + ')' };
+ }
+
+ frame.prependRule(new(tree.Rule)(name, val));
+ evaldArguments[i] = val;
+ }
+ }
+
+ if (params[i].variadic && args) {
+ for (j = argIndex; j < argsLength; j++) {
+ evaldArguments[j] = args[j].value.eval(env);
+ }
+ }
+ argIndex++;
+ }
+
+ return frame;
+ },
+ eval: function (env) {
+ return new tree.mixin.Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || env.frames.slice(0));
+ },
+ evalCall: function (env, args, important) {
+ var _arguments = [],
+ mixinFrames = this.frames ? this.frames.concat(env.frames) : env.frames,
+ frame = this.evalParams(env, new(tree.evalEnv)(env, mixinFrames), args, _arguments),
+ rules, ruleset;
+
+ frame.prependRule(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
+
+ rules = this.rules.slice(0);
+
+ ruleset = new(tree.Ruleset)(null, rules);
+ ruleset.originalRuleset = this;
+ ruleset = ruleset.eval(new(tree.evalEnv)(env, [this, frame].concat(mixinFrames)));
+ if (important) {
+ ruleset = this.parent.makeImportant.apply(ruleset);
+ }
+ return ruleset;
+ },
+ matchCondition: function (args, env) {
+ if (this.condition && !this.condition.eval(
+ new(tree.evalEnv)(env,
+ [this.evalParams(env, new(tree.evalEnv)(env, this.frames.concat(env.frames)), args, [])] // the parameter variables
+ .concat(this.frames) // the parent namespace/mixin frames
+ .concat(env.frames)))) { // the current environment frames
+ return false;
+ }
+ return true;
+ },
+ matchArgs: function (args, env) {
+ var argsLength = (args && args.length) || 0, len;
+
+ if (! this.variadic) {
+ if (argsLength < this.required) { return false; }
+ if (argsLength > this.params.length) { return false; }
+ } else {
+ if (argsLength < (this.required - 1)) { return false; }
+ }
+
+ len = Math.min(argsLength, this.arity);
+
+ for (var i = 0; i < len; i++) {
+ if (!this.params[i].name && !this.params[i].variadic) {
+ if (args[i].value.eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Negative = function (node) {
+ this.value = node;
+};
+tree.Negative.prototype = {
+ type: "Negative",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ genCSS: function (env, output) {
+ output.add('-');
+ this.value.genCSS(env, output);
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ if (env.isMathOn()) {
+ return (new(tree.Operation)('*', [new(tree.Dimension)(-1), this.value])).eval(env);
+ }
+ return new(tree.Negative)(this.value.eval(env));
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Operation = function (op, operands, isSpaced) {
+ this.op = op.trim();
+ this.operands = operands;
+ this.isSpaced = isSpaced;
+};
+tree.Operation.prototype = {
+ type: "Operation",
+ accept: function (visitor) {
+ this.operands = visitor.visit(this.operands);
+ },
+ eval: function (env) {
+ var a = this.operands[0].eval(env),
+ b = this.operands[1].eval(env);
+
+ if (env.isMathOn()) {
+ if (a instanceof tree.Dimension && b instanceof tree.Color) {
+ a = a.toColor();
+ }
+ if (b instanceof tree.Dimension && a instanceof tree.Color) {
+ b = b.toColor();
+ }
+ if (!a.operate) {
+ throw { type: "Operation",
+ message: "Operation on an invalid type" };
+ }
+
+ return a.operate(env, this.op, b);
+ } else {
+ return new(tree.Operation)(this.op, [a, b], this.isSpaced);
+ }
+ },
+ genCSS: function (env, output) {
+ this.operands[0].genCSS(env, output);
+ if (this.isSpaced) {
+ output.add(" ");
+ }
+ output.add(this.op);
+ if (this.isSpaced) {
+ output.add(" ");
+ }
+ this.operands[1].genCSS(env, output);
+ },
+ toCSS: tree.toCSS
+};
+
+tree.operate = function (env, op, a, b) {
+ switch (op) {
+ case '+': return a + b;
+ case '-': return a - b;
+ case '*': return a * b;
+ case '/': return a / b;
+ }
+};
+
+})(require('../tree'));
+
+
+(function (tree) {
+
+tree.Paren = function (node) {
+ this.value = node;
+};
+tree.Paren.prototype = {
+ type: "Paren",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ genCSS: function (env, output) {
+ output.add('(');
+ this.value.genCSS(env, output);
+ output.add(')');
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ return new(tree.Paren)(this.value.eval(env));
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Quoted = function (str, content, escaped, index, currentFileInfo) {
+ this.escaped = escaped;
+ this.value = content || '';
+ this.quote = str.charAt(0);
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+};
+tree.Quoted.prototype = {
+ type: "Quoted",
+ genCSS: function (env, output) {
+ if (!this.escaped) {
+ output.add(this.quote, this.currentFileInfo, this.index);
+ }
+ output.add(this.value);
+ if (!this.escaped) {
+ output.add(this.quote);
+ }
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ var that = this;
+ var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
+ return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
+ }).replace(/@\{([\w-]+)\}/g, function (_, name) {
+ var v = new(tree.Variable)('@' + name, that.index, that.currentFileInfo).eval(env, true);
+ return (v instanceof tree.Quoted) ? v.value : v.toCSS();
+ });
+ return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index, this.currentFileInfo);
+ },
+ compare: function (x) {
+ if (!x.toCSS) {
+ return -1;
+ }
+
+ var left = this.toCSS(),
+ right = x.toCSS();
+
+ if (left === right) {
+ return 0;
+ }
+
+ return left < right ? -1 : 1;
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Rule = function (name, value, important, merge, index, currentFileInfo, inline) {
+ this.name = name;
+ this.value = (value instanceof tree.Value || value instanceof tree.Ruleset) ? value : new(tree.Value)([value]);
+ this.important = important ? ' ' + important.trim() : '';
+ this.merge = merge;
+ this.index = index;
+ this.currentFileInfo = currentFileInfo;
+ this.inline = inline || false;
+ this.variable = name.charAt && (name.charAt(0) === '@');
+};
+
+tree.Rule.prototype = {
+ type: "Rule",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ genCSS: function (env, output) {
+ output.add(this.name + (env.compress ? ':' : ': '), this.currentFileInfo, this.index);
+ try {
+ this.value.genCSS(env, output);
+ }
+ catch(e) {
+ e.index = this.index;
+ e.filename = this.currentFileInfo.filename;
+ throw e;
+ }
+ output.add(this.important + ((this.inline || (env.lastRule && env.compress)) ? "" : ";"), this.currentFileInfo, this.index);
+ },
+ toCSS: tree.toCSS,
+ eval: function (env) {
+ var strictMathBypass = false, name = this.name, evaldValue;
+ if (typeof name !== "string") {
+ // expand 'primitive' name directly to get
+ // things faster (~10% for benchmark.less):
+ name = (name.length === 1)
+ && (name[0] instanceof tree.Keyword)
+ ? name[0].value : evalName(env, name);
+ }
+ if (name === "font" && !env.strictMath) {
+ strictMathBypass = true;
+ env.strictMath = true;
+ }
+ try {
+ evaldValue = this.value.eval(env);
+
+ if (!this.variable && evaldValue.type === "DetachedRuleset") {
+ throw { message: "Rulesets cannot be evaluated on a property.",
+ index: this.index, filename: this.currentFileInfo.filename };
+ }
+
+ return new(tree.Rule)(name,
+ evaldValue,
+ this.important,
+ this.merge,
+ this.index, this.currentFileInfo, this.inline);
+ }
+ catch(e) {
+ if (typeof e.index !== 'number') {
+ e.index = this.index;
+ e.filename = this.currentFileInfo.filename;
+ }
+ throw e;
+ }
+ finally {
+ if (strictMathBypass) {
+ env.strictMath = false;
+ }
+ }
+ },
+ makeImportant: function () {
+ return new(tree.Rule)(this.name,
+ this.value,
+ "!important",
+ this.merge,
+ this.index, this.currentFileInfo, this.inline);
+ }
+};
+
+function evalName(env, name) {
+ var value = "", i, n = name.length,
+ output = {add: function (s) {value += s;}};
+ for (i = 0; i < n; i++) {
+ name[i].eval(env).genCSS(env, output);
+ }
+ return value;
+}
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.RulesetCall = function (variable) {
+ this.variable = variable;
+};
+tree.RulesetCall.prototype = {
+ type: "RulesetCall",
+ accept: function (visitor) {
+ },
+ eval: function (env) {
+ var detachedRuleset = new(tree.Variable)(this.variable).eval(env);
+ return detachedRuleset.callEval(env);
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Ruleset = function (selectors, rules, strictImports) {
+ this.selectors = selectors;
+ this.rules = rules;
+ this._lookups = {};
+ this.strictImports = strictImports;
+};
+tree.Ruleset.prototype = {
+ type: "Ruleset",
+ accept: function (visitor) {
+ if (this.paths) {
+ visitor.visitArray(this.paths, true);
+ } else if (this.selectors) {
+ this.selectors = visitor.visitArray(this.selectors);
+ }
+ if (this.rules && this.rules.length) {
+ this.rules = visitor.visitArray(this.rules);
+ }
+ },
+ eval: function (env) {
+ var thisSelectors = this.selectors, selectors,
+ selCnt, selector, i, defaultFunc = tree.defaultFunc, hasOnePassingSelector = false;
+
+ if (thisSelectors && (selCnt = thisSelectors.length)) {
+ selectors = [];
+ defaultFunc.error({
+ type: "Syntax",
+ message: "it is currently only allowed in parametric mixin guards,"
+ });
+ for (i = 0; i < selCnt; i++) {
+ selector = thisSelectors[i].eval(env);
+ selectors.push(selector);
+ if (selector.evaldCondition) {
+ hasOnePassingSelector = true;
+ }
+ }
+ defaultFunc.reset();
+ } else {
+ hasOnePassingSelector = true;
+ }
+
+ var rules = this.rules ? this.rules.slice(0) : null,
+ ruleset = new(tree.Ruleset)(selectors, rules, this.strictImports),
+ rule, subRule;
+
+ ruleset.originalRuleset = this;
+ ruleset.root = this.root;
+ ruleset.firstRoot = this.firstRoot;
+ ruleset.allowImports = this.allowImports;
+
+ if(this.debugInfo) {
+ ruleset.debugInfo = this.debugInfo;
+ }
+
+ if (!hasOnePassingSelector) {
+ rules.length = 0;
+ }
+
+ // push the current ruleset to the frames stack
+ var envFrames = env.frames;
+ envFrames.unshift(ruleset);
+
+ // currrent selectors
+ var envSelectors = env.selectors;
+ if (!envSelectors) {
+ env.selectors = envSelectors = [];
+ }
+ envSelectors.unshift(this.selectors);
+
+ // Evaluate imports
+ if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {
+ ruleset.evalImports(env);
+ }
+
+ // Store the frames around mixin definitions,
+ // so they can be evaluated like closures when the time comes.
+ var rsRules = ruleset.rules, rsRuleCnt = rsRules ? rsRules.length : 0;
+ for (i = 0; i < rsRuleCnt; i++) {
+ if (rsRules[i] instanceof tree.mixin.Definition || rsRules[i] instanceof tree.DetachedRuleset) {
+ rsRules[i] = rsRules[i].eval(env);
+ }
+ }
+
+ var mediaBlockCount = (env.mediaBlocks && env.mediaBlocks.length) || 0;
+
+ // Evaluate mixin calls.
+ for (i = 0; i < rsRuleCnt; i++) {
+ if (rsRules[i] instanceof tree.mixin.Call) {
+ /*jshint loopfunc:true */
+ rules = rsRules[i].eval(env).filter(function(r) {
+ if ((r instanceof tree.Rule) && r.variable) {
+ // do not pollute the scope if the variable is
+ // already there. consider returning false here
+ // but we need a way to "return" variable from mixins
+ return !(ruleset.variable(r.name));
+ }
+ return true;
+ });
+ rsRules.splice.apply(rsRules, [i, 1].concat(rules));
+ rsRuleCnt += rules.length - 1;
+ i += rules.length-1;
+ ruleset.resetCache();
+ } else if (rsRules[i] instanceof tree.RulesetCall) {
+ /*jshint loopfunc:true */
+ rules = rsRules[i].eval(env).rules.filter(function(r) {
+ if ((r instanceof tree.Rule) && r.variable) {
+ // do not pollute the scope at all
+ return false;
+ }
+ return true;
+ });
+ rsRules.splice.apply(rsRules, [i, 1].concat(rules));
+ rsRuleCnt += rules.length - 1;
+ i += rules.length-1;
+ ruleset.resetCache();
+ }
+ }
+
+ // Evaluate everything else
+ for (i = 0; i < rsRules.length; i++) {
+ rule = rsRules[i];
+ if (! (rule instanceof tree.mixin.Definition || rule instanceof tree.DetachedRuleset)) {
+ rsRules[i] = rule = rule.eval ? rule.eval(env) : rule;
+ }
+ }
+
+ // Evaluate everything else
+ for (i = 0; i < rsRules.length; i++) {
+ rule = rsRules[i];
+ // for rulesets, check if it is a css guard and can be removed
+ if (rule instanceof tree.Ruleset && rule.selectors && rule.selectors.length === 1) {
+ // check if it can be folded in (e.g. & where)
+ if (rule.selectors[0].isJustParentSelector()) {
+ rsRules.splice(i--, 1);
+
+ for(var j = 0; j < rule.rules.length; j++) {
+ subRule = rule.rules[j];
+ if (!(subRule instanceof tree.Rule) || !subRule.variable) {
+ rsRules.splice(++i, 0, subRule);
+ }
+ }
+ }
+ }
+ }
+
+ // Pop the stack
+ envFrames.shift();
+ envSelectors.shift();
+
+ if (env.mediaBlocks) {
+ for (i = mediaBlockCount; i < env.mediaBlocks.length; i++) {
+ env.mediaBlocks[i].bubbleSelectors(selectors);
+ }
+ }
+
+ return ruleset;
+ },
+ evalImports: function(env) {
+ var rules = this.rules, i, importRules;
+ if (!rules) { return; }
+
+ for (i = 0; i < rules.length; i++) {
+ if (rules[i] instanceof tree.Import) {
+ importRules = rules[i].eval(env);
+ if (importRules && importRules.length) {
+ rules.splice.apply(rules, [i, 1].concat(importRules));
+ i+= importRules.length-1;
+ } else {
+ rules.splice(i, 1, importRules);
+ }
+ this.resetCache();
+ }
+ }
+ },
+ makeImportant: function() {
+ return new tree.Ruleset(this.selectors, this.rules.map(function (r) {
+ if (r.makeImportant) {
+ return r.makeImportant();
+ } else {
+ return r;
+ }
+ }), this.strictImports);
+ },
+ matchArgs: function (args) {
+ return !args || args.length === 0;
+ },
+ // lets you call a css selector with a guard
+ matchCondition: function (args, env) {
+ var lastSelector = this.selectors[this.selectors.length-1];
+ if (!lastSelector.evaldCondition) {
+ return false;
+ }
+ if (lastSelector.condition &&
+ !lastSelector.condition.eval(
+ new(tree.evalEnv)(env,
+ env.frames))) {
+ return false;
+ }
+ return true;
+ },
+ resetCache: function () {
+ this._rulesets = null;
+ this._variables = null;
+ this._lookups = {};
+ },
+ variables: function () {
+ if (!this._variables) {
+ this._variables = !this.rules ? {} : this.rules.reduce(function (hash, r) {
+ if (r instanceof tree.Rule && r.variable === true) {
+ hash[r.name] = r;
+ }
+ return hash;
+ }, {});
+ }
+ return this._variables;
+ },
+ variable: function (name) {
+ return this.variables()[name];
+ },
+ rulesets: function () {
+ if (!this.rules) { return null; }
+
+ var _Ruleset = tree.Ruleset, _MixinDefinition = tree.mixin.Definition,
+ filtRules = [], rules = this.rules, cnt = rules.length,
+ i, rule;
+
+ for (i = 0; i < cnt; i++) {
+ rule = rules[i];
+ if ((rule instanceof _Ruleset) || (rule instanceof _MixinDefinition)) {
+ filtRules.push(rule);
+ }
+ }
+
+ return filtRules;
+ },
+ prependRule: function (rule) {
+ var rules = this.rules;
+ if (rules) { rules.unshift(rule); } else { this.rules = [ rule ]; }
+ },
+ find: function (selector, self) {
+ self = self || this;
+ var rules = [], match,
+ key = selector.toCSS();
+
+ if (key in this._lookups) { return this._lookups[key]; }
+
+ this.rulesets().forEach(function (rule) {
+ if (rule !== self) {
+ for (var j = 0; j < rule.selectors.length; j++) {
+ match = selector.match(rule.selectors[j]);
+ if (match) {
+ if (selector.elements.length > match) {
+ Array.prototype.push.apply(rules, rule.find(
+ new(tree.Selector)(selector.elements.slice(match)), self));
+ } else {
+ rules.push(rule);
+ }
+ break;
+ }
+ }
+ }
+ });
+ this._lookups[key] = rules;
+ return rules;
+ },
+ genCSS: function (env, output) {
+ var i, j,
+ ruleNodes = [],
+ rulesetNodes = [],
+ rulesetNodeCnt,
+ debugInfo, // Line number debugging
+ rule,
+ path;
+
+ env.tabLevel = (env.tabLevel || 0);
+
+ if (!this.root) {
+ env.tabLevel++;
+ }
+
+ var tabRuleStr = env.compress ? '' : Array(env.tabLevel + 1).join(" "),
+ tabSetStr = env.compress ? '' : Array(env.tabLevel).join(" "),
+ sep;
+
+ for (i = 0; i < this.rules.length; i++) {
+ rule = this.rules[i];
+ if (rule.rules || (rule instanceof tree.Media) || rule instanceof tree.Directive || (this.root && rule instanceof tree.Comment)) {
+ rulesetNodes.push(rule);
+ } else {
+ ruleNodes.push(rule);
+ }
+ }
+
+ // If this is the root node, we don't render
+ // a selector, or {}.
+ if (!this.root) {
+ debugInfo = tree.debugInfo(env, this, tabSetStr);
+
+ if (debugInfo) {
+ output.add(debugInfo);
+ output.add(tabSetStr);
+ }
+
+ var paths = this.paths, pathCnt = paths.length,
+ pathSubCnt;
+
+ sep = env.compress ? ',' : (',\n' + tabSetStr);
+
+ for (i = 0; i < pathCnt; i++) {
+ path = paths[i];
+ if (!(pathSubCnt = path.length)) { continue; }
+ if (i > 0) { output.add(sep); }
+
+ env.firstSelector = true;
+ path[0].genCSS(env, output);
+
+ env.firstSelector = false;
+ for (j = 1; j < pathSubCnt; j++) {
+ path[j].genCSS(env, output);
+ }
+ }
+
+ output.add((env.compress ? '{' : ' {\n') + tabRuleStr);
+ }
+
+ // Compile rules and rulesets
+ for (i = 0; i < ruleNodes.length; i++) {
+ rule = ruleNodes[i];
+
+ // @page{ directive ends up with root elements inside it, a mix of rules and rulesets
+ // In this instance we do not know whether it is the last property
+ if (i + 1 === ruleNodes.length && (!this.root || rulesetNodes.length === 0 || this.firstRoot)) {
+ env.lastRule = true;
+ }
+
+ if (rule.genCSS) {
+ rule.genCSS(env, output);
+ } else if (rule.value) {
+ output.add(rule.value.toString());
+ }
+
+ if (!env.lastRule) {
+ output.add(env.compress ? '' : ('\n' + tabRuleStr));
+ } else {
+ env.lastRule = false;
+ }
+ }
+
+ if (!this.root) {
+ output.add((env.compress ? '}' : '\n' + tabSetStr + '}'));
+ env.tabLevel--;
+ }
+
+ sep = (env.compress ? "" : "\n") + (this.root ? tabRuleStr : tabSetStr);
+ rulesetNodeCnt = rulesetNodes.length;
+ if (rulesetNodeCnt) {
+ if (ruleNodes.length && sep) { output.add(sep); }
+ rulesetNodes[0].genCSS(env, output);
+ for (i = 1; i < rulesetNodeCnt; i++) {
+ if (sep) { output.add(sep); }
+ rulesetNodes[i].genCSS(env, output);
+ }
+ }
+
+ if (!output.isEmpty() && !env.compress && this.firstRoot) {
+ output.add('\n');
+ }
+ },
+
+ toCSS: tree.toCSS,
+
+ markReferenced: function () {
+ if (!this.selectors) {
+ return;
+ }
+ for (var s = 0; s < this.selectors.length; s++) {
+ this.selectors[s].markReferenced();
+ }
+ },
+
+ joinSelectors: function (paths, context, selectors) {
+ for (var s = 0; s < selectors.length; s++) {
+ this.joinSelector(paths, context, selectors[s]);
+ }
+ },
+
+ joinSelector: function (paths, context, selector) {
+
+ var i, j, k,
+ hasParentSelector, newSelectors, el, sel, parentSel,
+ newSelectorPath, afterParentJoin, newJoinedSelector,
+ newJoinedSelectorEmpty, lastSelector, currentElements,
+ selectorsMultiplied;
+
+ for (i = 0; i < selector.elements.length; i++) {
+ el = selector.elements[i];
+ if (el.value === '&') {
+ hasParentSelector = true;
+ }
+ }
+
+ if (!hasParentSelector) {
+ if (context.length > 0) {
+ for (i = 0; i < context.length; i++) {
+ paths.push(context[i].concat(selector));
+ }
+ }
+ else {
+ paths.push([selector]);
+ }
+ return;
+ }
+
+ // The paths are [[Selector]]
+ // The first list is a list of comma seperated selectors
+ // The inner list is a list of inheritance seperated selectors
+ // e.g.
+ // .a, .b {
+ // .c {
+ // }
+ // }
+ // == [[.a] [.c]] [[.b] [.c]]
+ //
+
+ // the elements from the current selector so far
+ currentElements = [];
+ // the current list of new selectors to add to the path.
+ // We will build it up. We initiate it with one empty selector as we "multiply" the new selectors
+ // by the parents
+ newSelectors = [[]];
+
+ for (i = 0; i < selector.elements.length; i++) {
+ el = selector.elements[i];
+ // non parent reference elements just get added
+ if (el.value !== "&") {
+ currentElements.push(el);
+ } else {
+ // the new list of selectors to add
+ selectorsMultiplied = [];
+
+ // merge the current list of non parent selector elements
+ // on to the current list of selectors to add
+ if (currentElements.length > 0) {
+ this.mergeElementsOnToSelectors(currentElements, newSelectors);
+ }
+
+ // loop through our current selectors
+ for (j = 0; j < newSelectors.length; j++) {
+ sel = newSelectors[j];
+ // if we don't have any parent paths, the & might be in a mixin so that it can be used
+ // whether there are parents or not
+ if (context.length === 0) {
+ // the combinator used on el should now be applied to the next element instead so that
+ // it is not lost
+ if (sel.length > 0) {
+ sel[0].elements = sel[0].elements.slice(0);
+ sel[0].elements.push(new(tree.Element)(el.combinator, '', el.index, el.currentFileInfo));
+ }
+ selectorsMultiplied.push(sel);
+ }
+ else {
+ // and the parent selectors
+ for (k = 0; k < context.length; k++) {
+ parentSel = context[k];
+ // We need to put the current selectors
+ // then join the last selector's elements on to the parents selectors
+
+ // our new selector path
+ newSelectorPath = [];
+ // selectors from the parent after the join
+ afterParentJoin = [];
+ newJoinedSelectorEmpty = true;
+
+ //construct the joined selector - if & is the first thing this will be empty,
+ // if not newJoinedSelector will be the last set of elements in the selector
+ if (sel.length > 0) {
+ newSelectorPath = sel.slice(0);
+ lastSelector = newSelectorPath.pop();
+ newJoinedSelector = selector.createDerived(lastSelector.elements.slice(0));
+ newJoinedSelectorEmpty = false;
+ }
+ else {
+ newJoinedSelector = selector.createDerived([]);
+ }
+
+ //put together the parent selectors after the join
+ if (parentSel.length > 1) {
+ afterParentJoin = afterParentJoin.concat(parentSel.slice(1));
+ }
+
+ if (parentSel.length > 0) {
+ newJoinedSelectorEmpty = false;
+
+ // join the elements so far with the first part of the parent
+ newJoinedSelector.elements.push(new(tree.Element)(el.combinator, parentSel[0].elements[0].value, el.index, el.currentFileInfo));
+ newJoinedSelector.elements = newJoinedSelector.elements.concat(parentSel[0].elements.slice(1));
+ }
+
+ if (!newJoinedSelectorEmpty) {
+ // now add the joined selector
+ newSelectorPath.push(newJoinedSelector);
+ }
+
+ // and the rest of the parent
+ newSelectorPath = newSelectorPath.concat(afterParentJoin);
+
+ // add that to our new set of selectors
+ selectorsMultiplied.push(newSelectorPath);
+ }
+ }
+ }
+
+ // our new selectors has been multiplied, so reset the state
+ newSelectors = selectorsMultiplied;
+ currentElements = [];
+ }
+ }
+
+ // if we have any elements left over (e.g. .a& .b == .b)
+ // add them on to all the current selectors
+ if (currentElements.length > 0) {
+ this.mergeElementsOnToSelectors(currentElements, newSelectors);
+ }
+
+ for (i = 0; i < newSelectors.length; i++) {
+ if (newSelectors[i].length > 0) {
+ paths.push(newSelectors[i]);
+ }
+ }
+ },
+
+ mergeElementsOnToSelectors: function(elements, selectors) {
+ var i, sel;
+
+ if (selectors.length === 0) {
+ selectors.push([ new(tree.Selector)(elements) ]);
+ return;
+ }
+
+ for (i = 0; i < selectors.length; i++) {
+ sel = selectors[i];
+
+ // if the previous thing in sel is a parent this needs to join on to it
+ if (sel.length > 0) {
+ sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));
+ }
+ else {
+ sel.push(new(tree.Selector)(elements));
+ }
+ }
+ }
+};
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Selector = function (elements, extendList, condition, index, currentFileInfo, isReferenced) {
+ this.elements = elements;
+ this.extendList = extendList;
+ this.condition = condition;
+ this.currentFileInfo = currentFileInfo || {};
+ this.isReferenced = isReferenced;
+ if (!condition) {
+ this.evaldCondition = true;
+ }
+};
+tree.Selector.prototype = {
+ type: "Selector",
+ accept: function (visitor) {
+ if (this.elements) {
+ this.elements = visitor.visitArray(this.elements);
+ }
+ if (this.extendList) {
+ this.extendList = visitor.visitArray(this.extendList);
+ }
+ if (this.condition) {
+ this.condition = visitor.visit(this.condition);
+ }
+ },
+ createDerived: function(elements, extendList, evaldCondition) {
+ evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition;
+ var newSelector = new(tree.Selector)(elements, extendList || this.extendList, null, this.index, this.currentFileInfo, this.isReferenced);
+ newSelector.evaldCondition = evaldCondition;
+ newSelector.mediaEmpty = this.mediaEmpty;
+ return newSelector;
+ },
+ match: function (other) {
+ var elements = this.elements,
+ len = elements.length,
+ olen, i;
+
+ other.CacheElements();
+
+ olen = other._elements.length;
+ if (olen === 0 || len < olen) {
+ return 0;
+ } else {
+ for (i = 0; i < olen; i++) {
+ if (elements[i].value !== other._elements[i]) {
+ return 0;
+ }
+ }
+ }
+
+ return olen; // return number of matched elements
+ },
+ CacheElements: function(){
+ var css = '', len, v, i;
+
+ if( !this._elements ){
+
+ len = this.elements.length;
+ for(i = 0; i < len; i++){
+
+ v = this.elements[i];
+ css += v.combinator.value;
+
+ if( !v.value.value ){
+ css += v.value;
+ continue;
+ }
+
+ if( typeof v.value.value !== "string" ){
+ css = '';
+ break;
+ }
+ css += v.value.value;
+ }
+
+ this._elements = css.match(/[,&#\.\w-]([\w-]|(\\.))*/g);
+
+ if (this._elements) {
+ if (this._elements[0] === "&") {
+ this._elements.shift();
+ }
+
+ } else {
+ this._elements = [];
+ }
+
+ }
+ },
+ isJustParentSelector: function() {
+ return !this.mediaEmpty &&
+ this.elements.length === 1 &&
+ this.elements[0].value === '&' &&
+ (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');
+ },
+ eval: function (env) {
+ var evaldCondition = this.condition && this.condition.eval(env),
+ elements = this.elements, extendList = this.extendList;
+
+ elements = elements && elements.map(function (e) { return e.eval(env); });
+ extendList = extendList && extendList.map(function(extend) { return extend.eval(env); });
+
+ return this.createDerived(elements, extendList, evaldCondition);
+ },
+ genCSS: function (env, output) {
+ var i, element;
+ if ((!env || !env.firstSelector) && this.elements[0].combinator.value === "") {
+ output.add(' ', this.currentFileInfo, this.index);
+ }
+ if (!this._css) {
+ //TODO caching? speed comparison?
+ for(i = 0; i < this.elements.length; i++) {
+ element = this.elements[i];
+ element.genCSS(env, output);
+ }
+ }
+ },
+ toCSS: tree.toCSS,
+ markReferenced: function () {
+ this.isReferenced = true;
+ },
+ getIsReferenced: function() {
+ return !this.currentFileInfo.reference || this.isReferenced;
+ },
+ getIsOutput: function() {
+ return this.evaldCondition;
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.UnicodeDescriptor = function (value) {
+ this.value = value;
+};
+tree.UnicodeDescriptor.prototype = {
+ type: "UnicodeDescriptor",
+ genCSS: function (env, output) {
+ output.add(this.value);
+ },
+ toCSS: tree.toCSS,
+ eval: function () { return this; }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.URL = function (val, currentFileInfo, isEvald) {
+ this.value = val;
+ this.currentFileInfo = currentFileInfo;
+ this.isEvald = isEvald;
+};
+tree.URL.prototype = {
+ type: "Url",
+ accept: function (visitor) {
+ this.value = visitor.visit(this.value);
+ },
+ genCSS: function (env, output) {
+ output.add("url(");
+ this.value.genCSS(env, output);
+ output.add(")");
+ },
+ toCSS: tree.toCSS,
+ eval: function (ctx) {
+ var val = this.value.eval(ctx),
+ rootpath;
+
+ if (!this.isEvald) {
+ // Add the base path if the URL is relative
+ rootpath = this.currentFileInfo && this.currentFileInfo.rootpath;
+ if (rootpath && typeof val.value === "string" && ctx.isPathRelative(val.value)) {
+ if (!val.quote) {
+ rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return "\\"+match; });
+ }
+ val.value = rootpath + val.value;
+ }
+
+ val.value = ctx.normalizePath(val.value);
+
+ // Add url args if enabled
+ if (ctx.urlArgs) {
+ if (!val.value.match(/^\s*data:/)) {
+ var delimiter = val.value.indexOf('?') === -1 ? '?' : '&';
+ var urlArgs = delimiter + ctx.urlArgs;
+ if (val.value.indexOf('#') !== -1) {
+ val.value = val.value.replace('#', urlArgs + '#');
+ } else {
+ val.value += urlArgs;
+ }
+ }
+ }
+ }
+
+ return new(tree.URL)(val, this.currentFileInfo, true);
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Value = function (value) {
+ this.value = value;
+};
+tree.Value.prototype = {
+ type: "Value",
+ accept: function (visitor) {
+ if (this.value) {
+ this.value = visitor.visitArray(this.value);
+ }
+ },
+ eval: function (env) {
+ if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return new(tree.Value)(this.value.map(function (v) {
+ return v.eval(env);
+ }));
+ }
+ },
+ genCSS: function (env, output) {
+ var i;
+ for(i = 0; i < this.value.length; i++) {
+ this.value[i].genCSS(env, output);
+ if (i+1 < this.value.length) {
+ output.add((env && env.compress) ? ',' : ', ');
+ }
+ }
+ },
+ toCSS: tree.toCSS
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+tree.Variable = function (name, index, currentFileInfo) {
+ this.name = name;
+ this.index = index;
+ this.currentFileInfo = currentFileInfo || {};
+};
+tree.Variable.prototype = {
+ type: "Variable",
+ eval: function (env) {
+ var variable, name = this.name;
+
+ if (name.indexOf('@@') === 0) {
+ name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
+ }
+
+ if (this.evaluating) {
+ throw { type: 'Name',
+ message: "Recursive variable definition for " + name,
+ filename: this.currentFileInfo.file,
+ index: this.index };
+ }
+
+ this.evaluating = true;
+
+ variable = tree.find(env.frames, function (frame) {
+ var v = frame.variable(name);
+ if (v) {
+ return v.value.eval(env);
+ }
+ });
+ if (variable) {
+ this.evaluating = false;
+ return variable;
+ } else {
+ throw { type: 'Name',
+ message: "variable " + name + " is undefined",
+ filename: this.currentFileInfo.filename,
+ index: this.index };
+ }
+ }
+};
+
+})(require('../tree'));
+
+(function (tree) {
+
+ var parseCopyProperties = [
+ 'paths', // option - unmodified - paths to search for imports on
+ 'optimization', // option - optimization level (for the chunker)
+ 'files', // list of files that have been imported, used for import-once
+ 'contents', // map - filename to contents of all the files
+ 'contentsIgnoredChars', // map - filename to lines at the begining of each file to ignore
+ 'relativeUrls', // option - whether to adjust URL's to be relative
+ 'rootpath', // option - rootpath to append to URL's
+ 'strictImports', // option -
+ 'insecure', // option - whether to allow imports from insecure ssl hosts
+ 'dumpLineNumbers', // option - whether to dump line numbers
+ 'compress', // option - whether to compress
+ 'processImports', // option - whether to process imports. if false then imports will not be imported
+ 'syncImport', // option - whether to import synchronously
+ 'javascriptEnabled',// option - whether JavaScript is enabled. if undefined, defaults to true
+ 'mime', // browser only - mime type for sheet import
+ 'useFileCache', // browser only - whether to use the per file session cache
+ 'currentFileInfo' // information about the current file - for error reporting and importing and making urls relative etc.
+ ];
+
+ //currentFileInfo = {
+ // 'relativeUrls' - option - whether to adjust URL's to be relative
+ // 'filename' - full resolved filename of current file
+ // 'rootpath' - path to append to normal URLs for this node
+ // 'currentDirectory' - path to the current file, absolute
+ // 'rootFilename' - filename of the base file
+ // 'entryPath' - absolute path to the entry file
+ // 'reference' - whether the file should not be output and only output parts that are referenced
+
+ tree.parseEnv = function(options) {
+ copyFromOriginal(options, this, parseCopyProperties);
+
+ if (!this.contents) { this.contents = {}; }
+ if (!this.contentsIgnoredChars) { this.contentsIgnoredChars = {}; }
+ if (!this.files) { this.files = {}; }
+
+ if (!this.currentFileInfo) {
+ var filename = (options && options.filename) || "input";
+ var entryPath = filename.replace(/[^\/\\]*$/, "");
+ if (options) {
+ options.filename = null;
+ }
+ this.currentFileInfo = {
+ filename: filename,
+ relativeUrls: this.relativeUrls,
+ rootpath: (options && options.rootpath) || "",
+ currentDirectory: entryPath,
+ entryPath: entryPath,
+ rootFilename: filename
+ };
+ }
+ };
+
+ var evalCopyProperties = [
+ 'silent', // whether to swallow errors and warnings
+ 'verbose', // whether to log more activity
+ 'compress', // whether to compress
+ 'yuicompress', // whether to compress with the outside tool yui compressor
+ 'ieCompat', // whether to enforce IE compatibility (IE8 data-uri)
+ 'strictMath', // whether math has to be within parenthesis
+ 'strictUnits', // whether units need to evaluate correctly
+ 'cleancss', // whether to compress with clean-css
+ 'sourceMap', // whether to output a source map
+ 'importMultiple', // whether we are currently importing multiple copies
+ 'urlArgs' // whether to add args into url tokens
+ ];
+
+ tree.evalEnv = function(options, frames) {
+ copyFromOriginal(options, this, evalCopyProperties);
+
+ this.frames = frames || [];
+ };
+
+ tree.evalEnv.prototype.inParenthesis = function () {
+ if (!this.parensStack) {
+ this.parensStack = [];
+ }
+ this.parensStack.push(true);
+ };
+
+ tree.evalEnv.prototype.outOfParenthesis = function () {
+ this.parensStack.pop();
+ };
+
+ tree.evalEnv.prototype.isMathOn = function () {
+ return this.strictMath ? (this.parensStack && this.parensStack.length) : true;
+ };
+
+ tree.evalEnv.prototype.isPathRelative = function (path) {
+ return !/^(?:[a-z-]+:|\/)/.test(path);
+ };
+
+ tree.evalEnv.prototype.normalizePath = function( path ) {
+ var
+ segments = path.split("/").reverse(),
+ segment;
+
+ path = [];
+ while (segments.length !== 0 ) {
+ segment = segments.pop();
+ switch( segment ) {
+ case ".":
+ break;
+ case "..":
+ if ((path.length === 0) || (path[path.length - 1] === "..")) {
+ path.push( segment );
+ } else {
+ path.pop();
+ }
+ break;
+ default:
+ path.push( segment );
+ break;
+ }
+ }
+
+ return path.join("/");
+ };
+
+ //todo - do the same for the toCSS env
+ //tree.toCSSEnv = function (options) {
+ //};
+
+ var copyFromOriginal = function(original, destination, propertiesToCopy) {
+ if (!original) { return; }
+
+ for(var i = 0; i < propertiesToCopy.length; i++) {
+ if (original.hasOwnProperty(propertiesToCopy[i])) {
+ destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];
+ }
+ }
+ };
+
+})(require('./tree'));
+
+(function (tree) {
+
+ var _visitArgs = { visitDeeper: true },
+ _hasIndexed = false;
+
+ function _noop(node) {
+ return node;
+ }
+
+ function indexNodeTypes(parent, ticker) {
+ // add .typeIndex to tree node types for lookup table
+ var key, child;
+ for (key in parent) {
+ if (parent.hasOwnProperty(key)) {
+ child = parent[key];
+ switch (typeof child) {
+ case "function":
+ // ignore bound functions directly on tree which do not have a prototype
+ // or aren't nodes
+ if (child.prototype && child.prototype.type) {
+ child.prototype.typeIndex = ticker++;
+ }
+ break;
+ case "object":
+ ticker = indexNodeTypes(child, ticker);
+ break;
+ }
+ }
+ }
+ return ticker;
+ }
+
+ tree.visitor = function(implementation) {
+ this._implementation = implementation;
+ this._visitFnCache = [];
+
+ if (!_hasIndexed) {
+ indexNodeTypes(tree, 1);
+ _hasIndexed = true;
+ }
+ };
+
+ tree.visitor.prototype = {
+ visit: function(node) {
+ if (!node) {
+ return node;
+ }
+
+ var nodeTypeIndex = node.typeIndex;
+ if (!nodeTypeIndex) {
+ return node;
+ }
+
+ var visitFnCache = this._visitFnCache,
+ impl = this._implementation,
+ aryIndx = nodeTypeIndex << 1,
+ outAryIndex = aryIndx | 1,
+ func = visitFnCache[aryIndx],
+ funcOut = visitFnCache[outAryIndex],
+ visitArgs = _visitArgs,
+ fnName;
+
+ visitArgs.visitDeeper = true;
+
+ if (!func) {
+ fnName = "visit" + node.type;
+ func = impl[fnName] || _noop;
+ funcOut = impl[fnName + "Out"] || _noop;
+ visitFnCache[aryIndx] = func;
+ visitFnCache[outAryIndex] = funcOut;
+ }
+
+ if (func !== _noop) {
+ var newNode = func.call(impl, node, visitArgs);
+ if (impl.isReplacing) {
+ node = newNode;
+ }
+ }
+
+ if (visitArgs.visitDeeper && node && node.accept) {
+ node.accept(this);
+ }
+
+ if (funcOut != _noop) {
+ funcOut.call(impl, node);
+ }
+
+ return node;
+ },
+ visitArray: function(nodes, nonReplacing) {
+ if (!nodes) {
+ return nodes;
+ }
+
+ var cnt = nodes.length, i;
+
+ // Non-replacing
+ if (nonReplacing || !this._implementation.isReplacing) {
+ for (i = 0; i < cnt; i++) {
+ this.visit(nodes[i]);
+ }
+ return nodes;
+ }
+
+ // Replacing
+ var out = [];
+ for (i = 0; i < cnt; i++) {
+ var evald = this.visit(nodes[i]);
+ if (!evald.splice) {
+ out.push(evald);
+ } else if (evald.length) {
+ this.flatten(evald, out);
+ }
+ }
+ return out;
+ },
+ flatten: function(arr, out) {
+ if (!out) {
+ out = [];
+ }
+
+ var cnt, i, item,
+ nestedCnt, j, nestedItem;
+
+ for (i = 0, cnt = arr.length; i < cnt; i++) {
+ item = arr[i];
+ if (!item.splice) {
+ out.push(item);
+ continue;
+ }
+
+ for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {
+ nestedItem = item[j];
+ if (!nestedItem.splice) {
+ out.push(nestedItem);
+ } else if (nestedItem.length) {
+ this.flatten(nestedItem, out);
+ }
+ }
+ }
+
+ return out;
+ }
+ };
+
+})(require('./tree'));
+(function (tree) {
+ tree.importVisitor = function(importer, finish, evalEnv, onceFileDetectionMap, recursionDetector) {
+ this._visitor = new tree.visitor(this);
+ this._importer = importer;
+ this._finish = finish;
+ this.env = evalEnv || new tree.evalEnv();
+ this.importCount = 0;
+ this.onceFileDetectionMap = onceFileDetectionMap || {};
+ this.recursionDetector = {};
+ if (recursionDetector) {
+ for(var fullFilename in recursionDetector) {
+ if (recursionDetector.hasOwnProperty(fullFilename)) {
+ this.recursionDetector[fullFilename] = true;
+ }
+ }
+ }
+ };
+
+ tree.importVisitor.prototype = {
+ isReplacing: true,
+ run: function (root) {
+ var error;
+ try {
+ // process the contents
+ this._visitor.visit(root);
+ }
+ catch(e) {
+ error = e;
+ }
+
+ this.isFinished = true;
+
+ if (this.importCount === 0) {
+ this._finish(error);
+ }
+ },
+ visitImport: function (importNode, visitArgs) {
+ var importVisitor = this,
+ evaldImportNode,
+ inlineCSS = importNode.options.inline;
+
+ if (!importNode.css || inlineCSS) {
+
+ try {
+ evaldImportNode = importNode.evalForImport(this.env);
+ } catch(e){
+ if (!e.filename) { e.index = importNode.index; e.filename = importNode.currentFileInfo.filename; }
+ // attempt to eval properly and treat as css
+ importNode.css = true;
+ // if that fails, this error will be thrown
+ importNode.error = e;
+ }
+
+ if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {
+ importNode = evaldImportNode;
+ this.importCount++;
+ var env = new tree.evalEnv(this.env, this.env.frames.slice(0));
+
+ if (importNode.options.multiple) {
+ env.importMultiple = true;
+ }
+
+ this._importer.push(importNode.getPath(), importNode.currentFileInfo, importNode.options, function (e, root, importedAtRoot, fullPath) {
+ if (e && !e.filename) { e.index = importNode.index; e.filename = importNode.currentFileInfo.filename; }
+
+ if (!env.importMultiple) {
+ if (importedAtRoot) {
+ importNode.skip = true;
+ } else {
+ importNode.skip = function() {
+ if (fullPath in importVisitor.onceFileDetectionMap) {
+ return true;
+ }
+ importVisitor.onceFileDetectionMap[fullPath] = true;
+ return false;
+ };
+ }
+ }
+
+ var subFinish = function(e) {
+ importVisitor.importCount--;
+
+ if (importVisitor.importCount === 0 && importVisitor.isFinished) {
+ importVisitor._finish(e);
+ }
+ };
+
+ if (root) {
+ importNode.root = root;
+ importNode.importedFilename = fullPath;
+ var duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;
+
+ if (!inlineCSS && (env.importMultiple || !duplicateImport)) {
+ importVisitor.recursionDetector[fullPath] = true;
+ new(tree.importVisitor)(importVisitor._importer, subFinish, env, importVisitor.onceFileDetectionMap, importVisitor.recursionDetector)
+ .run(root);
+ return;
+ }
+ }
+
+ subFinish();
+ });
+ }
+ }
+ visitArgs.visitDeeper = false;
+ return importNode;
+ },
+ visitRule: function (ruleNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ return ruleNode;
+ },
+ visitDirective: function (directiveNode, visitArgs) {
+ this.env.frames.unshift(directiveNode);
+ return directiveNode;
+ },
+ visitDirectiveOut: function (directiveNode) {
+ this.env.frames.shift();
+ },
+ visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {
+ this.env.frames.unshift(mixinDefinitionNode);
+ return mixinDefinitionNode;
+ },
+ visitMixinDefinitionOut: function (mixinDefinitionNode) {
+ this.env.frames.shift();
+ },
+ visitRuleset: function (rulesetNode, visitArgs) {
+ this.env.frames.unshift(rulesetNode);
+ return rulesetNode;
+ },
+ visitRulesetOut: function (rulesetNode) {
+ this.env.frames.shift();
+ },
+ visitMedia: function (mediaNode, visitArgs) {
+ this.env.frames.unshift(mediaNode.ruleset);
+ return mediaNode;
+ },
+ visitMediaOut: function (mediaNode) {
+ this.env.frames.shift();
+ }
+ };
+
+})(require('./tree'));
+(function (tree) {
+ tree.joinSelectorVisitor = function() {
+ this.contexts = [[]];
+ this._visitor = new tree.visitor(this);
+ };
+
+ tree.joinSelectorVisitor.prototype = {
+ run: function (root) {
+ return this._visitor.visit(root);
+ },
+ visitRule: function (ruleNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+
+ visitRuleset: function (rulesetNode, visitArgs) {
+ var context = this.contexts[this.contexts.length - 1],
+ paths = [], selectors;
+
+ this.contexts.push(paths);
+
+ if (! rulesetNode.root) {
+ selectors = rulesetNode.selectors;
+ if (selectors) {
+ selectors = selectors.filter(function(selector) { return selector.getIsOutput(); });
+ rulesetNode.selectors = selectors.length ? selectors : (selectors = null);
+ if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }
+ }
+ if (!selectors) { rulesetNode.rules = null; }
+ rulesetNode.paths = paths;
+ }
+ },
+ visitRulesetOut: function (rulesetNode) {
+ this.contexts.length = this.contexts.length - 1;
+ },
+ visitMedia: function (mediaNode, visitArgs) {
+ var context = this.contexts[this.contexts.length - 1];
+ mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);
+ }
+ };
+
+})(require('./tree'));
+(function (tree) {
+ tree.toCSSVisitor = function(env) {
+ this._visitor = new tree.visitor(this);
+ this._env = env;
+ };
+
+ tree.toCSSVisitor.prototype = {
+ isReplacing: true,
+ run: function (root) {
+ return this._visitor.visit(root);
+ },
+
+ visitRule: function (ruleNode, visitArgs) {
+ if (ruleNode.variable) {
+ return [];
+ }
+ return ruleNode;
+ },
+
+ visitMixinDefinition: function (mixinNode, visitArgs) {
+ // mixin definitions do not get eval'd - this means they keep state
+ // so we have to clear that state here so it isn't used if toCSS is called twice
+ mixinNode.frames = [];
+ return [];
+ },
+
+ visitExtend: function (extendNode, visitArgs) {
+ return [];
+ },
+
+ visitComment: function (commentNode, visitArgs) {
+ if (commentNode.isSilent(this._env)) {
+ return [];
+ }
+ return commentNode;
+ },
+
+ visitMedia: function(mediaNode, visitArgs) {
+ mediaNode.accept(this._visitor);
+ visitArgs.visitDeeper = false;
+
+ if (!mediaNode.rules.length) {
+ return [];
+ }
+ return mediaNode;
+ },
+
+ visitDirective: function(directiveNode, visitArgs) {
+ if (directiveNode.currentFileInfo.reference && !directiveNode.isReferenced) {
+ return [];
+ }
+ if (directiveNode.name === "@charset") {
+ // Only output the debug info together with subsequent @charset definitions
+ // a comment (or @media statement) before the actual @charset directive would
+ // be considered illegal css as it has to be on the first line
+ if (this.charset) {
+ if (directiveNode.debugInfo) {
+ var comment = new tree.Comment("/* " + directiveNode.toCSS(this._env).replace(/\n/g, "")+" */\n");
+ comment.debugInfo = directiveNode.debugInfo;
+ return this._visitor.visit(comment);
+ }
+ return [];
+ }
+ this.charset = true;
+ }
+ return directiveNode;
+ },
+
+ checkPropertiesInRoot: function(rules) {
+ var ruleNode;
+ for(var i = 0; i < rules.length; i++) {
+ ruleNode = rules[i];
+ if (ruleNode instanceof tree.Rule && !ruleNode.variable) {
+ throw { message: "properties must be inside selector blocks, they cannot be in the root.",
+ index: ruleNode.index, filename: ruleNode.currentFileInfo ? ruleNode.currentFileInfo.filename : null};
+ }
+ }
+ },
+
+ visitRuleset: function (rulesetNode, visitArgs) {
+ var rule, rulesets = [];
+ if (rulesetNode.firstRoot) {
+ this.checkPropertiesInRoot(rulesetNode.rules);
+ }
+ if (! rulesetNode.root) {
+ if (rulesetNode.paths) {
+ rulesetNode.paths = rulesetNode.paths
+ .filter(function(p) {
+ var i;
+ if (p[0].elements[0].combinator.value === ' ') {
+ p[0].elements[0].combinator = new(tree.Combinator)('');
+ }
+ for(i = 0; i < p.length; i++) {
+ if (p[i].getIsReferenced() && p[i].getIsOutput()) {
+ return true;
+ }
+ }
+ return false;
+ });
+ }
+
+ // Compile rules and rulesets
+ var nodeRules = rulesetNode.rules, nodeRuleCnt = nodeRules ? nodeRules.length : 0;
+ for (var i = 0; i < nodeRuleCnt; ) {
+ rule = nodeRules[i];
+ if (rule && rule.rules) {
+ // visit because we are moving them out from being a child
+ rulesets.push(this._visitor.visit(rule));
+ nodeRules.splice(i, 1);
+ nodeRuleCnt--;
+ continue;
+ }
+ i++;
+ }
+ // accept the visitor to remove rules and refactor itself
+ // then we can decide now whether we want it or not
+ if (nodeRuleCnt > 0) {
+ rulesetNode.accept(this._visitor);
+ } else {
+ rulesetNode.rules = null;
+ }
+ visitArgs.visitDeeper = false;
+
+ nodeRules = rulesetNode.rules;
+ if (nodeRules) {
+ this._mergeRules(nodeRules);
+ nodeRules = rulesetNode.rules;
+ }
+ if (nodeRules) {
+ this._removeDuplicateRules(nodeRules);
+ nodeRules = rulesetNode.rules;
+ }
+
+ // now decide whether we keep the ruleset
+ if (nodeRules && nodeRules.length > 0 && rulesetNode.paths.length > 0) {
+ rulesets.splice(0, 0, rulesetNode);
+ }
+ } else {
+ rulesetNode.accept(this._visitor);
+ visitArgs.visitDeeper = false;
+ if (rulesetNode.firstRoot || (rulesetNode.rules && rulesetNode.rules.length > 0)) {
+ rulesets.splice(0, 0, rulesetNode);
+ }
+ }
+ if (rulesets.length === 1) {
+ return rulesets[0];
+ }
+ return rulesets;
+ },
+
+ _removeDuplicateRules: function(rules) {
+ if (!rules) { return; }
+
+ // remove duplicates
+ var ruleCache = {},
+ ruleList, rule, i;
+
+ for(i = rules.length - 1; i >= 0 ; i--) {
+ rule = rules[i];
+ if (rule instanceof tree.Rule) {
+ if (!ruleCache[rule.name]) {
+ ruleCache[rule.name] = rule;
+ } else {
+ ruleList = ruleCache[rule.name];
+ if (ruleList instanceof tree.Rule) {
+ ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._env)];
+ }
+ var ruleCSS = rule.toCSS(this._env);
+ if (ruleList.indexOf(ruleCSS) !== -1) {
+ rules.splice(i, 1);
+ } else {
+ ruleList.push(ruleCSS);
+ }
+ }
+ }
+ }
+ },
+
+ _mergeRules: function (rules) {
+ if (!rules) { return; }
+
+ var groups = {},
+ parts,
+ rule,
+ key;
+
+ for (var i = 0; i < rules.length; i++) {
+ rule = rules[i];
+
+ if ((rule instanceof tree.Rule) && rule.merge) {
+ key = [rule.name,
+ rule.important ? "!" : ""].join(",");
+
+ if (!groups[key]) {
+ groups[key] = [];
+ } else {
+ rules.splice(i--, 1);
+ }
+
+ groups[key].push(rule);
+ }
+ }
+
+ Object.keys(groups).map(function (k) {
+
+ function toExpression(values) {
+ return new (tree.Expression)(values.map(function (p) {
+ return p.value;
+ }));
+ }
+
+ function toValue(values) {
+ return new (tree.Value)(values.map(function (p) {
+ return p;
+ }));
+ }
+
+ parts = groups[k];
+
+ if (parts.length > 1) {
+ rule = parts[0];
+ var spacedGroups = [];
+ var lastSpacedGroup = [];
+ parts.map(function (p) {
+ if (p.merge==="+") {
+ if (lastSpacedGroup.length > 0) {
+ spacedGroups.push(toExpression(lastSpacedGroup));
+ }
+ lastSpacedGroup = [];
+ }
+ lastSpacedGroup.push(p);
+ });
+ spacedGroups.push(toExpression(lastSpacedGroup));
+ rule.value = toValue(spacedGroups);
+ }
+ });
+ }
+ };
+
+})(require('./tree'));
+(function (tree) {
+ /*jshint loopfunc:true */
+
+ tree.extendFinderVisitor = function() {
+ this._visitor = new tree.visitor(this);
+ this.contexts = [];
+ this.allExtendsStack = [[]];
+ };
+
+ tree.extendFinderVisitor.prototype = {
+ run: function (root) {
+ root = this._visitor.visit(root);
+ root.allExtends = this.allExtendsStack[0];
+ return root;
+ },
+ visitRule: function (ruleNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitRuleset: function (rulesetNode, visitArgs) {
+ if (rulesetNode.root) {
+ return;
+ }
+
+ var i, j, extend, allSelectorsExtendList = [], extendList;
+
+ // get &:extend(.a); rules which apply to all selectors in this ruleset
+ var rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0;
+ for(i = 0; i < ruleCnt; i++) {
+ if (rulesetNode.rules[i] instanceof tree.Extend) {
+ allSelectorsExtendList.push(rules[i]);
+ rulesetNode.extendOnEveryPath = true;
+ }
+ }
+
+ // now find every selector and apply the extends that apply to all extends
+ // and the ones which apply to an individual extend
+ var paths = rulesetNode.paths;
+ for(i = 0; i < paths.length; i++) {
+ var selectorPath = paths[i],
+ selector = selectorPath[selectorPath.length - 1],
+ selExtendList = selector.extendList;
+
+ extendList = selExtendList ? selExtendList.slice(0).concat(allSelectorsExtendList)
+ : allSelectorsExtendList;
+
+ if (extendList) {
+ extendList = extendList.map(function(allSelectorsExtend) {
+ return allSelectorsExtend.clone();
+ });
+ }
+
+ for(j = 0; j < extendList.length; j++) {
+ this.foundExtends = true;
+ extend = extendList[j];
+ extend.findSelfSelectors(selectorPath);
+ extend.ruleset = rulesetNode;
+ if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }
+ this.allExtendsStack[this.allExtendsStack.length-1].push(extend);
+ }
+ }
+
+ this.contexts.push(rulesetNode.selectors);
+ },
+ visitRulesetOut: function (rulesetNode) {
+ if (!rulesetNode.root) {
+ this.contexts.length = this.contexts.length - 1;
+ }
+ },
+ visitMedia: function (mediaNode, visitArgs) {
+ mediaNode.allExtends = [];
+ this.allExtendsStack.push(mediaNode.allExtends);
+ },
+ visitMediaOut: function (mediaNode) {
+ this.allExtendsStack.length = this.allExtendsStack.length - 1;
+ },
+ visitDirective: function (directiveNode, visitArgs) {
+ directiveNode.allExtends = [];
+ this.allExtendsStack.push(directiveNode.allExtends);
+ },
+ visitDirectiveOut: function (directiveNode) {
+ this.allExtendsStack.length = this.allExtendsStack.length - 1;
+ }
+ };
+
+ tree.processExtendsVisitor = function() {
+ this._visitor = new tree.visitor(this);
+ };
+
+ tree.processExtendsVisitor.prototype = {
+ run: function(root) {
+ var extendFinder = new tree.extendFinderVisitor();
+ extendFinder.run(root);
+ if (!extendFinder.foundExtends) { return root; }
+ root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));
+ this.allExtendsStack = [root.allExtends];
+ return this._visitor.visit(root);
+ },
+ doExtendChaining: function (extendsList, extendsListTarget, iterationCount) {
+ //
+ // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering and pasting
+ // the selector we would do normally, but we are also adding an extend with the same target selector
+ // this means this new extend can then go and alter other extends
+ //
+ // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors
+ // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already processed if
+ // we look at each selector at a time, as is done in visitRuleset
+
+ var extendIndex, targetExtendIndex, matches, extendsToAdd = [], newSelector, extendVisitor = this, selectorPath, extend, targetExtend, newExtend;
+
+ iterationCount = iterationCount || 0;
+
+ //loop through comparing every extend with every target extend.
+ // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place
+ // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one
+ // and the second is the target.
+ // the seperation into two lists allows us to process a subset of chains with a bigger set, as is the
+ // case when processing media queries
+ for(extendIndex = 0; extendIndex < extendsList.length; extendIndex++){
+ for(targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++){
+
+ extend = extendsList[extendIndex];
+ targetExtend = extendsListTarget[targetExtendIndex];
+
+ // look for circular references
+ if( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ){ continue; }
+
+ // find a match in the target extends self selector (the bit before :extend)
+ selectorPath = [targetExtend.selfSelectors[0]];
+ matches = extendVisitor.findMatch(extend, selectorPath);
+
+ if (matches.length) {
+
+ // we found a match, so for each self selector..
+ extend.selfSelectors.forEach(function(selfSelector) {
+
+ // process the extend as usual
+ newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector);
+
+ // but now we create a new extend from it
+ newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0);
+ newExtend.selfSelectors = newSelector;
+
+ // add the extend onto the list of extends for that selector
+ newSelector[newSelector.length-1].extendList = [newExtend];
+
+ // record that we need to add it.
+ extendsToAdd.push(newExtend);
+ newExtend.ruleset = targetExtend.ruleset;
+
+ //remember its parents for circular references
+ newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);
+
+ // only process the selector once.. if we have :extend(.a,.b) then multiple
+ // extends will look at the same selector path, so when extending
+ // we know that any others will be duplicates in terms of what is added to the css
+ if (targetExtend.firstExtendOnThisSelectorPath) {
+ newExtend.firstExtendOnThisSelectorPath = true;
+ targetExtend.ruleset.paths.push(newSelector);
+ }
+ });
+ }
+ }
+ }
+
+ if (extendsToAdd.length) {
+ // try to detect circular references to stop a stack overflow.
+ // may no longer be needed.
+ this.extendChainCount++;
+ if (iterationCount > 100) {
+ var selectorOne = "{unable to calculate}";
+ var selectorTwo = "{unable to calculate}";
+ try
+ {
+ selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();
+ selectorTwo = extendsToAdd[0].selector.toCSS();
+ }
+ catch(e) {}
+ throw {message: "extend circular reference detected. One of the circular extends is currently:"+selectorOne+":extend(" + selectorTwo+")"};
+ }
+
+ // now process the new extends on the existing rules so that we can handle a extending b extending c ectending d extending e...
+ return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount+1));
+ } else {
+ return extendsToAdd;
+ }
+ },
+ visitRule: function (ruleNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitSelector: function (selectorNode, visitArgs) {
+ visitArgs.visitDeeper = false;
+ },
+ visitRuleset: function (rulesetNode, visitArgs) {
+ if (rulesetNode.root) {
+ return;
+ }
+ var matches, pathIndex, extendIndex, allExtends = this.allExtendsStack[this.allExtendsStack.length-1], selectorsToAdd = [], extendVisitor = this, selectorPath;
+
+ // look at each selector path in the ruleset, find any extend matches and then copy, find and replace
+
+ for(extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {
+ for(pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {
+ selectorPath = rulesetNode.paths[pathIndex];
+
+ // extending extends happens initially, before the main pass
+ if (rulesetNode.extendOnEveryPath) { continue; }
+ var extendList = selectorPath[selectorPath.length-1].extendList;
+ if (extendList && extendList.length) { continue; }
+
+ matches = this.findMatch(allExtends[extendIndex], selectorPath);
+
+ if (matches.length) {
+
+ allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) {
+ selectorsToAdd.push(extendVisitor.extendSelector(matches, selectorPath, selfSelector));
+ });
+ }
+ }
+ }
+ rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);
+ },
+ findMatch: function (extend, haystackSelectorPath) {
+ //
+ // look through the haystack selector path to try and find the needle - extend.selector
+ // returns an array of selector matches that can then be replaced
+ //
+ var haystackSelectorIndex, hackstackSelector, hackstackElementIndex, haystackElement,
+ targetCombinator, i,
+ extendVisitor = this,
+ needleElements = extend.selector.elements,
+ potentialMatches = [], potentialMatch, matches = [];
+
+ // loop through the haystack elements
+ for(haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {
+ hackstackSelector = haystackSelectorPath[haystackSelectorIndex];
+
+ for(hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {
+
+ haystackElement = hackstackSelector.elements[hackstackElementIndex];
+
+ // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.
+ if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {
+ potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, initialCombinator: haystackElement.combinator});
+ }
+
+ for(i = 0; i < potentialMatches.length; i++) {
+ potentialMatch = potentialMatches[i];
+
+ // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't
+ // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to work out
+ // what the resulting combinator will be
+ targetCombinator = haystackElement.combinator.value;
+ if (targetCombinator === '' && hackstackElementIndex === 0) {
+ targetCombinator = ' ';
+ }
+
+ // if we don't match, null our match to indicate failure
+ if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||
+ (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {
+ potentialMatch = null;
+ } else {
+ potentialMatch.matched++;
+ }
+
+ // if we are still valid and have finished, test whether we have elements after and whether these are allowed
+ if (potentialMatch) {
+ potentialMatch.finished = potentialMatch.matched === needleElements.length;
+ if (potentialMatch.finished &&
+ (!extend.allowAfter && (hackstackElementIndex+1 < hackstackSelector.elements.length || haystackSelectorIndex+1 < haystackSelectorPath.length))) {
+ potentialMatch = null;
+ }
+ }
+ // if null we remove, if not, we are still valid, so either push as a valid match or continue
+ if (potentialMatch) {
+ if (potentialMatch.finished) {
+ potentialMatch.length = needleElements.length;
+ potentialMatch.endPathIndex = haystackSelectorIndex;
+ potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match
+ potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again
+ matches.push(potentialMatch);
+ }
+ } else {
+ potentialMatches.splice(i, 1);
+ i--;
+ }
+ }
+ }
+ }
+ return matches;
+ },
+ isElementValuesEqual: function(elementValue1, elementValue2) {
+ if (typeof elementValue1 === "string" || typeof elementValue2 === "string") {
+ return elementValue1 === elementValue2;
+ }
+ if (elementValue1 instanceof tree.Attribute) {
+ if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {
+ return false;
+ }
+ if (!elementValue1.value || !elementValue2.value) {
+ if (elementValue1.value || elementValue2.value) {
+ return false;
+ }
+ return true;
+ }
+ elementValue1 = elementValue1.value.value || elementValue1.value;
+ elementValue2 = elementValue2.value.value || elementValue2.value;
+ return elementValue1 === elementValue2;
+ }
+ elementValue1 = elementValue1.value;
+ elementValue2 = elementValue2.value;
+ if (elementValue1 instanceof tree.Selector) {
+ if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {
+ return false;
+ }
+ for(var i = 0; i <elementValue1.elements.length; i++) {
+ if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {
+ if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {
+ return false;
+ }
+ }
+ if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ },
+ extendSelector:function (matches, selectorPath, replacementSelector) {
+
+ //for a set of matches, replace each match with the replacement selector
+
+ var currentSelectorPathIndex = 0,
+ currentSelectorPathElementIndex = 0,
+ path = [],
+ matchIndex,
+ selector,
+ firstElement,
+ match,
+ newElements;
+
+ for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {
+ match = matches[matchIndex];
+ selector = selectorPath[match.pathIndex];
+ firstElement = new tree.Element(
+ match.initialCombinator,
+ replacementSelector.elements[0].value,
+ replacementSelector.elements[0].index,
+ replacementSelector.elements[0].currentFileInfo
+ );
+
+ if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {
+ path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));
+ currentSelectorPathElementIndex = 0;
+ currentSelectorPathIndex++;
+ }
+
+ newElements = selector.elements
+ .slice(currentSelectorPathElementIndex, match.index)
+ .concat([firstElement])
+ .concat(replacementSelector.elements.slice(1));
+
+ if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {
+ path[path.length - 1].elements =
+ path[path.length - 1].elements.concat(newElements);
+ } else {
+ path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));
+
+ path.push(new tree.Selector(
+ newElements
+ ));
+ }
+ currentSelectorPathIndex = match.endPathIndex;
+ currentSelectorPathElementIndex = match.endPathElementIndex;
+ if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {
+ currentSelectorPathElementIndex = 0;
+ currentSelectorPathIndex++;
+ }
+ }
+
+ if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {
+ path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));
+ currentSelectorPathIndex++;
+ }
+
+ path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));
+
+ return path;
+ },
+ visitRulesetOut: function (rulesetNode) {
+ },
+ visitMedia: function (mediaNode, visitArgs) {
+ var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);
+ newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));
+ this.allExtendsStack.push(newAllExtends);
+ },
+ visitMediaOut: function (mediaNode) {
+ this.allExtendsStack.length = this.allExtendsStack.length - 1;
+ },
+ visitDirective: function (directiveNode, visitArgs) {
+ var newAllExtends = directiveNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);
+ newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, directiveNode.allExtends));
+ this.allExtendsStack.push(newAllExtends);
+ },
+ visitDirectiveOut: function (directiveNode) {
+ this.allExtendsStack.length = this.allExtendsStack.length - 1;
+ }
+ };
+
+})(require('./tree'));
+
+(function (tree) {
+
+ tree.sourceMapOutput = function (options) {
+ this._css = [];
+ this._rootNode = options.rootNode;
+ this._writeSourceMap = options.writeSourceMap;
+ this._contentsMap = options.contentsMap;
+ this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;
+ this._sourceMapFilename = options.sourceMapFilename;
+ this._outputFilename = options.outputFilename;
+ this._sourceMapURL = options.sourceMapURL;
+ if (options.sourceMapBasepath) {
+ this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/');
+ }
+ this._sourceMapRootpath = options.sourceMapRootpath;
+ this._outputSourceFiles = options.outputSourceFiles;
+ this._sourceMapGeneratorConstructor = options.sourceMapGenerator || require("source-map").SourceMapGenerator;
+
+ if (this._sourceMapRootpath && this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1) !== '/') {
+ this._sourceMapRootpath += '/';
+ }
+
+ this._lineNumber = 0;
+ this._column = 0;
+ };
+
+ tree.sourceMapOutput.prototype.normalizeFilename = function(filename) {
+ filename = filename.replace(/\\/g, '/');
+
+ if (this._sourceMapBasepath && filename.indexOf(this._sourceMapBasepath) === 0) {
+ filename = filename.substring(this._sourceMapBasepath.length);
+ if (filename.charAt(0) === '\\' || filename.charAt(0) === '/') {
+ filename = filename.substring(1);
+ }
+ }
+ return (this._sourceMapRootpath || "") + filename;
+ };
+
+ tree.sourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) {
+
+ //ignore adding empty strings
+ if (!chunk) {
+ return;
+ }
+
+ var lines,
+ sourceLines,
+ columns,
+ sourceColumns,
+ i;
+
+ if (fileInfo) {
+ var inputSource = this._contentsMap[fileInfo.filename];
+
+ // remove vars/banner added to the top of the file
+ if (this._contentsIgnoredCharsMap[fileInfo.filename]) {
+ // adjust the index
+ index -= this._contentsIgnoredCharsMap[fileInfo.filename];
+ if (index < 0) { index = 0; }
+ // adjust the source
+ inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
+ }
+ inputSource = inputSource.substring(0, index);
+ sourceLines = inputSource.split("\n");
+ sourceColumns = sourceLines[sourceLines.length-1];
+ }
+
+ lines = chunk.split("\n");
+ columns = lines[lines.length-1];
+
+ if (fileInfo) {
+ if (!mapLines) {
+ this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},
+ original: { line: sourceLines.length, column: sourceColumns.length},
+ source: this.normalizeFilename(fileInfo.filename)});
+ } else {
+ for(i = 0; i < lines.length; i++) {
+ this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},
+ original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},
+ source: this.normalizeFilename(fileInfo.filename)});
+ }
+ }
+ }
+
+ if (lines.length === 1) {
+ this._column += columns.length;
+ } else {
+ this._lineNumber += lines.length - 1;
+ this._column = columns.length;
+ }
+
+ this._css.push(chunk);
+ };
+
+ tree.sourceMapOutput.prototype.isEmpty = function() {
+ return this._css.length === 0;
+ };
+
+ tree.sourceMapOutput.prototype.toCSS = function(env) {
+ this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });
+
+ if (this._outputSourceFiles) {
+ for(var filename in this._contentsMap) {
+ if (this._contentsMap.hasOwnProperty(filename))
+ {
+ var source = this._contentsMap[filename];
+ if (this._contentsIgnoredCharsMap[filename]) {
+ source = source.slice(this._contentsIgnoredCharsMap[filename]);
+ }
+ this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);
+ }
+ }
+ }
+
+ this._rootNode.genCSS(env, this);
+
+ if (this._css.length > 0) {
+ var sourceMapURL,
+ sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());
+
+ if (this._sourceMapURL) {
+ sourceMapURL = this._sourceMapURL;
+ } else if (this._sourceMapFilename) {
+ sourceMapURL = this.normalizeFilename(this._sourceMapFilename);
+ }
+
+ if (this._writeSourceMap) {
+ this._writeSourceMap(sourceMapContent);
+ } else {
+ sourceMapURL = "data:application/json," + encodeURIComponent(sourceMapContent);
+ }
+
+ if (sourceMapURL) {
+ this._css.push("/*# sourceMappingURL=" + sourceMapURL + " */");
+ }
+ }
+
+ return this._css.join('');
+ };
+
+})(require('./tree'));
+
+// wraps the source-map code in a less module
+(function() {
+ less.modules["source-map"] = function() {
+
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * Define a module along with a payload.
+ * @param {string} moduleName Name for the payload
+ * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
+ * @param {function} payload Function with (require, exports, module) params
+ */
+function define(moduleName, deps, payload) {
+ if (typeof moduleName != "string") {
+ throw new TypeError('Expected string, got: ' + moduleName);
+ }
+
+ if (arguments.length == 2) {
+ payload = deps;
+ }
+
+ if (moduleName in define.modules) {
+ throw new Error("Module already defined: " + moduleName);
+ }
+ define.modules[moduleName] = payload;
+};
+
+/**
+ * The global store of un-instantiated modules
+ */
+define.modules = {};
+
+
+/**
+ * We invoke require() in the context of a Domain so we can have multiple
+ * sets of modules running separate from each other.
+ * This contrasts with JSMs which are singletons, Domains allows us to
+ * optionally load a CommonJS module twice with separate data each time.
+ * Perhaps you want 2 command lines with a different set of commands in each,
+ * for example.
+ */
+function Domain() {
+ this.modules = {};
+ this._currentModule = null;
+}
+
+(function () {
+
+ /**
+ * Lookup module names and resolve them by calling the definition function if
+ * needed.
+ * There are 2 ways to call this, either with an array of dependencies and a
+ * callback to call when the dependencies are found (which can happen
+ * asynchronously in an in-page context) or with a single string an no callback
+ * where the dependency is resolved synchronously and returned.
+ * The API is designed to be compatible with the CommonJS AMD spec and
+ * RequireJS.
+ * @param {string[]|string} deps A name, or names for the payload
+ * @param {function|undefined} callback Function to call when the dependencies
+ * are resolved
+ * @return {undefined|object} The module required or undefined for
+ * array/callback method
+ */
+ Domain.prototype.require = function(deps, callback) {
+ if (Array.isArray(deps)) {
+ var params = deps.map(function(dep) {
+ return this.lookup(dep);
+ }, this);
+ if (callback) {
+ callback.apply(null, params);
+ }
+ return undefined;
+ }
+ else {
+ return this.lookup(deps);
+ }
+ };
+
+ function normalize(path) {
+ var bits = path.split('/');
+ var i = 1;
+ while (i < bits.length) {
+ if (bits[i] === '..') {
+ bits.splice(i-1, 1);
+ } else if (bits[i] === '.') {
+ bits.splice(i, 1);
+ } else {
+ i++;
+ }
+ }
+ return bits.join('/');
+ }
+
+ function join(a, b) {
+ a = a.trim();
+ b = b.trim();
+ if (/^\//.test(b)) {
+ return b;
+ } else {
+ return a.replace(/\/*$/, '/') + b;
+ }
+ }
+
+ function dirname(path) {
+ var bits = path.split('/');
+ bits.pop();
+ return bits.join('/');
+ }
+
+ /**
+ * Lookup module names and resolve them by calling the definition function if
+ * needed.
+ * @param {string} moduleName A name for the payload to lookup
+ * @return {object} The module specified by aModuleName or null if not found.
+ */
+ Domain.prototype.lookup = function(moduleName) {
+ if (/^\./.test(moduleName)) {
+ moduleName = normalize(join(dirname(this._currentModule), moduleName));
+ }
+
+ if (moduleName in this.modules) {
+ var module = this.modules[moduleName];
+ return module;
+ }
+
+ if (!(moduleName in define.modules)) {
+ throw new Error("Module not defined: " + moduleName);
+ }
+
+ var module = define.modules[moduleName];
+
+ if (typeof module == "function") {
+ var exports = {};
+ var previousModule = this._currentModule;
+ this._currentModule = moduleName;
+ module(this.require.bind(this), exports, { id: moduleName, uri: "" });
+ this._currentModule = previousModule;
+ module = exports;
+ }
+
+ // cache the resulting module object for next time
+ this.modules[moduleName] = module;
+
+ return module;
+ };
+
+}());
+
+define.Domain = Domain;
+define.globalDomain = new Domain();
+var require = define.globalDomain.require.bind(define.globalDomain);
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/source-map-generator', ['require', 'exports', 'module' , 'source-map/base64-vlq', 'source-map/util', 'source-map/array-set'], function(require, exports, module) {
+
+ var base64VLQ = require('./base64-vlq');
+ var util = require('./util');
+ var ArraySet = require('./array-set').ArraySet;
+
+ /**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. To create a new one, you must pass an object
+ * with the following properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: An optional root for all URLs in this source map.
+ */
+ function SourceMapGenerator(aArgs) {
+ this._file = util.getArg(aArgs, 'file');
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = [];
+ this._sourcesContents = null;
+ }
+
+ SourceMapGenerator.prototype._version = 3;
+
+ /**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+ SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source) {
+ newMapping.source = mapping.source;
+ if (sourceRoot) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+ /**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+ SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ this._validateMapping(generated, original, source, name);
+
+ if (source && !this._sources.has(source)) {
+ this._sources.add(source);
+ }
+
+ if (name && !this._names.has(name)) {
+ this._names.add(name);
+ }
+
+ this._mappings.push({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+ /**
+ * Set the source content for a source file.
+ */
+ SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent !== null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = {};
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+ /**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ */
+ SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (!aSourceFile) {
+ aSourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "aSourceFile" relative if an absolute Url is passed.
+ if (sourceRoot) {
+ aSourceFile = util.relative(sourceRoot, aSourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "aSourceFile"
+ this._mappings.forEach(function (mapping) {
+ if (mapping.source === aSourceFile && mapping.originalLine) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source !== null) {
+ // Copy mapping
+ if (sourceRoot) {
+ mapping.source = util.relative(sourceRoot, original.source);
+ } else {
+ mapping.source = original.source;
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name !== null && mapping.name !== null) {
+ // Only use the identifier name if it's an identifier
+ // in both SourceMaps
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ if (sourceRoot) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+ /**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+ SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+ /**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+ SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var mapping;
+
+ // The mappings must be guaranteed to be in sorted order before we start
+ // serializing them or else the generated line numbers (which are defined
+ // via the ';' separators) will be all messed up. Note: it might be more
+ // performant to maintain the sorting as we insert them, rather than as we
+ // serialize them, but the big O is the same either way.
+ this._mappings.sort(util.compareByGeneratedPositions);
+
+ for (var i = 0, len = this._mappings.length; i < len; i++) {
+ mapping = this._mappings[i];
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ result += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
+ continue;
+ }
+ result += ',';
+ }
+ }
+
+ result += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source) {
+ result += base64VLQ.encode(this._sources.indexOf(mapping.source)
+ - previousSource);
+ previousSource = this._sources.indexOf(mapping.source);
+
+ // lines are stored 0-based in SourceMap spec version 3
+ result += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ result += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name) {
+ result += base64VLQ.encode(this._names.indexOf(mapping.name)
+ - previousName);
+ previousName = this._names.indexOf(mapping.name);
+ }
+ }
+ }
+
+ return result;
+ };
+
+ SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents,
+ key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+ /**
+ * Externalize the source map.
+ */
+ SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ file: this._file,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._sourceRoot) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+ /**
+ * Render the source map being generated to a string.
+ */
+ SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this);
+ };
+
+ exports.SourceMapGenerator = SourceMapGenerator;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+define('source-map/base64-vlq', ['require', 'exports', 'module' , 'source-map/base64'], function(require, exports, module) {
+
+ var base64 = require('./base64');
+
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
+ // length quantities we use in the source map spec, the first bit is the sign,
+ // the next four bits are the actual value, and the 6th bit is the
+ // continuation bit. The continuation bit tells us whether there are more
+ // digits in this value following this digit.
+ //
+ // Continuation
+ // | Sign
+ // | |
+ // V V
+ // 101011
+
+ var VLQ_BASE_SHIFT = 5;
+
+ // binary: 100000
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+ // binary: 011111
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+ // binary: 100000
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+ /**
+ * Converts from a two-complement value to a value where the sign bit is
+ * is placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+ function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+ }
+
+ /**
+ * Converts to a two-complement value from a value where the sign bit is
+ * is placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+ function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+ }
+
+ /**
+ * Returns the base 64 VLQ encoded value.
+ */
+ exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+ };
+
+ /**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string.
+ */
+ exports.decode = function base64VLQ_decode(aStr) {
+ var i = 0;
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (i >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+ digit = base64.decode(aStr.charAt(i++));
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ return {
+ value: fromVLQSigned(result),
+ rest: aStr.slice(i)
+ };
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/base64', ['require', 'exports', 'module' , ], function(require, exports, module) {
+
+ var charToIntMap = {};
+ var intToCharMap = {};
+
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+ .split('')
+ .forEach(function (ch, index) {
+ charToIntMap[ch] = index;
+ intToCharMap[index] = ch;
+ });
+
+ /**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+ exports.encode = function base64_encode(aNumber) {
+ if (aNumber in intToCharMap) {
+ return intToCharMap[aNumber];
+ }
+ throw new TypeError("Must be between 0 and 63: " + aNumber);
+ };
+
+ /**
+ * Decode a single base 64 digit to an integer.
+ */
+ exports.decode = function base64_decode(aChar) {
+ if (aChar in charToIntMap) {
+ return charToIntMap[aChar];
+ }
+ throw new TypeError("Not a valid base 64 digit: " + aChar);
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/util', ['require', 'exports', 'module' , ], function(require, exports, module) {
+
+ /**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+ }
+ exports.getArg = getArg;
+
+ var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/;
+ var dataUrlRegexp = /^data:.+\,.+/;
+
+ function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[3],
+ host: match[4],
+ port: match[6],
+ path: match[7]
+ };
+ }
+ exports.urlParse = urlParse;
+
+ function urlGenerate(aParsedUrl) {
+ var url = aParsedUrl.scheme + "://";
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + "@"
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+
+ function join(aRoot, aPath) {
+ var url;
+
+ if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {
+ url.path = aPath;
+ return urlGenerate(url);
+ }
+
+ return aRoot.replace(/\/$/, '') + '/' + aPath;
+ }
+ exports.join = join;
+
+ /**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+ function toSetString(aStr) {
+ return '$' + aStr;
+ }
+ exports.toSetString = toSetString;
+
+ function fromSetString(aStr) {
+ return aStr.substr(1);
+ }
+ exports.fromSetString = fromSetString;
+
+ function relative(aRoot, aPath) {
+ aRoot = aRoot.replace(/\/$/, '');
+
+ var url = urlParse(aRoot);
+ if (aPath.charAt(0) == "/" && url && url.path == "/") {
+ return aPath.slice(1);
+ }
+
+ return aPath.indexOf(aRoot + '/') === 0
+ ? aPath.substr(aRoot.length + 1)
+ : aPath;
+ }
+ exports.relative = relative;
+
+ function strcmp(aStr1, aStr2) {
+ var s1 = aStr1 || "";
+ var s2 = aStr2 || "";
+ return (s1 > s2) - (s1 < s2);
+ }
+
+ /**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp;
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.name, mappingB.name);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return mappingA.generatedColumn - mappingB.generatedColumn;
+ };
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+
+ /**
+ * Comparator between two mappings where the generated positions are
+ * compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp;
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ };
+ exports.compareByGeneratedPositions = compareByGeneratedPositions;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/array-set', ['require', 'exports', 'module' , 'source-map/util'], function(require, exports, module) {
+
+ var util = require('./util');
+
+ /**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+ function ArraySet() {
+ this._array = [];
+ this._set = {};
+ }
+
+ /**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ };
+
+ /**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var isDuplicate = this.has(aStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ this._set[util.toSetString(aStr)] = idx;
+ }
+ };
+
+ /**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
+ return Object.prototype.hasOwnProperty.call(this._set,
+ util.toSetString(aStr));
+ };
+
+ /**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (this.has(aStr)) {
+ return this._set[util.toSetString(aStr)];
+ }
+ throw new Error('"' + aStr + '" is not in the set.');
+ };
+
+ /**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+ };
+
+ /**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+ };
+
+ exports.ArraySet = ArraySet;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'source-map/util', 'source-map/binary-search', 'source-map/array-set', 'source-map/base64-vlq'], function(require, exports, module) {
+
+ var util = require('./util');
+ var binarySearch = require('./binary-search');
+ var ArraySet = require('./array-set').ArraySet;
+ var base64VLQ = require('./base64-vlq');
+
+ /**
+ * A SourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+ function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names, true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+ }
+
+ /**
+ * Create a SourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns SourceMapConsumer
+ */
+ SourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(SourceMapConsumer.prototype);
+
+ smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ smc.__generatedMappings = aSourceMap._mappings.slice()
+ .sort(util.compareByGeneratedPositions);
+ smc.__originalMappings = aSourceMap._mappings.slice()
+ .sort(util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ SourceMapConsumer.prototype._version = 3;
+
+ /**
+ * The list of original sources.
+ */
+ Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+ });
+
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
+ // are lazily instantiated, accessed via the `_generatedMappings` and
+ // `_originalMappings` getters respectively, and we only parse the mappings
+ // and create these arrays once queried for a source location. We jump through
+ // these hoops because there can be many thousands of mappings, and parsing
+ // them is expensive, so we only want to do it if we must.
+ //
+ // Each object in the arrays is of the form:
+ //
+ // {
+ // generatedLine: The line number in the generated code,
+ // generatedColumn: The column number in the generated code,
+ // source: The path to the original source file that generated this
+ // chunk of code,
+ // originalLine: The line number in the original source that
+ // corresponds to this chunk of generated code,
+ // originalColumn: The column number in the original source that
+ // corresponds to this chunk of generated code,
+ // name: The name of the original symbol which generated this chunk of
+ // code.
+ // }
+ //
+ // All properties except for `generatedLine` and `generatedColumn` can be
+ // `null`.
+ //
+ // `_generatedMappings` is ordered by the generated positions.
+ //
+ // `_originalMappings` is ordered by the original positions.
+
+ SourceMapConsumer.prototype.__generatedMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype.__originalMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+ });
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var mappingSeparator = /^[,;]/;
+ var str = aStr;
+ var mapping;
+ var temp;
+
+ while (str.length > 0) {
+ if (str.charAt(0) === ';') {
+ generatedLine++;
+ str = str.slice(1);
+ previousGeneratedColumn = 0;
+ }
+ else if (str.charAt(0) === ',') {
+ str = str.slice(1);
+ }
+ else {
+ mapping = {};
+ mapping.generatedLine = generatedLine;
+
+ // Generated column.
+ temp = base64VLQ.decode(str);
+ mapping.generatedColumn = previousGeneratedColumn + temp.value;
+ previousGeneratedColumn = mapping.generatedColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ // Original source.
+ temp = base64VLQ.decode(str);
+ mapping.source = this._sources.at(previousSource + temp.value);
+ previousSource += temp.value;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ // Original line.
+ temp = base64VLQ.decode(str);
+ mapping.originalLine = previousOriginalLine + temp.value;
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ // Original column.
+ temp = base64VLQ.decode(str);
+ mapping.originalColumn = previousOriginalColumn + temp.value;
+ previousOriginalColumn = mapping.originalColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ // Original name.
+ temp = base64VLQ.decode(str);
+ mapping.name = this._names.at(previousName + temp.value);
+ previousName += temp.value;
+ str = temp.rest;
+ }
+ }
+
+ this.__generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ this.__originalMappings.push(mapping);
+ }
+ }
+ }
+
+ this.__originalMappings.sort(util.compareByOriginalPositions);
+ };
+
+ /**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+ SourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator);
+ };
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+ SourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var mapping = this._findMapping(needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositions);
+
+ if (mapping) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source && this.sourceRoot) {
+ source = util.join(this.sourceRoot, source);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: util.getArg(mapping, 'name', null)
+ };
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * availible.
+ */
+ SourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ };
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ SourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ if (this.sourceRoot) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+
+ var mapping = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions);
+
+ if (mapping) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null)
+ };
+ }
+
+ return {
+ line: null,
+ column: null
+ };
+ };
+
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+ /**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+ SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source;
+ if (source && sourceRoot) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name
+ };
+ }).forEach(aCallback, context);
+ };
+
+ exports.SourceMapConsumer = SourceMapConsumer;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/binary-search', ['require', 'exports', 'module' , ], function(require, exports, module) {
+
+ /**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ */
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the next
+ // closest element that is less than that element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element which is less than the one we are searching for, so we
+ // return null.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return aHaystack[mid];
+ }
+ else if (cmp > 0) {
+ // aHaystack[mid] is greater than our needle.
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
+ }
+ // We did not find an exact match, return the next closest one
+ // (termination case 2).
+ return aHaystack[mid];
+ }
+ else {
+ // aHaystack[mid] is less than our needle.
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
+ }
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (2) or (3) and return the appropriate thing.
+ return aLow < 0
+ ? null
+ : aHaystack[aLow];
+ }
+ }
+
+ /**
+ * This is an implementation of binary search which will always try and return
+ * the next lowest value checked if there is no exact hit. This is because
+ * mappings between original and generated line/col pairs are single points,
+ * and there is an implicit region between each of them, so a miss just means
+ * that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ */
+ exports.search = function search(aNeedle, aHaystack, aCompare) {
+ return aHaystack.length > 0
+ ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)
+ : null;
+ };
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/source-map-generator', 'source-map/util'], function(require, exports, module) {
+
+ var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
+ var util = require('./util');
+
+ /**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine === undefined ? null : aLine;
+ this.column = aColumn === undefined ? null : aColumn;
+ this.source = aSource === undefined ? null : aSource;
+ this.name = aName === undefined ? null : aName;
+ if (aChunks != null) this.add(aChunks);
+ }
+
+ /**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ */
+ SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // The generated code
+ // Processed fragments are removed from this array.
+ var remainingLines = aGeneratedCode.split('\n');
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping === null) {
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(remainingLines.shift() + "\n");
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ } else {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ var code = "";
+ // Associate full lines with "lastMapping"
+ do {
+ code += remainingLines.shift() + "\n";
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ } while (lastGeneratedLine < mapping.generatedLine);
+ // When we reached the correct line, we add code until we
+ // reach the correct column too.
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ code += nextLine.substr(0, mapping.generatedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ // Create the SourceNode.
+ addMappingWithCode(lastMapping, code);
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[0];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ }
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ // Associate the remaining code in the current line with "lastMapping"
+ // and add the remaining lines without any mapping
+ addMappingWithCode(lastMapping, remainingLines.join("\n"));
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ mapping.source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+ /**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk instanceof SourceNode) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+ };
+
+ /**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ };
+
+ /**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild instanceof SourceNode) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+ };
+
+ /**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+ SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+ /**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i] instanceof SourceNode) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+ /**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+ SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+ };
+
+ /**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ chunk.split('').forEach(function (ch) {
+ if (ch === '\n') {
+ generated.line++;
+ generated.column = 0;
+ } else {
+ generated.column++;
+ }
+ });
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+ };
+
+ exports.SourceNode = SourceNode;
+
+});
+/* -*- Mode: js; js-indent-level: 2; -*- */
+///////////////////////////////////////////////////////////////////////////////
+
+this.sourceMap = {
+ SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer,
+ SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator,
+ SourceNode: require('source-map/source-node').SourceNode
+};
+
+// footer to wrap "source-map" module
+ return this.sourceMap;
+ }();
+})(); \ No newline at end of file
diff --git a/http/tools/lessc-rhino-1.7.0.js b/http/tools/lessc-rhino-1.7.0.js
new file mode 100644
index 0000000..7f5884d
--- /dev/null
+++ b/http/tools/lessc-rhino-1.7.0.js
@@ -0,0 +1,449 @@
+/* LESS.js v1.7.0 RHINO | Copyright (c) 2009-2014, Alexis Sellier <self@cloudhead.net> */
+
+/*global name:true, less, loadStyleSheet, os */
+
+function formatError(ctx, options) {
+ options = options || {};
+
+ var message = "";
+ var extract = ctx.extract;
+ var error = [];
+
+// var stylize = options.color ? require('./lessc_helper').stylize : function (str) { return str; };
+ var stylize = function (str) { return str; };
+
+ // only output a stack if it isn't a less error
+ if (ctx.stack && !ctx.type) { return stylize(ctx.stack, 'red'); }
+
+ if (!ctx.hasOwnProperty('index') || !extract) {
+ return ctx.stack || ctx.message;
+ }
+
+ if (typeof(extract[0]) === 'string') {
+ error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey'));
+ }
+
+ if (typeof(extract[1]) === 'string') {
+ var errorTxt = ctx.line + ' ';
+ if (extract[1]) {
+ errorTxt += extract[1].slice(0, ctx.column) +
+ stylize(stylize(stylize(extract[1][ctx.column], 'bold') +
+ extract[1].slice(ctx.column + 1), 'red'), 'inverse');
+ }
+ error.push(errorTxt);
+ }
+
+ if (typeof(extract[2]) === 'string') {
+ error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey'));
+ }
+ error = error.join('\n') + stylize('', 'reset') + '\n';
+
+ message += stylize(ctx.type + 'Error: ' + ctx.message, 'red');
+ if (ctx.filename) {
+ message += stylize(' in ', 'red') + ctx.filename +
+ stylize(' on line ' + ctx.line + ', column ' + (ctx.column + 1) + ':', 'grey');
+ }
+
+ message += '\n' + error;
+
+ if (ctx.callLine) {
+ message += stylize('from ', 'red') + (ctx.filename || '') + '/n';
+ message += stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract + '/n';
+ }
+
+ return message;
+}
+
+function writeError(ctx, options) {
+ options = options || {};
+ if (options.silent) { return; }
+ print(formatError(ctx, options));
+}
+
+function loadStyleSheet(sheet, callback, reload, remaining) {
+ var endOfPath = Math.max(name.lastIndexOf('/'), name.lastIndexOf('\\')),
+ sheetName = name.slice(0, endOfPath + 1) + sheet.href,
+ contents = sheet.contents || {},
+ input = readFile(sheetName);
+
+ input = input.replace(/^\xEF\xBB\xBF/, '');
+
+ contents[sheetName] = input;
+
+ var parser = new less.Parser({
+ paths: [sheet.href.replace(/[\w\.-]+$/, '')],
+ contents: contents
+ });
+ parser.parse(input, function (e, root) {
+ if (e) {
+ return writeError(e);
+ }
+ try {
+ callback(e, root, input, sheet, { local: false, lastModified: 0, remaining: remaining }, sheetName);
+ } catch(e) {
+ writeError(e);
+ }
+ });
+}
+
+less.Parser.fileLoader = function (file, currentFileInfo, callback, env) {
+
+ var href = file;
+ if (currentFileInfo && currentFileInfo.currentDirectory && !/^\//.test(file)) {
+ href = less.modules.path.join(currentFileInfo.currentDirectory, file);
+ }
+
+ var path = less.modules.path.dirname(href);
+
+ var newFileInfo = {
+ currentDirectory: path + '/',
+ filename: href
+ };
+
+ if (currentFileInfo) {
+ newFileInfo.entryPath = currentFileInfo.entryPath;
+ newFileInfo.rootpath = currentFileInfo.rootpath;
+ newFileInfo.rootFilename = currentFileInfo.rootFilename;
+ newFileInfo.relativeUrls = currentFileInfo.relativeUrls;
+ } else {
+ newFileInfo.entryPath = path;
+ newFileInfo.rootpath = less.rootpath || path;
+ newFileInfo.rootFilename = href;
+ newFileInfo.relativeUrls = env.relativeUrls;
+ }
+
+ var j = file.lastIndexOf('/');
+ if(newFileInfo.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) {
+ var relativeSubDirectory = file.slice(0, j+1);
+ newFileInfo.rootpath = newFileInfo.rootpath + relativeSubDirectory; // append (sub|sup) directory path of imported file
+ }
+ newFileInfo.currentDirectory = path;
+ newFileInfo.filename = href;
+
+ var data = null;
+ try {
+ data = readFile(href);
+ } catch (e) {
+ callback({ type: 'File', message: "'" + less.modules.path.basename(href) + "' wasn't found" });
+ return;
+ }
+
+ try {
+ callback(null, data, href, newFileInfo, { lastModified: 0 });
+ } catch (e) {
+ callback(e, null, href);
+ }
+};
+
+
+function writeFile(filename, content) {
+ var fstream = new java.io.FileWriter(filename);
+ var out = new java.io.BufferedWriter(fstream);
+ out.write(content);
+ out.close();
+}
+
+// Command line integration via Rhino
+(function (args) {
+
+ var options = {
+ depends: false,
+ compress: false,
+ cleancss: false,
+ max_line_len: -1,
+ optimization: 1,
+ silent: false,
+ verbose: false,
+ lint: false,
+ paths: [],
+ color: true,
+ strictImports: false,
+ rootpath: '',
+ relativeUrls: false,
+ ieCompat: true,
+ strictMath: false,
+ strictUnits: false
+ };
+ var continueProcessing = true,
+ currentErrorcode;
+
+ var checkArgFunc = function(arg, option) {
+ if (!option) {
+ print(arg + " option requires a parameter");
+ continueProcessing = false;
+ return false;
+ }
+ return true;
+ };
+
+ var checkBooleanArg = function(arg) {
+ var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg);
+ if (!onOff) {
+ print(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
+ continueProcessing = false;
+ return false;
+ }
+ return Boolean(onOff[2]);
+ };
+
+ var warningMessages = "";
+ var sourceMapFileInline = false;
+
+ args = args.filter(function (arg) {
+ var match = arg.match(/^-I(.+)$/);
+
+ if (match) {
+ options.paths.push(match[1]);
+ return false;
+ }
+
+ match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=(.*))?$/i);
+ if (match) { arg = match[1]; } // was (?:=([^\s]*)), check!
+ else { return arg; }
+
+ switch (arg) {
+ case 'v':
+ case 'version':
+ console.log("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]");
+ continueProcessing = false;
+ break;
+ case 'verbose':
+ options.verbose = true;
+ break;
+ case 's':
+ case 'silent':
+ options.silent = true;
+ break;
+ case 'l':
+ case 'lint':
+ options.lint = true;
+ break;
+ case 'strict-imports':
+ options.strictImports = true;
+ break;
+ case 'h':
+ case 'help':
+ //TODO
+// require('../lib/less/lessc_helper').printUsage();
+ continueProcessing = false;
+ break;
+ case 'x':
+ case 'compress':
+ options.compress = true;
+ break;
+ case 'M':
+ case 'depends':
+ options.depends = true;
+ break;
+ case 'yui-compress':
+ warningMessages += "yui-compress option has been removed. assuming clean-css.";
+ options.cleancss = true;
+ break;
+ case 'clean-css':
+ options.cleancss = true;
+ break;
+ case 'max-line-len':
+ if (checkArgFunc(arg, match[2])) {
+ options.maxLineLen = parseInt(match[2], 10);
+ if (options.maxLineLen <= 0) {
+ options.maxLineLen = -1;
+ }
+ }
+ break;
+ case 'no-color':
+ options.color = false;
+ break;
+ case 'no-ie-compat':
+ options.ieCompat = false;
+ break;
+ case 'no-js':
+ options.javascriptEnabled = false;
+ break;
+ case 'include-path':
+ if (checkArgFunc(arg, match[2])) {
+ options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
+ .map(function(p) {
+ if (p) {
+// return path.resolve(process.cwd(), p);
+ return p;
+ }
+ });
+ }
+ break;
+ case 'O0': options.optimization = 0; break;
+ case 'O1': options.optimization = 1; break;
+ case 'O2': options.optimization = 2; break;
+ case 'line-numbers':
+ if (checkArgFunc(arg, match[2])) {
+ options.dumpLineNumbers = match[2];
+ }
+ break;
+ case 'source-map':
+ if (!match[2]) {
+ options.sourceMap = true;
+ } else {
+ options.sourceMap = match[2];
+ }
+ break;
+ case 'source-map-rootpath':
+ if (checkArgFunc(arg, match[2])) {
+ options.sourceMapRootpath = match[2];
+ }
+ break;
+ case 'source-map-basepath':
+ if (checkArgFunc(arg, match[2])) {
+ options.sourceMapBasepath = match[2];
+ }
+ break;
+ case 'source-map-map-inline':
+ sourceMapFileInline = true;
+ options.sourceMap = true;
+ break;
+ case 'source-map-less-inline':
+ options.outputSourceFiles = true;
+ break;
+ case 'source-map-url':
+ if (checkArgFunc(arg, match[2])) {
+ options.sourceMapURL = match[2];
+ }
+ break;
+ case 'source-map-output-map-file':
+ if (checkArgFunc(arg, match[2])) {
+ options.writeSourceMap = function(sourceMapContent) {
+ writeFile(match[2], sourceMapContent);
+ };
+ }
+ break;
+ case 'rp':
+ case 'rootpath':
+ if (checkArgFunc(arg, match[2])) {
+ options.rootpath = match[2].replace(/\\/g, '/');
+ }
+ break;
+ case "ru":
+ case "relative-urls":
+ options.relativeUrls = true;
+ break;
+ case "sm":
+ case "strict-math":
+ if (checkArgFunc(arg, match[2])) {
+ options.strictMath = checkBooleanArg(match[2]);
+ }
+ break;
+ case "su":
+ case "strict-units":
+ if (checkArgFunc(arg, match[2])) {
+ options.strictUnits = checkBooleanArg(match[2]);
+ }
+ break;
+ default:
+ console.log('invalid option ' + arg);
+ continueProcessing = false;
+ }
+ });
+
+ if (!continueProcessing) {
+ return;
+ }
+
+ var name = args[0];
+ if (name && name != '-') {
+// name = path.resolve(process.cwd(), name);
+ }
+ var output = args[1];
+ var outputbase = args[1];
+ if (output) {
+ options.sourceMapOutputFilename = output;
+// output = path.resolve(process.cwd(), output);
+ if (warningMessages) {
+ console.log(warningMessages);
+ }
+ }
+
+// options.sourceMapBasepath = process.cwd();
+// options.sourceMapBasepath = '';
+
+ if (options.sourceMap === true) {
+ console.log("output: " + output);
+ if (!output && !sourceMapFileInline) {
+ console.log("the sourcemap option only has an optional filename if the css filename is given");
+ return;
+ }
+ options.sourceMapFullFilename = options.sourceMapOutputFilename + ".map";
+ options.sourceMap = less.modules.path.basename(options.sourceMapFullFilename);
+ } else if (options.sourceMap) {
+ options.sourceMapOutputFilename = options.sourceMap;
+ }
+
+
+ if (!name) {
+ console.log("lessc: no inout files");
+ console.log("");
+ // TODO
+// require('../lib/less/lessc_helper').printUsage();
+ currentErrorcode = 1;
+ return;
+ }
+
+// var ensureDirectory = function (filepath) {
+// var dir = path.dirname(filepath),
+// cmd,
+// existsSync = fs.existsSync || path.existsSync;
+// if (!existsSync(dir)) {
+// if (mkdirp === undefined) {
+// try {mkdirp = require('mkdirp');}
+// catch(e) { mkdirp = null; }
+// }
+// cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
+// cmd(dir);
+// }
+// };
+
+ if (options.depends) {
+ if (!outputbase) {
+ console.log("option --depends requires an output path to be specified");
+ return;
+ }
+ console.log(outputbase + ": ");
+ }
+
+ if (!name) {
+ console.log('No files present in the fileset');
+ quit(1);
+ }
+
+ var input = null;
+ try {
+ input = readFile(name, 'utf-8');
+
+ } catch (e) {
+ console.log('lesscss: couldn\'t open file ' + name);
+ quit(1);
+ }
+
+ options.filename = name;
+ var result;
+ try {
+ var parser = new less.Parser(options);
+ parser.parse(input, function (e, root) {
+ if (e) {
+ writeError(e, options);
+ quit(1);
+ } else {
+ result = root.toCSS(options);
+ if (output) {
+ writeFile(output, result);
+ console.log("Written to " + output);
+ } else {
+ print(result);
+ }
+ quit(0);
+ }
+ });
+ }
+ catch(e) {
+ writeError(e, options);
+ quit(1);
+ }
+ console.log("done");
+}(arguments));
diff --git a/http/tools/yuicompressor-2.4.8.jar b/http/tools/yuicompressor-2.4.8.jar
new file mode 100644
index 0000000..a1cf0a0
--- /dev/null
+++ b/http/tools/yuicompressor-2.4.8.jar
Binary files differ
diff --git a/http/www/common.js b/http/www/common.js
new file mode 100644
index 0000000..24f5504
--- /dev/null
+++ b/http/www/common.js
@@ -0,0 +1,79 @@
+/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
+}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
+e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, spinner.js, tabs.js, tooltip.js
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,N=e.extend({},y),M=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?N.left-=d:"center"===n.my[0]&&(N.left-=d/2),"bottom"===n.my[1]?N.top-=c:"center"===n.my[1]&&(N.top-=c/2),N.left+=M[0],N.top+=M[1],a||(N.left=h(N.left),N.top=h(N.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](N,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+M[0],p[1]+M[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-N.left,i=t+m-d,s=v.top-N.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:N.left,top:N.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(N,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}
+},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;
+this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))
+},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:function(event){this.collapseAll(event,true)},"mouseleave .ui-menu":function(event){this.collapseAll(event,true)},focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this
+},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,N,M,C,A,P,I,H,z,F,E,W,O,L,j=new Date,R=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth(),j.getDate())),Y=this._get(e,"isRTL"),J=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),U=this._get(e,"showCurrentAtPos"),q=this._get(e,"stepMonths"),G=1!==V[0]||1!==V[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-U,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-V[0]*V[1]+1,$.getDate())),t=Q&&Q>t?Q:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+q,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:R,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=J?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;V[0]>w;w++){for(k="",this.maxRows=4,T=0;V[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",N="",G){if(N+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:N+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case V[1]-1:N+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:N+=" ui-datepicker-group-middle",S=""}N+="'>"}for(N+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,Q,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,M+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(N+=M+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=G?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._get(arguments[0],"calendarStart") ? this._get(arguments[0],"calendarStart").call(this) : this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(N+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!y||!W[0]||Q&&Q>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);N+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),N+="</tbody></table>"+(G?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=N}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;
+return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}
+},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01
+* http://trentrichardson.com/examples/timepicker
+* Copyright (c) 2014 Trent Richardson; Licensed MIT */
+(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.5.0"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(e,t){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],e,t,tp_inst):void 0},onChangeMonthYear:function(e,t,i){tp_inst._updateDateTime(i),$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],e,t,i,tp_inst)},onClose:function(e,t){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(t),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],e,t,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(e){return e.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(e){return e.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&$.ui.slider===void 0&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(e){var t=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(t),this._limitMinMaxDateTime(e,!1),this._injectTimePicker()},_parseTime:function(e,t){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),t||!this._defaults.timeOnly){var i=$.datepicker._get(this.inst,"dateFormat");try{var s=parseDateTimeInternal(i,this._defaults.timeFormat,e,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!s.timeObj)return!1;$.extend(this,s.timeObj)}catch(a){return $.timepicker.log("Error parsing the date/time string: "+a+"\ndate/time string = "+e+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+i),!1}return!0}var n=$.datepicker.parseTime(this._defaults.timeFormat,e,this._defaults);return n?($.extend(this,n),!0):!1},_injectTimePicker:function(){var e=this.inst.dpDiv,t=this.inst.settings,i=this,s="",a="",n=null,r={},l={},o=null,c=0,u=0;if(0===e.find("div.ui-timepicker-div").length&&t.showTimepicker){var m=' style="display:none;"',d='<div class="ui-timepicker-div'+(t.isRTL?" ui-timepicker-rtl":"")+'"><dl>'+'<dt class="ui_tpicker_time_label"'+(t.showTime?"":m)+">"+t.timeText+"</dt>"+'<dd class="ui_tpicker_time"'+(t.showTime?"":m)+"></dd>";for(c=0,u=this.units.length;u>c;c++){if(s=this.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],r[s]=parseInt(t[s+"Max"]-(t[s+"Max"]-t[s+"Min"])%t["step"+a],10),l[s]=0,d+='<dt class="ui_tpicker_'+s+'_label"'+(n?"":m)+">"+t[s+"Text"]+"</dt>"+'<dd class="ui_tpicker_'+s+'"><div class="ui_tpicker_'+s+'_slider"'+(n?"":m)+"></div>",n&&t[s+"Grid"]>0){if(d+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>',"hour"===s)for(var h=t[s+"Min"];r[s]>=h;h+=parseInt(t[s+"Grid"],10)){l[s]++;var p=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},t);d+='<td data-for="'+s+'">'+p+"</td>"}else for(var _=t[s+"Min"];r[s]>=_;_+=parseInt(t[s+"Grid"],10))l[s]++,d+='<td data-for="'+s+'">'+(10>_?"0":"")+_+"</td>";d+="</tr></table></div>"}d+="</dd>"}var f=null!==t.showTimezone?t.showTimezone:this.support.timezone;d+='<dt class="ui_tpicker_timezone_label"'+(f?"":m)+">"+t.timezoneText+"</dt>",d+='<dd class="ui_tpicker_timezone" '+(f?"":m)+"></dd>",d+="</dl></div>";var g=$(d);for(t.timeOnly===!0&&(g.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+t.timeOnlyTitle+"</div>"+"</div>"),e.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),c=0,u=i.units.length;u>c;c++)s=i.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],i[s+"_slider"]=i.control.create(i,g.find(".ui_tpicker_"+s+"_slider"),s,i[s],t[s+"Min"],r[s],t["step"+a]),n&&t[s+"Grid"]>0&&(o=100*l[s]*t[s+"Grid"]/(r[s]-t[s+"Min"]),g.find(".ui_tpicker_"+s+" table").css({width:o+"%",marginLeft:t.isRTL?"0":o/(-2*l[s])+"%",marginRight:t.isRTL?o/(-2*l[s])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(){var e=$(this),t=e.html(),a=parseInt(t.replace(/[^0-9]/g),10),n=t.replace(/[^apm]/gi),r=e.data("for");"hour"===r&&(-1!==n.indexOf("p")&&12>a?a+=12:-1!==n.indexOf("a")&&12===a&&(a=0)),i.control.value(i,i[r+"_slider"],s,a),i._onTimeChange(),i._onSelectHandler()}).css({cursor:"pointer",width:100/l[s]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=g.find(".ui_tpicker_timezone").append("<select></select>").find("select"),$.fn.append.apply(this.timezone_select,$.map(t.timezoneList,function(e){return $("<option />").val("object"==typeof e?e.value:e).text("object"==typeof e?e.label:e)})),this.timezone!==void 0&&null!==this.timezone&&""!==this.timezone){var M=-1*new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12).getTimezoneOffset();M===this.timezone?selectLocalTimezone(i):this.timezone_select.val(this.timezone)}else this.hour!==void 0&&null!==this.hour&&""!==this.hour?this.timezone_select.val(t.timezone):selectLocalTimezone(i);this.timezone_select.change(function(){i._onTimeChange(),i._onSelectHandler()});var v=e.find(".ui-datepicker-buttonpane");if(v.length?v.before(g):e.append(g),this.$timeObj=g.find(".ui_tpicker_time"),null!==this.inst){var k=this.timeDefined;this._onTimeChange(),this.timeDefined=k}if(this._defaults.addSliderAccess){var T=this._defaults.sliderAccessArgs,D=this._defaults.isRTL;T.isRTL=D,setTimeout(function(){if(0===g.find(".ui-slider-access").length){g.find(".ui-slider:visible").sliderAccess(T);var e=g.find(".ui-slider-access:eq(0)").outerWidth(!0);e&&g.find("table:visible").each(function(){var t=$(this),i=t.outerWidth(),s=(""+t.css(D?"marginRight":"marginLeft")).replace("%",""),a=i-e,n=s*a/i+"%",r={width:a,marginRight:0,marginLeft:0};r[D?"marginRight":"marginLeft"]=n,t.css(r)})}},10)}i._limitMinMaxDateTime(this.inst,!0)}},_limitMinMaxDateTime:function(e,t){var i=this._defaults,s=new Date(e.selectedYear,e.selectedMonth,e.selectedDay);if(this._defaults.showTimepicker){if(null!==$.datepicker._get(e,"minDateTime")&&void 0!==$.datepicker._get(e,"minDateTime")&&s){var a=$.datepicker._get(e,"minDateTime"),n=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0);(null===this.hourMinOriginal||null===this.minuteMinOriginal||null===this.secondMinOriginal||null===this.millisecMinOriginal||null===this.microsecMinOriginal)&&(this.hourMinOriginal=i.hourMin,this.minuteMinOriginal=i.minuteMin,this.secondMinOriginal=i.secondMin,this.millisecMinOriginal=i.millisecMin,this.microsecMinOriginal=i.microsecMin),e.settings.timeOnly||n.getTime()===s.getTime()?(this._defaults.hourMin=a.getHours(),this.hour<=this._defaults.hourMin?(this.hour=this._defaults.hourMin,this._defaults.minuteMin=a.getMinutes(),this.minute<=this._defaults.minuteMin?(this.minute=this._defaults.minuteMin,this._defaults.secondMin=a.getSeconds(),this.second<=this._defaults.secondMin?(this.second=this._defaults.secondMin,this._defaults.millisecMin=a.getMilliseconds(),this.millisec<=this._defaults.millisecMin?(this.millisec=this._defaults.millisecMin,this._defaults.microsecMin=a.getMicroseconds()):(this.microsec<this._defaults.microsecMin&&(this.microsec=this._defaults.microsecMin),this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)):(this._defaults.hourMin=this.hourMinOriginal,this._defaults.minuteMin=this.minuteMinOriginal,this._defaults.secondMin=this.secondMinOriginal,this._defaults.millisecMin=this.millisecMinOriginal,this._defaults.microsecMin=this.microsecMinOriginal)}if(null!==$.datepicker._get(e,"maxDateTime")&&void 0!==$.datepicker._get(e,"maxDateTime")&&s){var r=$.datepicker._get(e,"maxDateTime"),l=new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0,0);(null===this.hourMaxOriginal||null===this.minuteMaxOriginal||null===this.secondMaxOriginal||null===this.millisecMaxOriginal)&&(this.hourMaxOriginal=i.hourMax,this.minuteMaxOriginal=i.minuteMax,this.secondMaxOriginal=i.secondMax,this.millisecMaxOriginal=i.millisecMax,this.microsecMaxOriginal=i.microsecMax),e.settings.timeOnly||l.getTime()===s.getTime()?(this._defaults.hourMax=r.getHours(),this.hour>=this._defaults.hourMax?(this.hour=this._defaults.hourMax,this._defaults.minuteMax=r.getMinutes(),this.minute>=this._defaults.minuteMax?(this.minute=this._defaults.minuteMax,this._defaults.secondMax=r.getSeconds(),this.second>=this._defaults.secondMax?(this.second=this._defaults.secondMax,this._defaults.millisecMax=r.getMilliseconds(),this.millisec>=this._defaults.millisecMax?(this.millisec=this._defaults.millisecMax,this._defaults.microsecMax=r.getMicroseconds()):(this.microsec>this._defaults.microsecMax&&(this.microsec=this._defaults.microsecMax),this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)):(this._defaults.hourMax=this.hourMaxOriginal,this._defaults.minuteMax=this.minuteMaxOriginal,this._defaults.secondMax=this.secondMaxOriginal,this._defaults.millisecMax=this.millisecMaxOriginal,this._defaults.microsecMax=this.microsecMaxOriginal)}if(null!==e.settings.minTime){var o=new Date("01/01/1970 "+e.settings.minTime);this.hour<o.getHours()?(this.hour=this._defaults.hourMin=o.getHours(),this.minute=this._defaults.minuteMin=o.getMinutes()):this.hour===o.getHours()&&this.minute<o.getMinutes()?this.minute=this._defaults.minuteMin=o.getMinutes():this._defaults.hourMin<o.getHours()?(this._defaults.hourMin=o.getHours(),this._defaults.minuteMin=o.getMinutes()):this._defaults.minuteMin=this._defaults.hourMin===o.getHours()===this.hour&&this._defaults.minuteMin<o.getMinutes()?o.getMinutes():0}if(null!==e.settings.maxTime){var c=new Date("01/01/1970 "+e.settings.maxTime);this.hour>c.getHours()?(this.hour=this._defaults.hourMax=c.getHours(),this.minute=this._defaults.minuteMax=c.getMinutes()):this.hour===c.getHours()&&this.minute>c.getMinutes()?this.minute=this._defaults.minuteMax=c.getMinutes():this._defaults.hourMax>c.getHours()?(this._defaults.hourMax=c.getHours(),this._defaults.minuteMax=c.getMinutes()):this._defaults.minuteMax=this._defaults.hourMax===c.getHours()===this.hour&&this._defaults.minuteMax>c.getMinutes()?c.getMinutes():59}if(void 0!==t&&t===!0){var u=parseInt(this._defaults.hourMax-(this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour,10),m=parseInt(this._defaults.minuteMax-(this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute,10),d=parseInt(this._defaults.secondMax-(this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond,10),h=parseInt(this._defaults.millisecMax-(this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec,10),p=parseInt(this._defaults.microsecMax-(this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec,10);this.hour_slider&&(this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:u,step:this._defaults.stepHour}),this.control.value(this,this.hour_slider,"hour",this.hour-this.hour%this._defaults.stepHour)),this.minute_slider&&(this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:m,step:this._defaults.stepMinute}),this.control.value(this,this.minute_slider,"minute",this.minute-this.minute%this._defaults.stepMinute)),this.second_slider&&(this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:d,step:this._defaults.stepSecond}),this.control.value(this,this.second_slider,"second",this.second-this.second%this._defaults.stepSecond)),this.millisec_slider&&(this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:h,step:this._defaults.stepMillisec}),this.control.value(this,this.millisec_slider,"millisec",this.millisec-this.millisec%this._defaults.stepMillisec)),this.microsec_slider&&(this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:p,step:this._defaults.stepMicrosec}),this.control.value(this,this.microsec_slider,"microsec",this.microsec-this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(this._defaults.showTimepicker){var e=this.hour_slider?this.control.value(this,this.hour_slider,"hour"):!1,t=this.minute_slider?this.control.value(this,this.minute_slider,"minute"):!1,i=this.second_slider?this.control.value(this,this.second_slider,"second"):!1,s=this.millisec_slider?this.control.value(this,this.millisec_slider,"millisec"):!1,a=this.microsec_slider?this.control.value(this,this.microsec_slider,"microsec"):!1,n=this.timezone_select?this.timezone_select.val():!1,r=this._defaults,l=r.pickerTimeFormat||r.timeFormat,o=r.pickerTimeSuffix||r.timeSuffix;"object"==typeof e&&(e=!1),"object"==typeof t&&(t=!1),"object"==typeof i&&(i=!1),"object"==typeof s&&(s=!1),"object"==typeof a&&(a=!1),"object"==typeof n&&(n=!1),e!==!1&&(e=parseInt(e,10)),t!==!1&&(t=parseInt(t,10)),i!==!1&&(i=parseInt(i,10)),s!==!1&&(s=parseInt(s,10)),a!==!1&&(a=parseInt(a,10)),n!==!1&&(n=""+n);var c=r[12>e?"amNames":"pmNames"][0],u=e!==parseInt(this.hour,10)||t!==parseInt(this.minute,10)||i!==parseInt(this.second,10)||s!==parseInt(this.millisec,10)||a!==parseInt(this.microsec,10)||this.ampm.length>0&&12>e!=(-1!==$.inArray(this.ampm.toUpperCase(),this.amNames))||null!==this.timezone&&n!==""+this.timezone;u&&(e!==!1&&(this.hour=e),t!==!1&&(this.minute=t),i!==!1&&(this.second=i),s!==!1&&(this.millisec=s),a!==!1&&(this.microsec=a),n!==!1&&(this.timezone=n),this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),this._limitMinMaxDateTime(this.inst,!0)),this.support.ampm&&(this.ampm=c),this.formattedTime=$.datepicker.formatTime(r.timeFormat,this,r),this.$timeObj&&(l===r.timeFormat?this.$timeObj.text(this.formattedTime+o):this.$timeObj.text($.datepicker.formatTime(l,this,r)+o)),this.timeDefined=!0,u&&this._updateDateTime()}},_onSelectHandler:function(){var e=this._defaults.onSelect||this.inst.settings.onSelect,t=this.$input?this.$input[0]:null;e&&t&&e.apply(t,[this.formattedDateTime,this])},_updateDateTime:function(e){e=this.inst||e;var t=e.currentYear>0?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(e.selectedYear,e.selectedMonth,e.selectedDay),i=$.datepicker._daylightSavingAdjust(t),s=$.datepicker._get(e,"dateFormat"),a=$.datepicker._getFormatConfig(e),n=null!==i&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(s,null===i?new Date:i,a);var r=this.formattedDate;if(""===e.lastVal&&(e.currentYear=e.selectedYear,e.currentMonth=e.selectedMonth,e.currentDay=e.selectedDay),this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!1?r=this.formattedTime:(this._defaults.timeOnly!==!0&&(this._defaults.alwaysSetTime||n)||this._defaults.timeOnly===!0&&this._defaults.timeOnlyShowDate===!0)&&(r+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix),this.formattedDateTime=r,this._defaults.showTimepicker)if(this.$altInput&&this._defaults.timeOnly===!1&&this._defaults.altFieldTimeOnly===!0)this.$altInput.val(this.formattedTime),this.$input.val(this.formattedDate);else if(this.$altInput){this.$input.val(r);var l="",o=null!==this._defaults.altSeparator?this._defaults.altSeparator:this._defaults.separator,c=null!==this._defaults.altTimeSuffix?this._defaults.altTimeSuffix:this._defaults.timeSuffix;this._defaults.timeOnly||(l=this._defaults.altFormat?$.datepicker.formatDate(this._defaults.altFormat,null===i?new Date:i,a):this.formattedDate,l&&(l+=o)),l+=null!==this._defaults.altTimeFormat?$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+c:this.formattedTime+c,this.$altInput.val(l)}else this.$input.val(r);else this.$input.val(this.formattedDate);this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var e=$.datepicker._getInst(this.$input.get(0)),t=$.datepicker._get(e,"timepicker");if(t&&t._defaults.timeOnly&&e.input.val()!==e.lastVal)try{$.datepicker._updateDatepicker(e)}catch(i){$.timepicker.log(i)}}},_controls:{slider:{create:function(e,t,i,s,a,n,r){var l=e._defaults.isRTL;return t.prop("slide",null).slider({orientation:"horizontal",value:l?-1*s:s,min:l?-1*n:a,max:l?-1*a:n,step:r,slide:function(t,s){e.control.value(e,$(this),i,l?-1*s.value:s.value),e._onTimeChange()},stop:function(){e._onSelectHandler()}})},options:function(e,t,i,s,a){if(e._defaults.isRTL){if("string"==typeof s)return"min"===s||"max"===s?void 0!==a?t.slider(s,-1*a):Math.abs(t.slider(s)):t.slider(s);var n=s.min,r=s.max;return s.min=s.max=null,void 0!==n&&(s.max=-1*n),void 0!==r&&(s.min=-1*r),t.slider(s)}return"string"==typeof s&&void 0!==a?t.slider(s,a):t.slider(s)},value:function(e,t,i,s){return e._defaults.isRTL?void 0!==s?t.slider("value",-1*s):Math.abs(t.slider("value")):void 0!==s?t.slider("value",s):t.slider("value")}},select:{create:function(e,t,i,s,a,n,r){for(var l='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+i+'" data-min="'+a+'" data-max="'+n+'" data-step="'+r+'">',o=e._defaults.pickerTimeFormat||e._defaults.timeFormat,c=a;n>=c;c+=r)l+='<option value="'+c+'"'+(c===s?" selected":"")+">",l+="hour"===i?$.datepicker.formatTime($.trim(o.replace(/[^ht ]/gi,"")),{hour:c},e._defaults):"millisec"===i||"microsec"===i||c>=10?c:"0"+(""+c),l+="</option>";return l+="</select>",t.children("select").remove(),$(l).appendTo(t).change(function(){e._onTimeChange(),e._onSelectHandler()}),t},options:function(e,t,i,s,a){var n={},r=t.children("select");if("string"==typeof s){if(void 0===a)return r.data(s);n[s]=a}else n=s;return e.control.create(e,t,r.data("unit"),r.val(),n.min||r.data("min"),n.max||r.data("max"),n.step||r.data("step"))},value:function(e,t,i,s){var a=t.children("select");return void 0!==s?a.val(s):a.val()}}}}),$.fn.extend({timepicker:function(e){e=e||{};var t=Array.prototype.slice.call(arguments);return"object"==typeof e&&(t[0]=$.extend(e,{timeOnly:!0})),$(this).each(function(){$.fn.datetimepicker.apply($(this),t)})},datetimepicker:function(e){e=e||{};var t=arguments;return"string"==typeof e?"getDate"===e||"option"===e&&2===t.length&&"string"==typeof t[1]?$.fn.datepicker.apply($(this[0]),t):this.each(function(){var e=$(this);e.datepicker.apply(e,t)}):this.each(function(){var t=$(this);t.datepicker($.timepicker._newInst(t,e)._defaults)})}}),$.datepicker.parseDateTime=function(e,t,i,s,a){var n=parseDateTimeInternal(e,t,i,s,a);if(n.timeObj){var r=n.timeObj;n.date.setHours(r.hour,r.minute,r.second,r.millisec),n.date.setMicroseconds(r.microsec)}return n.date},$.datepicker.parseTime=function(e,t,i){var s=extendRemove(extendRemove({},$.timepicker._defaults),i||{});-1!==e.replace(/\'.*?\'/g,"").indexOf("Z");var a=function(e,t,i){var s,a=function(e,t){var i=[];return e&&$.merge(i,e),t&&$.merge(i,t),i=$.map(i,function(e){return e.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")}),"("+i.join("|")+")?"},n=function(e){var t=e.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),i={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(t)for(var s=0;t.length>s;s++)-1===i[(""+t[s]).charAt(0)]&&(i[(""+t[s]).charAt(0)]=s+1);return i},r="^"+(""+e).replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){var t=e.length;switch(e.charAt(0).toLowerCase()){case"h":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"m":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"s":return 1===t?"(\\d?\\d)":"(\\d{"+t+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return a(i.amNames,i.pmNames);default:return"("+e.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(e){return"\\"+e})+")?"}}).replace(/\s/g,"\\s?")+i.timeSuffix+"$",l=n(e),o="";s=t.match(RegExp(r,"i"));var c={hour:0,minute:0,second:0,millisec:0,microsec:0};return s?(-1!==l.t&&(void 0===s[l.t]||0===s[l.t].length?(o="",c.ampm=""):(o=-1!==$.inArray(s[l.t].toUpperCase(),i.amNames)?"AM":"PM",c.ampm=i["AM"===o?"amNames":"pmNames"][0])),-1!==l.h&&(c.hour="AM"===o&&"12"===s[l.h]?0:"PM"===o&&"12"!==s[l.h]?parseInt(s[l.h],10)+12:Number(s[l.h])),-1!==l.m&&(c.minute=Number(s[l.m])),-1!==l.s&&(c.second=Number(s[l.s])),-1!==l.l&&(c.millisec=Number(s[l.l])),-1!==l.c&&(c.microsec=Number(s[l.c])),-1!==l.z&&void 0!==s[l.z]&&(c.timezone=$.timepicker.timezoneOffsetNumber(s[l.z])),c):!1},n=function(e,t,i){try{var s=new Date("2012-01-01 "+t);if(isNaN(s.getTime())&&(s=new Date("2012-01-01T"+t),isNaN(s.getTime())&&(s=new Date("01/01/2012 "+t),isNaN(s.getTime()))))throw"Unable to parse time with native Date: "+t;return{hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),millisec:s.getMilliseconds(),microsec:s.getMicroseconds(),timezone:-1*s.getTimezoneOffset()}}catch(n){try{return a(e,t,i)}catch(r){$.timepicker.log("Unable to parse \ntimeString: "+t+"\ntimeFormat: "+e)}}return!1};return"function"==typeof s.parse?s.parse(e,t,s):"loose"===s.parse?n(e,t,s):a(e,t,s)},$.datepicker.formatTime=function(e,t,i){i=i||{},i=$.extend({},$.timepicker._defaults,i),t=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},t);var s=e,a=i.amNames[0],n=parseInt(t.hour,10);return n>11&&(a=i.pmNames[0]),s=s.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(e){switch(e){case"HH":return("0"+n).slice(-2);case"H":return n;case"hh":return("0"+convert24to12(n)).slice(-2);case"h":return convert24to12(n);case"mm":return("0"+t.minute).slice(-2);case"m":return t.minute;case"ss":return("0"+t.second).slice(-2);case"s":return t.second;case"l":return("00"+t.millisec).slice(-3);case"c":return("00"+t.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!1);case"Z":return $.timepicker.timezoneOffsetString(null===t.timezone?i.timezone:t.timezone,!0);case"T":return a.charAt(0).toUpperCase();case"TT":return a.toUpperCase();case"t":return a.charAt(0).toLowerCase();case"tt":return a.toLowerCase();default:return e.replace(/'/g,"")}})},$.datepicker._base_selectDate=$.datepicker._selectDate,$.datepicker._selectDate=function(e,t){var i,s=this._getInst($(e)[0]),a=this._get(s,"timepicker");a&&s.settings.showTimepicker?(a._limitMinMaxDateTime(s,!0),i=s.inline,s.inline=s.stay_open=!0,this._base_selectDate(e,t),s.inline=i,s.stay_open=!1,this._notifyChange(s),this._updateDatepicker(s)):this._base_selectDate(e,t)},$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker,$.datepicker._updateDatepicker=function(e){var t=e.input[0];if(!($.datepicker._curInst&&$.datepicker._curInst!==e&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==t||"boolean"==typeof e.stay_open&&e.stay_open!==!1)){this._base_updateDatepicker(e);var i=this._get(e,"timepicker");i&&i._addTimePicker(e)}},$.datepicker._base_doKeyPress=$.datepicker._doKeyPress,$.datepicker._doKeyPress=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&$.datepicker._get(t,"constrainInput")){var s=i.support.ampm,a=null!==i._defaults.showTimezone?i._defaults.showTimezone:i.support.timezone,n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=(""+i._defaults.timeFormat).replace(/[hms]/g,"").replace(/TT/g,s?"APM":"").replace(/Tt/g,s?"AaPpMm":"").replace(/tT/g,s?"AaPpMm":"").replace(/T/g,s?"AP":"").replace(/tt/g,s?"apm":"").replace(/t/g,s?"ap":"")+" "+i._defaults.separator+i._defaults.timeSuffix+(a?i._defaults.timezoneList.join(""):"")+i._defaults.amNames.join("")+i._defaults.pmNames.join("")+n,l=String.fromCharCode(void 0===e.charCode?e.keyCode:e.charCode);return e.ctrlKey||" ">l||!n||r.indexOf(l)>-1}return $.datepicker._base_doKeyPress(e)},$.datepicker._base_updateAlternate=$.datepicker._updateAlternate,$.datepicker._updateAlternate=function(e){var t=this._get(e,"timepicker");if(t){var i=t._defaults.altField;if(i){var s=(t._defaults.altFormat||t._defaults.dateFormat,this._getDate(e)),a=$.datepicker._getFormatConfig(e),n="",r=t._defaults.altSeparator?t._defaults.altSeparator:t._defaults.separator,l=t._defaults.altTimeSuffix?t._defaults.altTimeSuffix:t._defaults.timeSuffix,o=null!==t._defaults.altTimeFormat?t._defaults.altTimeFormat:t._defaults.timeFormat;n+=$.datepicker.formatTime(o,t,t._defaults)+l,t._defaults.timeOnly||t._defaults.altFieldTimeOnly||null===s||(n=t._defaults.altFormat?$.datepicker.formatDate(t._defaults.altFormat,s,a)+r+n:t.formattedDate+r+n),$(i).val(e.input.val()?n:"")}}else $.datepicker._base_updateAlternate(e)},$.datepicker._base_doKeyUp=$.datepicker._doKeyUp,$.datepicker._doKeyUp=function(e){var t=$.datepicker._getInst(e.target),i=$.datepicker._get(t,"timepicker");if(i&&i._defaults.timeOnly&&t.input.val()!==t.lastVal)try{$.datepicker._updateDatepicker(t)}catch(s){$.timepicker.log(s)}return $.datepicker._base_doKeyUp(e)},$.datepicker._base_gotoToday=$.datepicker._gotoToday,$.datepicker._gotoToday=function(e){var t=this._getInst($(e)[0]);t.dpDiv,this._base_gotoToday(e);var i=this._get(t,"timepicker");selectLocalTimezone(i);var s=new Date;this._setTime(t,s),this._setDate(t,s)},$.datepicker._disableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!1,i._defaults.showTimepicker=!1,i._updateDateTime(t))}},$.datepicker._enableTimepickerDatepicker=function(e){var t=this._getInst(e);if(t){var i=this._get(t,"timepicker");$(e).datepicker("getDate"),i&&(t.settings.showTimepicker=!0,i._defaults.showTimepicker=!0,i._addTimePicker(t),i._updateDateTime(t))}},$.datepicker._setTime=function(e,t){var i=this._get(e,"timepicker");if(i){var s=i._defaults;
+i.hour=t?t.getHours():s.hour,i.minute=t?t.getMinutes():s.minute,i.second=t?t.getSeconds():s.second,i.millisec=t?t.getMilliseconds():s.millisec,i.microsec=t?t.getMicroseconds():s.microsec,i._limitMinMaxDateTime(e,!0),i._onTimeChange(),i._updateDateTime(e)}},$.datepicker._setTimeDatepicker=function(e,t,i){var s=this._getInst(e);if(s){var a=this._get(s,"timepicker");if(a){this._setDateFromField(s);var n;t&&("string"==typeof t?(a._parseTime(t,i),n=new Date,n.setHours(a.hour,a.minute,a.second,a.millisec),n.setMicroseconds(a.microsec)):(n=new Date(t.getTime()),n.setMicroseconds(t.getMicroseconds())),"Invalid Date"==""+n&&(n=void 0),this._setTime(s,n))}}},$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker,$.datepicker._setDateDatepicker=function(e,t){var i=this._getInst(e),s=t;if(i){"string"==typeof t&&(s=new Date(t),s.getTime()||(this._base_setDateDatepicker.apply(this,arguments),s=$(e).datepicker("getDate")));var a,n=this._get(i,"timepicker");s instanceof Date?(a=new Date(s.getTime()),a.setMicroseconds(s.getMicroseconds())):a=s,n&&a&&(n.support.timezone||null!==n._defaults.timezone||(n.timezone=-1*a.getTimezoneOffset()),s=$.timepicker.timezoneAdjust(s,n.timezone),a=$.timepicker.timezoneAdjust(a,n.timezone)),this._updateDatepicker(i),this._base_setDateDatepicker.apply(this,arguments),this._setTimeDatepicker(e,a,!0)}},$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker,$.datepicker._getDateDatepicker=function(e,t){var i=this._getInst(e);if(i){var s=this._get(i,"timepicker");if(s){void 0===i.lastVal&&this._setDateFromField(i,t);var a=this._getDate(i);return a&&s._parseTime($(e).val(),s.timeOnly)&&(a.setHours(s.hour,s.minute,s.second,s.millisec),a.setMicroseconds(s.microsec),null!=s.timezone&&(s.support.timezone||null!==s._defaults.timezone||(s.timezone=-1*a.getTimezoneOffset()),a=$.timepicker.timezoneAdjust(a,s.timezone))),a}return this._base_getDateDatepicker(e,t)}},$.datepicker._base_parseDate=$.datepicker.parseDate,$.datepicker.parseDate=function(e,t,i){var s;try{s=this._base_parseDate(e,t,i)}catch(a){if(!(a.indexOf(":")>=0))throw a;s=this._base_parseDate(e,t.substring(0,t.length-(a.length-a.indexOf(":")-2)),i),$.timepicker.log("Error parsing the date string: "+a+"\ndate string = "+t+"\ndate format = "+e)}return s},$.datepicker._base_formatDate=$.datepicker._formatDate,$.datepicker._formatDate=function(e){var t=this._get(e,"timepicker");return t?(t._updateDateTime(e),t.$input.val()):this._base_formatDate(e)},$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker,$.datepicker._optionDatepicker=function(e,t,i){var s,a=this._getInst(e);if(!a)return null;var n=this._get(a,"timepicker");if(n){var r,l,o,c,u=null,m=null,d=null,h=n._defaults.evnts,p={};if("string"==typeof t){if("minDate"===t||"minDateTime"===t)u=i;else if("maxDate"===t||"maxDateTime"===t)m=i;else if("onSelect"===t)d=i;else if(h.hasOwnProperty(t)){if(i===void 0)return h[t];p[t]=i,s={}}}else if("object"==typeof t){t.minDate?u=t.minDate:t.minDateTime?u=t.minDateTime:t.maxDate?m=t.maxDate:t.maxDateTime&&(m=t.maxDateTime);for(r in h)h.hasOwnProperty(r)&&t[r]&&(p[r]=t[r])}for(r in p)p.hasOwnProperty(r)&&(h[r]=p[r],s||(s=$.extend({},t)),delete s[r]);if(s&&isEmptyObject(s))return;if(u?(u=0===u?new Date:new Date(u),n._defaults.minDate=u,n._defaults.minDateTime=u):m?(m=0===m?new Date:new Date(m),n._defaults.maxDate=m,n._defaults.maxDateTime=m):d&&(n._defaults.onSelect=d),u||m)return c=$(e),o=c.datetimepicker("getDate"),l=this._base_optionDatepicker.call($.datepicker,e,s||t,i),c.datetimepicker("setDate",o),l}return void 0===i?this._base_optionDatepicker.call($.datepicker,e,t):this._base_optionDatepicker.call($.datepicker,e,s||t,i)};var isEmptyObject=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0},extendRemove=function(e,t){$.extend(e,t);for(var i in t)(null===t[i]||void 0===t[i])&&(e[i]=t[i]);return e},detectSupport=function(e){var t=e.replace(/'.*?'/g,"").toLowerCase(),i=function(e,t){return-1!==e.indexOf(t)?!0:!1};return{hour:i(t,"h"),minute:i(t,"m"),second:i(t,"s"),millisec:i(t,"l"),microsec:i(t,"c"),timezone:i(t,"z"),ampm:i(t,"t")&&i(e,"h"),iso8601:i(e,"Z")}},convert24to12=function(e){return e%=12,0===e&&(e=12),e+""},computeEffectiveSetting=function(e,t){return e&&e[t]?e[t]:$.timepicker._defaults[t]},splitDateTime=function(e,t){var i=computeEffectiveSetting(t,"separator"),s=computeEffectiveSetting(t,"timeFormat"),a=s.split(i),n=a.length,r=e.split(i),l=r.length;return l>1?{dateString:r.splice(0,l-n).join(i),timeString:r.splice(0,n).join(i)}:{dateString:e,timeString:""}},parseDateTimeInternal=function(e,t,i,s,a){var n,r,l;if(r=splitDateTime(i,a),n=$.datepicker._base_parseDate(e,r.dateString,s),""===r.timeString)return{date:n};if(l=$.datepicker.parseTime(t,r.timeString,a),!l)throw"Wrong time format";return{date:n,timeObj:l}},selectLocalTimezone=function(e,t){if(e&&e.timezone_select){var i=t||new Date;e.timezone_select.val(-i.getTimezoneOffset())}};$.timepicker=new Timepicker,$.timepicker.timezoneOffsetString=function(e,t){if(isNaN(e)||e>840||-720>e)return e;var i=e,s=i%60,a=(i-s)/60,n=t?":":"",r=(i>=0?"+":"-")+("0"+Math.abs(a)).slice(-2)+n+("0"+Math.abs(s)).slice(-2);return"+00:00"===r?"Z":r},$.timepicker.timezoneOffsetNumber=function(e){var t=(""+e).replace(":","");return"Z"===t.toUpperCase()?0:/^(\-|\+)\d{4}$/.test(t)?("-"===t.substr(0,1)?-1:1)*(60*parseInt(t.substr(1,2),10)+parseInt(t.substr(3,2),10)):e},$.timepicker.timezoneAdjust=function(e,t){var i=$.timepicker.timezoneOffsetNumber(t);return isNaN(i)||e.setMinutes(e.getMinutes()+-e.getTimezoneOffset()-i),e},$.timepicker.timeRange=function(e,t,i){return $.timepicker.handleRange("timepicker",e,t,i)},$.timepicker.datetimeRange=function(e,t,i){$.timepicker.handleRange("datetimepicker",e,t,i)},$.timepicker.dateRange=function(e,t,i){$.timepicker.handleRange("datepicker",e,t,i)},$.timepicker.handleRange=function(e,t,i,s){function a(a,n){var r=t[e]("getDate"),l=i[e]("getDate"),o=a[e]("getDate");if(null!==r){var c=new Date(r.getTime()),u=new Date(r.getTime());c.setMilliseconds(c.getMilliseconds()+s.minInterval),u.setMilliseconds(u.getMilliseconds()+s.maxInterval),s.minInterval>0&&c>l?i[e]("setDate",c):s.maxInterval>0&&l>u?i[e]("setDate",u):r>l&&n[e]("setDate",o)}}function n(t,i,a){if(t.val()){var n=t[e].call(t,"getDate");null!==n&&s.minInterval>0&&("minDate"===a&&n.setMilliseconds(n.getMilliseconds()+s.minInterval),"maxDate"===a&&n.setMilliseconds(n.getMilliseconds()-s.minInterval)),n.getTime&&i[e].call(i,"option",a,n)}}s=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},s);var r=!1;return"timepicker"===e&&(r=!0,e="datetimepicker"),$.fn[e].call(t,$.extend({timeOnly:r,onClose:function(){a($(this),i)},onSelect:function(){n($(this),i,"minDate")}},s,s.start)),$.fn[e].call(i,$.extend({timeOnly:r,onClose:function(){a($(this),t)},onSelect:function(){n($(this),t,"maxDate")}},s,s.end)),a(t,i),n(t,i,"minDate"),n(i,t,"maxDate"),$([t.get(0),i.get(0)])},$.timepicker.log=function(){window.console&&window.console.log.apply(window.console,Array.prototype.slice.call(arguments))},$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal},Date.prototype.getMicroseconds||(Date.prototype.microseconds=0,Date.prototype.getMicroseconds=function(){return this.microseconds},Date.prototype.setMicroseconds=function(e){return this.setMilliseconds(this.getMilliseconds()+Math.floor(e/1e3)),this.microseconds=e%1e3,this}),$.timepicker.version="1.5.0"}})(jQuery);/*!
+ * jQuery UI Touch Punch 0.2.3
+ *
+ * Copyright 2011–2014, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ */
+!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*!
+ * jQuery Scrollstop Plugin v1.1.0
+ * https://github.com/ssorallen/jquery-scrollstop
+ */
+(function(e){var b=e.event.dispatch||e.event.handle;var a=e.event.special,d="D"+(+new Date()),c="D"+(+new Date()+1);a.scrollstart={setup:function(h){var g=e.extend({latency:a.scrollstop.latency},h);var i,f=function(l){var j=this,k=arguments;if(i){clearTimeout(i)}else{l.type="scrollstart";b.apply(j,k)}i=setTimeout(function(){i=null},g.latency)};e(this).bind("scroll",f).data(d,f)},teardown:function(){e(this).unbind("scroll",e(this).data(d))}};a.scrollstop={latency:250,setup:function(h){var g=e.extend({latency:a.scrollstop.latency},h);var i,f=function(l){var j=this,k=arguments;if(i){clearTimeout(i)}i=setTimeout(function(){i=null;l.type="scrollstop";b.apply(j,k)},g.latency)};e(this).bind("scroll",f).data(c,f)},teardown:function(){e(this).unbind("scroll",e(this).data(c))}}})(jQuery);// project home: https://github.com/gorhill/yamd5.js
+// minified using http://refresh-sf.com/yui/
+;(function(g){var b=function(l,n){var m=l[0],j=l[1],p=l[2],o=l[3];m+=(j&p|~j&o)+n[0]-680876936|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[1]-389564586|0;
+o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[2]+606105819|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[3]-1044525330|0;j=(j<<22|j>>>10)+p|0;
+m+=(j&p|~j&o)+n[4]-176418897|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[5]+1200080426|0;o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[6]-1473231341|0;
+p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[7]-45705983|0;j=(j<<22|j>>>10)+p|0;m+=(j&p|~j&o)+n[8]+1770035416|0;m=(m<<7|m>>>25)+j|0;
+o+=(m&j|~m&p)+n[9]-1958414417|0;o=(o<<12|o>>>20)+m|0;p+=(o&m|~o&j)+n[10]-42063|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[11]-1990404162|0;
+j=(j<<22|j>>>10)+p|0;m+=(j&p|~j&o)+n[12]+1804603682|0;m=(m<<7|m>>>25)+j|0;o+=(m&j|~m&p)+n[13]-40341101|0;o=(o<<12|o>>>20)+m|0;
+p+=(o&m|~o&j)+n[14]-1502002290|0;p=(p<<17|p>>>15)+o|0;j+=(p&o|~p&m)+n[15]+1236535329|0;j=(j<<22|j>>>10)+p|0;m+=(j&o|p&~o)+n[1]-165796510|0;
+m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[6]-1069501632|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[11]+643717713|0;p=(p<<14|p>>>18)+o|0;
+j+=(p&m|o&~m)+n[0]-373897302|0;j=(j<<20|j>>>12)+p|0;m+=(j&o|p&~o)+n[5]-701558691|0;m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[10]+38016083|0;
+o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[15]-660478335|0;p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[4]-405537848|0;j=(j<<20|j>>>12)+p|0;
+m+=(j&o|p&~o)+n[9]+568446438|0;m=(m<<5|m>>>27)+j|0;o+=(m&p|j&~p)+n[14]-1019803690|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[3]-187363961|0;
+p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[8]+1163531501|0;j=(j<<20|j>>>12)+p|0;m+=(j&o|p&~o)+n[13]-1444681467|0;m=(m<<5|m>>>27)+j|0;
+o+=(m&p|j&~p)+n[2]-51403784|0;o=(o<<9|o>>>23)+m|0;p+=(o&j|m&~j)+n[7]+1735328473|0;p=(p<<14|p>>>18)+o|0;j+=(p&m|o&~m)+n[12]-1926607734|0;
+j=(j<<20|j>>>12)+p|0;m+=(j^p^o)+n[5]-378558|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[8]-2022574463|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[11]+1839030562|0;
+p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[14]-35309556|0;j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[1]-1530992060|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[4]+1272893353|0;
+o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[7]-155497632|0;p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[10]-1094730640|0;j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[13]+681279174|0;
+m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[0]-358537222|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[3]-722521979|0;p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[6]+76029189|0;
+j=(j<<23|j>>>9)+p|0;m+=(j^p^o)+n[9]-640364487|0;m=(m<<4|m>>>28)+j|0;o+=(m^j^p)+n[12]-421815835|0;o=(o<<11|o>>>21)+m|0;p+=(o^m^j)+n[15]+530742520|0;
+p=(p<<16|p>>>16)+o|0;j+=(p^o^m)+n[2]-995338651|0;j=(j<<23|j>>>9)+p|0;m+=(p^(j|~o))+n[0]-198630844|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[7]+1126891415|0;
+o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[14]-1416354905|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[5]-57434055|0;j=(j<<21|j>>>11)+p|0;
+m+=(p^(j|~o))+n[12]+1700485571|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[3]-1894986606|0;o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[10]-1051523|0;
+p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[1]-2054922799|0;j=(j<<21|j>>>11)+p|0;m+=(p^(j|~o))+n[8]+1873313359|0;m=(m<<6|m>>>26)+j|0;
+o+=(j^(m|~p))+n[15]-30611744|0;o=(o<<10|o>>>22)+m|0;p+=(m^(o|~j))+n[6]-1560198380|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[13]+1309151649|0;
+j=(j<<21|j>>>11)+p|0;m+=(p^(j|~o))+n[4]-145523070|0;m=(m<<6|m>>>26)+j|0;o+=(j^(m|~p))+n[11]-1120210379|0;o=(o<<10|o>>>22)+m|0;
+p+=(m^(o|~j))+n[2]+718787259|0;p=(p<<15|p>>>17)+o|0;j+=(o^(p|~m))+n[9]-343485551|0;j=(j<<21|j>>>11)+p|0;l[0]=m+l[0]|0;l[1]=j+l[1]|0;
+l[2]=p+l[2]|0;l[3]=o+l[3]|0};var e="0123456789abcdef";var d=[];var c=function(k){var q=e;var o=d;var r,p,l;for(var m=0;m<4;
+m++){p=m*8;r=k[m];for(l=0;l<8;l+=2){o[p+1+l]=q.charAt(r&15);r>>>=4;o[p+0+l]=q.charAt(r&15);r>>>=4}}return o.join("")};var i=function(){this._dataLength=0;
+this._state=new Int32Array(4);this._buffer=new ArrayBuffer(68);this._bufferLength=0;this._buffer8=new Uint8Array(this._buffer,0,68);
+this._buffer32=new Uint32Array(this._buffer,0,17);this.start()};var a=new Int32Array([1732584193,-271733879,-1732584194,271733878]);
+var h=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);i.prototype.appendStr=function(n){var k=this._buffer8;var j=this._buffer32;
+var o=this._bufferLength;var m;for(var l=0;l<n.length;l++){m=n.charCodeAt(l);if(m<128){k[o++]=m}else{if(m<2048){k[o++]=(m>>>6)+192;
+k[o++]=m&63|128}else{if(m<55296||m>56319){k[o++]=(m>>>12)+224;k[o++]=(m>>>6&63)|128;k[o++]=(m&63)|128}else{m=((m-55296)*1024)+(n.charCodeAt(++l)-56320)+65536;
+if(m>1114111){throw"Unicode standard supports code points up to U+10FFFF"}k[o++]=(m>>>18)+240;k[o++]=(m>>>12&63)|128;k[o++]=(m>>>6&63)|128;
+k[o++]=(m&63)|128}}}if(o>=64){this._dataLength+=64;b(this._state,j);o-=64;j[0]=j[16]}}this._bufferLength=o;return this};i.prototype.appendAsciiStr=function(o){var l=this._buffer8;
+var k=this._buffer32;var p=this._bufferLength;var n,m=0;for(;;){n=Math.min(o.length-m,64-p);while(n--){l[p++]=o.charCodeAt(m++)
+}if(p<64){break}this._dataLength+=64;b(this._state,k);p=0}this._bufferLength=p;return this};i.prototype.appendByteArray=function(m){var l=this._buffer8;
+var k=this._buffer32;var p=this._bufferLength;var o,n=0;for(;;){o=Math.min(m.length-n,64-p);while(o--){l[p++]=m[n++]}if(p<64){break
+}this._dataLength+=64;b(this._state,k);p=0}this._bufferLength=p;return this};i.prototype.start=function(){this._dataLength=0;
+this._bufferLength=0;this._state.set(a);return this};i.prototype.end=function(p){var q=this._bufferLength;this._dataLength+=q;
+var r=this._buffer8;r[q]=128;r[q+1]=r[q+2]=r[q+3]=0;var k=this._buffer32;var m=(q>>2)+1;k.set(h.subarray(m),m);if(q>55){b(this._state,k);
+k.set(h)}var j=this._dataLength*8;if(j<=4294967295){k[14]=j}else{var n=j.toString(16).match(/(.*?)(.{0,8})$/);var o=parseInt(n[2],16);
+var l=parseInt(n[1],16)||0;k[14]=o;k[15]=l}b(this._state,k);return !!p?this._state:c(this._state)};var f=new i();i.hashStr=function(k,j){return f.start().appendStr(k).end(j)
+};i.hashAsciiStr=function(k,j){return f.start().appendAsciiStr(k).end(j)};if(i.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"){console.error("YaMD5> this javascript engine does not support YaMD5. Sorry.")
+}if(typeof g==="object"){g.YaMD5=i}return i})(this); \ No newline at end of file
diff --git a/http/www/epgd.css b/http/www/epgd.css
new file mode 100644
index 0000000..e6127ed
--- /dev/null
+++ b/http/www/epgd.css
@@ -0,0 +1,1554 @@
+/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
+/*! HTML5 Boilerplate v5.0 | MIT License | http://h5bp.com/ */html{color:#222;font-size:1em;line-height:1.4}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}audio,canvas,iframe,img,svg,video{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.browserupgrade{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}
+/*! jQuery UI - v1.11.4 - 2015-11-19
+* http://jqueryui.com
+* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, spinner.css, tabs.css, tooltip.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=cb842e&bgTextureHeader=glass&bgImgOpacityHeader=25&borderColorHeader=d49768&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=f4f0ec&bgTextureContent=inset_soft&bgImgOpacityContent=100&borderColorContent=e0cfc2&fcContent=1e1b1d&iconColorContent=c47a23&bgColorDefault=ede4d4&bgTextureDefault=glass&bgImgOpacityDefault=70&borderColorDefault=cdc3b7&fcDefault=3f3731&iconColorDefault=f08000&bgColorHover=f5f0e5&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=f5ad66&fcHover=a46313&iconColorHover=f08000&bgColorActive=f4f0ec&bgTextureActive=highlight_hard&bgImgOpacityActive=100&borderColorActive=e0cfc2&fcActive=b85700&iconColorActive=f35f07&bgColorHighlight=f5f5b5&bgTextureHighlight=highlight_hard&bgImgOpacityHighlight=75&borderColorHighlight=d9bb73&fcHighlight=060200&iconColorHighlight=cb672b&bgColorError=fee4bd&bgTextureError=highlight_hard&bgImgOpacityError=65&borderColorError=f8893f&fcError=592003&iconColorError=ff7519&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=75&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Helvetica,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Helvetica,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_inset-soft_100_f4f0ec_1x100.png") 50% bottom repeat-x;color:#1e1b1d}.ui-widget-content a{color:#1e1b1d}.ui-widget-header{border:1px solid #d49768;background:#cb842e url("images/ui-bg_glass_25_cb842e_1x400.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #cdc3b7;background:#ede4d4 url("images/ui-bg_glass_70_ede4d4_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#3f3731}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#3f3731;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #f5ad66;background:#f5f0e5 url("images/ui-bg_glass_100_f5f0e5_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#a46313}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#a46313;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #e0cfc2;background:#f4f0ec url("images/ui-bg_highlight-hard_100_f4f0ec_1x100.png") 50% 50% repeat-x;font-weight:normal;color:#b85700}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#b85700;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #d9bb73;background:#f5f5b5 url("images/ui-bg_highlight-hard_75_f5f5b5_1x100.png") 50% top repeat-x;color:#060200}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#060200}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f8893f;background:#fee4bd url("images/ui-bg_highlight-hard_65_fee4bd_1x100.png") 50% top repeat-x;color:#592003}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#592003}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#592003}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_c47a23_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_f08000_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_f35f07_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_cb672b_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ff7519_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:6px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:6px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:6px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
+/*! jQuery Timepicker Addon - v1.5.0 - 2014-09-01
+* http://trentrichardson.com/examples/timepicker
+* Copyright (c) 2014 Trent Richardson; Licensed MIT */
+
+.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}
+@font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.eot?78346169');
+ src: url('../font/epgd.eot?78346169#iefix') format('embedded-opentype'),
+ url('../font/epgd.woff2?78346169') format('woff2'),
+ url('../font/epgd.woff?78346169') format('woff'),
+ url('../font/epgd.ttf?78346169') format('truetype'),
+ url('../font/epgd.svg?78346169#epgd') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'epgd';
+ src: url('../font/epgd.svg?78346169#epgd') format('svg');
+ }
+}
+*/
+
+ [class^="i-"]:before, [class*=" i-"]:before {
+ font-family: "epgd";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Font smoothing. That was taken from TWBS */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+
+.i-progress:before { content: '\e800'; } /* '' */
+.i-record:before { content: '\e801'; } /* '' */
+.i-cancel:before { content: '\e802'; } /* '' */
+.i-help:before { content: '\e803'; } /* '' */
+.i-help-circled:before { content: '\e804'; } /* '' */
+.i-info-circled:before { content: '\e805'; } /* '' */
+.i-info:before { content: '\e806'; } /* '' */
+.i-link-ext:before { content: '\e807'; } /* '' */
+.i-trash:before { content: '\e808'; } /* '' */
+.i-folder-closed:before { content: '\e809'; } /* '' */
+.i-folder-opened:before { content: '\e80a'; } /* '' */
+.i-menu:before { content: '\e80b'; } /* '' */
+.i-login:before { content: '\e80c'; } /* '' */
+.i-logout:before { content: '\e80d'; } /* '' */
+.i-down-dir:before { content: '\e80e'; } /* '' */
+.i-up-dir:before { content: '\e80f'; } /* '' */
+.i-left-dir:before { content: '\e810'; } /* '' */
+.i-right-dir:before { content: '\e811'; } /* '' */
+.i-refresh:before { content: '\e812'; } /* '' */
+.i-check:before { content: '\e813'; } /* '' */
+.i-check-empty:before { content: '\e814'; } /* '' */
+.i-save:before { content: '\e815'; } /* '' */
+.i-sort-down:before { content: '\e816'; } /* '' */
+.i-sort-up:before { content: '\e817'; } /* '' */
+.i-sort-name-up:before { content: '\e818'; } /* '' */
+.i-sort-name-down:before { content: '\e819'; } /* '' */
+.i-flashlight:before { content: '\e81a'; } /* '' */
+.i-wait:before { content: '\e81b'; } /* '' */
+.i-play:before { content: '\e81c'; } /* '' */
+.i-stop:before { content: '\e81d'; } /* '' */
+.i-pause:before { content: '\e81e'; } /* '' */
+.i-to-end:before { content: '\e81f'; } /* '' */
+.i-to-start:before { content: '\e820'; } /* '' */
+.i-forward:before { content: '\e821'; } /* '' */
+.i-rewind:before { content: '\e822'; } /* '' */
+.i-ok:before { content: '\e823'; } /* '' */
+.i-warning:before { content: '\e824'; } /* '' */
+.i-clock:before { content: '\e825'; } /* '' */
+.i-buffer:before { content: '\e826'; } /* '' */
+.i-doc-new:before { content: '\e827'; } /* '' */
+.i-search:before { content: '\e828'; } /* '' */
+.i-edit:before { content: '\e829'; } /* '' */
+.i-tv:before { content: '\e82a'; } /* '' */
+.i-thumb-rate-up:before { content: '\e82b'; } /* '' */
+.i-flash-outline:before { content: '\e82c'; } /* '' */
+.i-error:before { content: '\e82d'; } /* '' */
+.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{*zoom:1}@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}
+/* Hier sind Variablen aus Jquery-ui. Sie werden folgendermass erstellt:
+ aus 3rdParty\jquery-ui-x:x.custom\development-bundle\themes\humanity\jquery-ui.css den Link kopieren und hier einf�gen.
+ Dann diesen Link (nur Auswahl) per regul�ren Ausdruck
+ suchen "$([^=]+)=([^&]+)" und ersetzen "@$1: $2; "
+ suchen " ([a-f0-9]{6})" und ersetzen " #$1"
+*/
+h5 {
+ margin-bottom: 5px;
+}
+.ui-autocomplete-multiselect {
+ display: inline-block;
+ background: #fff !important;
+ border: 1px solid #e0cfc2;
+ border-radius: 6px;
+ padding: 1px 3px 0 3px;
+ overflow: hidden;
+ cursor: text;
+ font-size: 0.8em;
+ vertical-align: bottom;
+}
+.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item .ui-icon {
+ float: right;
+ cursor: pointer;
+}
+.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item {
+ display: inline-block;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ padding: 1px 3px;
+ margin-right: 2px;
+ margin-bottom: 1px;
+ background-color: #f4f0ec;
+ font-size: 0.8em;
+}
+.ui-autocomplete-multiselect input {
+ display: inline-block;
+ border: none;
+ outline: none;
+ height: auto;
+ margin: 2px;
+ overflow: visible;
+ margin-bottom: 5px;
+ text-align: left;
+ background: #fff !important;
+}
+.ui-autocomplete {
+ max-height: 120px;
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+.ui-autocomplete-category {
+ font-weight: bold;
+ padding: .2em .4em;
+ margin: .8em 0 .2em;
+ line-height: 1.5;
+}
+.placeholders {
+ position: absolute;
+ max-height: 120px;
+ overflow: auto;
+}
+.ui-dialog {
+ position: fixed;
+}
+.iAsButton {
+ border: 1px solid #cdc3b7;
+ background-color: #ede4d4;
+ color: #c47a23;
+ border-radius: 6px;
+ text-align: center;
+ padding: 3px;
+ display: inline-block;
+ text-decoration: none;
+ cursor: pointer;
+ margin: 3px;
+ white-space: nowrap;
+}
+.iAsButton[disabled] {
+ opacity: .35;
+}
+.iAsIcon {
+ text-align: center;
+ display: inline-block;
+ text-decoration: none;
+ cursor: pointer;
+ margin: 3px;
+ white-space: nowrap;
+ padding: 0;
+ font-size: 0.9em;
+ vertical-align: 6px;
+ margin-top: -6px;
+ border: 1px solid #cdc3b7;
+ background-color: #ede4d4;
+ color: #c47a23;
+ border-radius: 50%;
+ font-size: 0.8em;
+}
+.i-ok {
+ color: green;
+}
+.i-warning {
+ color: #f2e339;
+}
+.i-error {
+ color: #f16241;
+}
+.i-flash-outline {
+ color: #f90000;
+}
+.i-progress {
+ color: #c47a23;
+}
+/* ==========================================================================
+ EPGd
+ ========================================================================== */
+html {
+ width: 100%;
+}
+body {
+ margin: 0;
+ padding: 30px 0 0 0;
+ font-size: 0.8em;
+ width: 100%;
+ overflow: auto;
+}
+input,
+select {
+ padding: 2px;
+ border: 1px solid #e0cfc2;
+ border-radius: 6px;
+ vertical-align: middle;
+ font-weight: normal;
+}
+select {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.full {
+ width: 98%;
+}
+.quickInfo {
+ max-width: 80%;
+ max-height: 80%;
+ overflow-y: auto;
+}
+#menu-top {
+ width: 100%;
+ margin: 0 auto;
+ white-space: normal;
+ position: fixed;
+ z-index: 99;
+ top: 0;
+ left: 0;
+ background-color: #fff;
+}
+#menu-top span.maxi {
+ display: none;
+}
+#menu-top .iAsButton {
+ padding: 0 2px;
+ line-height: 21px;
+ margin-top: 0;
+}
+#menu-top.mini span.maxi {
+ display: block;
+ position: absolute;
+ padding: 0 10px;
+ right: 0;
+ top: 2px;
+ font-size: 1.3em;
+}
+#menu-top.mini > ul {
+ padding-right: 40px;
+}
+#menu-top.mini > ul > li {
+ display: none;
+ float: left;
+ max-width: 95%;
+}
+#menu-top.open {
+ z-index: 9999;
+}
+#menu-top.open > ul {
+ padding: 10px 0 10px 10px;
+}
+#menu-top.open > ul > li {
+ display: block;
+ float: left;
+ min-width: 90%;
+ min-height: 25px;
+}
+#menu-top.open > ul > li > a {
+ width: 100%;
+}
+#menu-top.open .ui-datepicker {
+ display: none;
+}
+#ui-menu-top {
+ overflow: hidden;
+ min-height: 30px;
+ /*
+
+ #ui-menu-top .ui-menu li {
+ float: left;
+ display: block;
+ }
+*/
+}
+#ui-menu-top .ui-menu {
+ position: fixed;
+ overflow: visible !important;
+ padding-top: 5px;
+ z-index: 99;
+}
+#ui-menu-top > li {
+ float: left;
+ display: block;
+ width: auto !important;
+ border: 1px solid transparent;
+ margin: 1px 5px !important;
+ padding: 0 0 !important;
+ line-height: 24px;
+ outline: none;
+}
+#ui-menu-top > li > a {
+ float: left;
+ display: block;
+ clear: both;
+ overflow: hidden;
+ text-decoration: none;
+}
+#ui-menu-top > li span.ui-menu-icon {
+ display: none;
+}
+#ui-menu-top .menu-active {
+ display: block !important;
+}
+#ui-menu-top .menu-active > a {
+ color: #b85700;
+ font-weight: bold;
+ min-height: 25px;
+}
+#ui-menu-top ul li {
+ display: block;
+ float: none;
+}
+#ui-menu-top ul li ul {
+ left: 120px !important;
+ width: 100%;
+}
+#ui-menu-top ul li ul li {
+ width: auto;
+}
+#ui-menu-top ul li ul li a {
+ float: left;
+}
+#ui-menu-top input,
+#ui-menu-top select {
+ display: none;
+ float: left;
+ font-size: 1em;
+ margin: 0 0 0 5px;
+}
+#ui-menu-top input,
+#ui-menu-top select {
+ padding: 3px;
+}
+#menu_login {
+ float: right;
+ margin-right: 20px !important;
+}
+.menu-active input,
+.menu-active select {
+ display: block;
+ visibility: visible;
+}
+.ui-tabs {
+ position: static;
+ border: 1px solid #e0cfc2;
+}
+#tabCon {
+ padding: 10px;
+}
+table.ui-datepicker-calendar {
+ width: 40%;
+ float: left;
+ margin: 10px 2% 5px 0;
+ font-size: 1em;
+}
+.ui-datepicker {
+ width: auto;
+}
+.ui-timepicker-div {
+ width: 53%;
+ min-width: 230px;
+ float: left;
+ margin: 3px 0 0 0;
+}
+.ui-timepicker-div dl dd {
+ margin: 0 10px 0 4px;
+}
+.ui-timepicker-div dt {
+ float: none !important;
+ font-weight: bold;
+}
+.ui-timepicker-div span {
+ float: left;
+ line-height: 0.8;
+ margin-bottom: 10px;
+}
+.ui-timepicker-div u {
+ margin: 0px 0px 10px 10px;
+ text-align: right;
+ min-width: 16px;
+ cursor: pointer;
+ display: inline-block;
+}
+.ui-timepicker-div i {
+ padding-right: 17px;
+ background: url(../images/epg_icons_24x24_orange.png) no-repeat 45px -1831px;
+ display: inline-block;
+}
+.channel {
+ width: 80px;
+ overflow: hidden;
+ font-weight: bold;
+ font-size: 10px;
+ line-height: 1;
+ color: #4d4949;
+ padding: 3px 5px 0 3px;
+}
+.channel img {
+ max-width: 70px;
+ max-height: 50px;
+ margin-right: 5px;
+ margin-bottom: 5px;
+ display: block;
+}
+.channel .i-tv {
+ font-size: 1.8em;
+ line-height: 1.3em;
+ margin-left: -4px;
+ cursor: pointer;
+}
+.popup {
+ z-index: 8888;
+}
+.topInfo {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ height: 36px;
+ padding: 6px 0.7em;
+ z-index: 100000;
+ position: fixed;
+ top: 0;
+ right: 30px;
+}
+.topInfo button {
+ margin: -4px 0 0 10px;
+}
+#content {
+ text-align: center;
+ width: 96%;
+ padding: 0;
+ margin: 0 auto;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+#content > * {
+ text-align: left;
+}
+.teaserList {
+ padding: 0px;
+ margin: 0px auto;
+ list-style: none;
+ display: block;
+}
+.teaserList li {
+ padding: 1px 3px 3px 3px;
+ margin: 0.5% 1%;
+ overflow: hidden;
+ width: 98%;
+ min-height: 70px;
+ -webkit-box-sizing: border-box;
+ /* Safari/Chrome, other WebKit */
+ -moz-box-sizing: border-box;
+ /* Firefox, other Gecko */
+ box-sizing: border-box;
+ /* Opera/IE 8+ */
+}
+.teaserList .desc {
+ height: 72px;
+ overflow: hidden;
+}
+.teaserList .desc:hover {
+ min-height: 72px;
+ height: auto;
+ overflow-y: visible;
+}
+.teaserList .desc img {
+ float: right;
+ margin: 0px 0px 2px 5px;
+}
+.teaserList .time {
+ float: left;
+ font-size: 0.9em;
+}
+.teaserList .date {
+ float: right;
+ font-size: 0.9em;
+}
+.teaserList .tipp {
+ margin: 1px 5px 0 0;
+}
+.teaserList .title {
+ font-weight: bold;
+ margin-top: 8px;
+}
+#pageNow li {
+ padding-left: 90px;
+}
+#pageNow .channel {
+ float: left;
+ margin-left: -87px;
+ cursor: pointer;
+}
+#pageNow .channel img {
+ max-height: 70px;
+}
+#magazine-nav {
+ width: 100%;
+ left: -27px;
+ position: relative;
+}
+#magazine-nav .left,
+#magazine-nav .right {
+ width: 50px;
+ height: 54px;
+ border-top: none;
+ border-bottom: none;
+ position: absolute;
+ z-index: 98;
+ top: 0;
+}
+#magazine-nav .left .ui-widget-content,
+#magazine-nav .right .ui-widget-content {
+ width: 50px;
+ margin: 0 -1px;
+ text-align: center;
+ padding-top: 1px;
+ border-bottom: none;
+}
+#magazine-nav .left span,
+#magazine-nav .right span {
+ margin: 0px auto 1px auto;
+}
+#magazine-nav .left {
+ left: 0;
+}
+#magazine-nav .right {
+ right: 0;
+}
+#magazine-head {
+ margin: 0 0 0 -2%;
+ height: 55px;
+ padding: 0 0 0 54px;
+ overflow: hidden;
+}
+#magazine-head .ui-widget-content {
+ margin: 0 3px;
+ width: 200px;
+ height: 55px;
+ float: left;
+}
+#magazine-head .ui-widget-content .channel {
+ height: 55px;
+ width: auto;
+}
+#magazine-head .ui-widget-content .channel img {
+ max-width: 100px;
+ float: left;
+}
+#magazine {
+ padding: 0 0 0 54px;
+ margin: 0 0 0 -2%;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ position: relative;
+ clear: left;
+}
+#magazine .timeNow {
+ position: absolute;
+ border-top: 2px solid red;
+ z-index: 99;
+ left: 0;
+ color: red;
+ font-weight: bold;
+ padding: 0 0 0 8px;
+ margin: 0;
+ opacity: 0.5;
+}
+#magazine > div {
+ margin: 0;
+ padding: 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+#magazine > div > div {
+ float: left;
+ width: 200px;
+ min-height: 90%;
+ margin: 0 3px;
+}
+#magazine > div > div.timeLine {
+ width: 50px;
+ margin: 0 0 0 -1px;
+ left: 0;
+ position: absolute;
+ z-index: 99;
+}
+#magazine > div > div.timeLine p {
+ position: absolute;
+ pointer-events: none;
+ width: 5000px;
+ height: 180px;
+ background-color: red !important;
+ opacity: 0.1;
+}
+#magazine > div > div.timeLine.tlr p {
+ display: none;
+}
+#magazine > div > div.timeLine dfn {
+ height: 120px;
+ text-align: center;
+ box-sizing: border-box;
+ padding-top: 10px;
+ display: block;
+}
+#magazine > div > div.timeLine dfn:nth-of-type(2n+1) {
+ background-color: #ddd;
+}
+#magazine > div dt {
+ border: 2px solid transparent;
+ border-top-color: #e0cfc2;
+ padding: 1px 4px;
+ width: 200px;
+ margin: 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ overflow: hidden;
+}
+#magazine > div dt:hover {
+ overflow-y: visible;
+ height: auto !important;
+}
+#magazine > div dt .time {
+ font-size: 0.9em;
+ float: left;
+}
+#magazine > div dt .time * {
+ display: block;
+ float: left;
+ width: 40px;
+}
+#magazine > div dt img {
+ float: right;
+}
+#magazine > div dt .title {
+ font-size: 0.9em;
+ font-weight: bold;
+ clear: both;
+}
+#magazine > div dt .desc {
+ margin-top: 5px;
+ border: none;
+ clear: both;
+}
+.desc {
+ font-size: 0.9em;
+ border: 1px solid #e0cfc2;
+ border-width: 1px 0 0 0;
+ margin-top: 20px;
+}
+.desc span {
+ font-weight: bold;
+ color: #ae0a0a;
+ margin-right: 5px;
+}
+.progress {
+ border: 1px solid #e0cfc2;
+ float: right;
+ margin-top: 3px;
+ width: 100px;
+ height: 10px;
+}
+.progress > div {
+ background-color: #cb842e;
+ height: 8px;
+ margin-top: 1px;
+}
+#eventDetail {
+ position: fixed;
+ display: none;
+ z-index: 100;
+ min-width: 320px;
+ width: 432px;
+ height: 80%;
+ min-height: 440px;
+ padding: 0;
+}
+#eventDetail .ui-accordion-content {
+ padding: 0;
+}
+#eventDetail .ui-accordion-content a {
+ margin-right: 5px;
+}
+#eventDetail .toolbar {
+ text-align: center;
+ float: left;
+ width: 100%;
+ padding: 2px;
+ box-sizing: border-box;
+}
+#eventDetail .toolbar button {
+ font-size: 1.2em;
+}
+#eventDetail .title {
+ display: inline-block;
+ margin-left: 10px;
+ overflow: hidden;
+ text-align: center;
+ width: 100px;
+}
+#eventDetail h3 {
+ cursor: auto;
+ vertical-align: top;
+ text-align: center;
+ font-size: 0.8em;
+ padding: 3px 140px 0;
+ overflow: hidden;
+ height: 18px;
+ clear: both;
+}
+#eventDetail h3 div {
+ position: absolute;
+ top: 3px;
+ display: inline-block;
+ padding: 0 5px;
+}
+#eventDetail h3 div.date {
+ left: 20px;
+}
+#eventDetail h3 div.time {
+ right: 0;
+}
+#eventDetail .imgBox {
+ padding: 4px;
+ display: table-cell;
+ position: relative;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ width: 270px;
+ float: left;
+ min-height: 120px;
+}
+#eventDetail .imgBox img {
+ display: block;
+ margin: auto;
+}
+#eventDetail .chPrFl {
+ width: 105px;
+ margin: -5px 0 0 10px;
+ float: left;
+ font-size: 0.8em;
+}
+#eventDetail .chPrFl > div {
+ width: 100px;
+ float: left;
+ margin-top: 5px;
+}
+#eventDetail .chPrFl .channel {
+ text-align: center;
+ font-size: 12px;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+}
+#eventDetail .chPrFl .channel img {
+ margin: 0 auto 5px auto;
+}
+#eventDetail .chPrFl .audio span {
+ height: 16px;
+ min-width: 25px;
+ margin: 0 8px 0 0;
+ background-image: url(../images/epg_icons_24x24_orange.png);
+ background-repeat: no-repeat;
+ display: inline-block;
+}
+#eventDetail .info {
+ float: left;
+ margin: 10px 10px 0 0;
+ min-width: 135px;
+ font-size: 0.9em;
+}
+#eventDetail .info b {
+ margin-left: 5px;
+}
+#eventDetail .col2 {
+ float: left;
+ width: 280px;
+ margin: 10px 10px 0 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+#eventDetail .rate {
+ background-size: 25px;
+ min-height: 40px;
+ padding-left: 30px;
+}
+#eventDetail .rate > span {
+ display: block;
+ font-size: 1.2em;
+}
+#eventDetail .tipp {
+ margin: 0 5px 0 0;
+}
+#eventDetail .stars div {
+ height: 16px;
+ width: 80px;
+ margin: 2px 0 5px 0;
+ background-image: url(../images/epg_icons_24x24_orange.png);
+ background-repeat: no-repeat;
+}
+#eventDetail div.stars {
+ font-size: 0.9em;
+ float: right;
+ margin: 10px 10px 0 0;
+ text-align: center;
+ clear: both;
+}
+#eventDetail td.stars div {
+ float: left;
+ margin-right: 20px;
+}
+#eventDetail .colFull {
+ float: left;
+ width: 405px;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ margin: 10px 0 0 10px;
+}
+#eventDetail .colFull > img {
+ margin: 10px 0 0 0;
+ vertical-align: top;
+}
+#eventDetail .desc {
+ padding: 5px 10px 5px 0px;
+}
+#eventDetail table {
+ border-collapse: collapse;
+}
+#eventDetail table th,
+#eventDetail table td {
+ text-align: left;
+ border: 1px solid #e0cfc2;
+ padding: 2px 3px;
+}
+#eventDetail .poster {
+ float: left;
+ margin: 10px 10px 0 10px;
+}
+#eventDetail .actors {
+ font-size: 0.9em;
+}
+#eventDetail .actors h5 {
+ margin: 10px 0 0;
+ font-size: 1.1em;
+}
+#eventDetail .actors div {
+ float: left;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 10px 10px 0 65px;
+ width: 195px;
+ min-height: 100px;
+}
+#eventDetail .actors div a {
+ display: block;
+ font-weight: bold;
+}
+#eventDetail .actors div img {
+ max-width: 60px;
+ max-height: 90px;
+ float: left;
+ margin-left: -65px;
+}
+#eventDetail .rec {
+ font-size: 0.9em;
+}
+.hasTimer {
+ color: red;
+ font-weight: bold;
+}
+.stars1 {
+ background-position: 0 -465px;
+}
+.stars2 {
+ background-position: 0 -491px;
+}
+.stars3 {
+ background-position: 0 -517px;
+}
+.stars4 {
+ background-position: 0 -543px;
+}
+.stars5 {
+ background-position: 0 -570px;
+}
+.a-169 {
+ background-position: 0 -784px;
+}
+.a-dd {
+ background-position: 0 -712px;
+}
+.parRate6 {
+ background: url(../images/epg_icons_24x24_orange.png) no-repeat 0 -1558px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate12 {
+ background: url(../images/epg_icons_24x24_orange.png) no-repeat 0 -1520px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate16 {
+ background: url(../images/epg_icons_24x24_orange.png) no-repeat 0 -1634px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.parRate18 {
+ background: url(../images/epg_icons_24x24_orange.png) no-repeat 0 -1596px;
+ height: 30px;
+ width: 30px;
+ color: transparent;
+ float: right;
+}
+.rate {
+ background: url(../) no-repeat left top;
+ background-size: 18px;
+ min-height: 35px;
+ padding-left: 25px;
+ margin: 5px 0;
+ float: left;
+ clear: left;
+ display: block;
+}
+.rate1 {
+ background-image: url('../images/thumb-rate1.svg');
+}
+.rate2 {
+ background-image: url('../images/thumb-rate2.svg');
+ background-size: 25px;
+}
+.rate3 {
+ background-image: url('../images/thumb-rate3.svg');
+}
+.rate4 {
+ background-image: url('../images/thumb-rate4.svg');
+}
+.rate5 {
+ background-image: url('../images/thumb-rate5.svg');
+}
+.rate0 {
+ background: none;
+ height: auto;
+ padding-left: inherit;
+}
+.tipp {
+ display: block;
+ float: left;
+ margin: 5px 0;
+ background-color: #f57e7e;
+ color: white;
+ border-radius: 6px;
+ padding: 1px 3px;
+ font-size: 0.9em;
+ font-weight: normal;
+}
+#searchResult {
+ overflow-y: auto;
+ overflow-x: visible;
+ border-top: 1px solid #cb842e;
+ box-sizing: border-box;
+ padding-right: 1px;
+}
+.timerTable {
+ min-width: 400px;
+ width: 100%;
+ /* p {
+ border-top: 1px solid #ccc;
+ height: 18px;
+ margin: 0;
+ overflow-y: hidden;
+
+ &:hover {
+ overflow-y: visible;
+ height: auto !important;
+ }
+ }
+ }*/
+}
+.timerTable.sub {
+ background-color: white;
+ border: 3px double #e0cfc2;
+}
+.timerTable td {
+ border: 1px solid #e0cfc2;
+ padding: 2px 5px;
+ vertical-align: top;
+}
+.timerTable td .channel img {
+ max-height: 30px;
+}
+.timerTable th {
+ text-align: left;
+ vertical-align: top;
+ padding: 2px 5px;
+ display: table-cell;
+}
+.timerTable span {
+ float: right;
+}
+.timerTable .i-sort-name-up {
+ margin-right: 0;
+}
+.timerTable .i-sort-name-down {
+ margin-left: 0;
+}
+#timerList td:nth-child(6) {
+ cursor: pointer;
+}
+#timerSearchList {
+ max-width: 750px;
+}
+.searchDialog {
+ min-width: 320px;
+ position: relative;
+}
+.searchDialog #tTitle {
+ cursor: pointer;
+ text-align: center;
+ text-decoration: underline;
+}
+.searchDialog > form > div {
+ margin-bottom: 5px;
+ margin-top: 5px;
+}
+.searchDialog > form.noAdv > div + div {
+ display: none;
+}
+.searchDialog label {
+ margin: 5px 5px 0 0;
+ font-weight: bold;
+ color: #666;
+ cursor: pointer;
+}
+.searchDialog input.hasDatepicker[disabled] {
+ border: none;
+ background-color: transparent;
+ width: 20px;
+}
+.searchDialog .week {
+ border: 1px solid #e0cfc2;
+ margin: 5px 0;
+ padding: 5px 0;
+ width: 99%;
+}
+.searchDialog .week > input[type=checkbox],
+.searchDialog .week > span {
+ width: auto;
+ margin-left: 2%;
+ margin-right: 2px;
+ line-height: 2em;
+}
+.searchDialog .colBlock {
+ width: 100%;
+ float: left;
+}
+.searchDialog .colBlock div {
+ float: left;
+ margin-right: 10px;
+}
+.searchDialog .colBlock div label {
+ display: block;
+}
+.searchDialog form.typeS .noTypeS,
+.searchDialog form.typeS .onlyTypeR {
+ display: none;
+}
+.searchDialog form.typeV .onlyTypeR,
+.searchDialog form.typeV .onlyTypeS {
+ display: none;
+}
+.searchDialog form.typeR .onlyTypeS {
+ display: none;
+}
+.selMarkBlock {
+ display: inline-block;
+ text-align: center;
+ width: 34px;
+ float: left;
+ font-size: 0.8em;
+}
+.selMarkBlock b {
+ border: 1px solid #CCCCCC;
+ border-radius: 6px;
+ float: left;
+ margin: 5px 3px 0 0;
+ padding-left: 5px;
+ height: 13px;
+ width: 20px;
+}
+.selMarkBlock b b {
+ border: medium none;
+ border-radius: 6px 0 0 6px;
+ margin: 0 0 0 -5px;
+ width: 7px;
+ height: 13px;
+}
+#records {
+ margin-left: -20px;
+ /* 23.11.16 brauchen wir das noch???
+ .ui-menu li {
+ padding: 2px 5px;
+
+ &:hover {
+ border: 1px solid @ui-borderColorHover;
+ }
+ }*/
+}
+#records .folder {
+ padding: 0 0 0 20px;
+}
+#records .folder h4 {
+ margin: 3px 0;
+ display: inline-block;
+}
+#records .folder h4 span {
+ font-weight: normal;
+ padding-right: 3px;
+}
+#records .folder div,
+#records .folder m {
+ display: none;
+}
+#records .folder.open > h4 > span:before,
+#records .folder.tmp-open > h4 > span:before {
+ content: '\e80a';
+}
+#records .folder.open > h4 > m,
+#records .folder.tmp-open > h4 > m {
+ display: inline;
+}
+#records .folder.open > h4 > m:before,
+#records .folder.tmp-open > h4 > m:before {
+ content: '\e80b';
+}
+#records .folder.open > div,
+#records .folder.tmp-open > div {
+ display: block;
+}
+.rec {
+ border: 1px solid #cdc3b7;
+ border-radius: 6px;
+ margin: 2px 20px;
+ padding: 0 140px 0 70px;
+ background-color: #f4f0ec;
+ position: relative;
+}
+.rec u {
+ display: block;
+ position: absolute;
+ margin-left: -60px;
+ padding: 2px 0;
+}
+.rec b {
+ display: block;
+ background-color: white;
+ padding: 2px 5px;
+}
+.rec b i {
+ display: block;
+ font-weight: normal;
+}
+.rec em {
+ display: block;
+ position: absolute;
+ right: 10px;
+ top: 0;
+ padding: 2px 0;
+}
+#recBar {
+ font-size: 0.9em;
+ display: inline-block;
+}
+body.dd-open #ui-menu-top,
+body.dd-open #recBar {
+ display: none !important;
+}
+body.dd-open #records .folder {
+ display: block;
+}
+body.dd-open #records div.rec {
+ display: none;
+}
+.pageEditChannels > li {
+ border: 1px solid #CCCCCC;
+ border-radius: 6px;
+ clear: left;
+ float: left;
+ margin-top: 5px;
+ padding-left: 5px;
+ width: 96%;
+}
+.pageEditChannels > li.filterHide {
+ height: 0;
+ overflow: hidden;
+ margin: 0;
+ border: none;
+}
+#pageEditChannelsHead {
+ border-bottom: 3px double #CCCCCC;
+ font-size: 0.9em;
+ margin: 10px 0 0 10px;
+ width: 600px;
+ float: none;
+}
+#pageEditChannelsHead em {
+ padding: 3px;
+ line-height: 0;
+}
+.pageEditChannels {
+ font-size: 0.9em;
+ margin: 0;
+ width: 600px;
+ overflow-y: auto;
+ float: left;
+}
+.pageEditChannels em {
+ cursor: pointer;
+ float: left;
+ margin: 3px 10px 0 0;
+ font-size: 1.2em;
+}
+.pageEditChannels span {
+ display: inline-block;
+ float: left;
+ padding: 5px 10px 5px 0;
+ width: 180px;
+}
+.pageEditChannels > li > input {
+ float: left;
+ margin-top: 3px;
+ width: 180px;
+}
+.pageEditChannels ol {
+ background: none repeat scroll 0 0 #EEEEEE;
+ border-radius: 6px;
+ display: inline-block;
+ float: left;
+ margin: 3px 10px;
+ padding: 2px 5px 2px 20px;
+ min-height: 15px;
+ font-size: 0.7em;
+}
+.pageEditChannels ol input {
+ margin-top: 3px;
+ width: 40px;
+}
+#pageEditChannels {
+ border-bottom: 1px solid #CCCCCC;
+}
+#pageEditChannelsSource {
+ width: 350px;
+ margin-top: 5px;
+}
+#pageEditChannelsSource i {
+ padding: 5px 10px 5px 0;
+ float: left;
+}
+.selected {
+ background-color: #F39814;
+}
+#page_profile td {
+ padding: 5px;
+ vertical-align: top;
+}
+#page_editUser > div {
+ float: left;
+ height: 350px;
+ padding-right: 20px;
+ margin-right: 20px;
+ border-right: 2px solid #ccc;
+}
+#page_editUser h2 {
+ margin: 5px 0 2px 0;
+ font-size: 1em;
+}
+#page_editUser form {
+ float: left;
+}
+#page_editUser select {
+ overflow: auto;
+ height: 200px;
+}
+/* ==========================================================================
+ Media Queries
+ ========================================================================== */
+@media only screen and (max-width: 420px) {
+ body {
+ font-size: 1em;
+ }
+ ui-icon {
+ margin: 6px;
+ }
+ .ui-timepicker-div u {
+ min-width: 21px;
+ }
+ .ui-timepicker-div i {
+ background-position: 53px -1828px;
+ }
+ .teaserList .desc img,
+ #eventDetail .ui-widget-shadow {
+ display: none;
+ }
+ .teaserList .time,
+ .teaserList .date {
+ font-size: 0.8em;
+ }
+ .teaserList .tipp {
+ font-size: 0.7em;
+ margin-top: 2px;
+ }
+ .teaserList .progress {
+ width: 40px;
+ }
+ #eventDetail {
+ width: 100%;
+ height: 60%;
+ position: fixed;
+ }
+ #eventDetail .colFull {
+ width: 100%;
+ margin: 0;
+ }
+ #eventDetail .imgBox:empty {
+ display: none;
+ }
+ #eventDetail .col2 {
+ width: 165px;
+ }
+ #eventDetail .info:nth-child(2n+1) {
+ clear: both;
+ }
+ #eventDetail .stars {
+ clear: none !important;
+ float: left;
+ margin-left: 10px;
+ }
+ #eventDetail .desc {
+ width: 300px;
+ }
+ .searchDialog {
+ width: 320px;
+ }
+ #magazine-nav {
+ top: -10px;
+ }
+ #magazine-nav .left {
+ margin-left: -1px;
+ }
+ #magazine-nav .right {
+ margin-right: -1px;
+ }
+ #magazine-head .ui-widget-content {
+ height: 65px;
+ }
+ #magazine-head .prev {
+ height: auto;
+ }
+ #magazine .tlr {
+ display: none;
+ }
+ #records {
+ margin-left: -5px;
+ }
+ #records .folder {
+ padding: 0 0 0 5px;
+ }
+ .rec {
+ margin: 2px;
+ padding: 0;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ .rec u {
+ position: inherit;
+ margin-left: 2px;
+ }
+}
+@media only screen and (min-width: 768px) and (max-width: 1139px) {
+ #pageNow li {
+ float: left;
+ width: 48%;
+ }
+ #pageNow li:nth-child(2n+1) {
+ clear: left;
+ }
+ #eventDetail {
+ width: 700px;
+ }
+ #eventDetail h3 {
+ font-size: 1em;
+ padding: 3px 170px 0;
+ height: 20px;
+ }
+ #eventDetail .desc {
+ border-width: 0 0 0 1px;
+ height: 100%;
+ margin-top: 0;
+ padding: 5px 10px;
+ }
+ #eventDetail .desc,
+ #eventDetail .actors {
+ width: 270px;
+ }
+ #eventDetail .poster,
+ #eventDetail table.colFull,
+ #eventDetail table.colFull img {
+ width: 320px;
+ }
+}
+@media only screen and (min-width: 900px) {
+ #eventDetail {
+ width: 850px;
+ }
+ #eventDetail h3 {
+ font-size: 1em;
+ padding: 3px 170px 0;
+ height: 20px;
+ }
+ #eventDetail .desc {
+ border-width: 0 0 0 1px;
+ height: 100%;
+ margin-top: 0;
+ padding: 5px 10px;
+ }
+ #eventDetail .desc,
+ #eventDetail .actors {
+ width: 405px;
+ }
+ #eventDetail .poster {
+ float: right;
+ }
+}
+@media only screen and (min-width: 1140px) {
+ .content {
+ width: 1026px;
+ /* 1140px - 10% for margins */
+ margin: 0 auto;
+ }
+ #pageNow li {
+ float: left;
+ width: 31%;
+ }
+ #pageNow li:nth-child(3n+1) {
+ clear: left;
+ }
+}
+/*
+
+@media (min-width: 1696px) {
+ #pageNow li:nth-child(4n+1) {
+ clear: left;
+ }
+}
+@media (max-width: 1695px) {
+ #pageNow li:nth-child(3n+1) {
+ clear: left;
+ }
+}
+
+@media (max-width: 1275px) {
+ #pageNow li {
+ width:46%;
+ }
+ #pageNow li:nth-child(2n+1) {
+ c_lear: left;
+ }
+}
+@media (max-width: 865px) {
+ #pageNow li {
+ width:96%;
+ }
+}
+@media (max-width: 420px) {
+ #pageNow img, #eventDetail .ui-widget-shadow{
+ display:none;
+ }
+ #pageNow li {
+ width:310px;
+ margin-left:0px;
+ margin-right:0px;
+ }
+ #pageNow .desc {
+ width:220px;
+ }
+ #eventDetail {
+ width:320px;
+ height:100%;
+ position:fixed;
+ }
+}
+*/
diff --git a/http/www/epgd.js b/http/www/epgd.js
new file mode 100644
index 0000000..fdcdfe7
--- /dev/null
+++ b/http/www/epgd.js
@@ -0,0 +1 @@
+var epgd={};epgd.tr={oClock:"Uhr",minutes:"min",save:"speichern",copy:"kopieren",apply:"übernehmen",close:"schließen",clear:"löschen",yes:"ja",no:"nein",edit:"bearbeiten",cancel:"abbrechen",del:"löschen",test:"testen",reload:"neu laden",advanced:"erweitert",markAll:"alle markieren",markNone:"keinen markieren",markToggle:"Markierung umdrehen",confirmDelete:"Willst du wirklich löschen?",dataSaved:"Daten wurden gespeichert",dataDeleted:"Daten wurden gelöscht",dataSend:"Daten wurden gesendet",channel:"Kanal",date:"Datum",entries:" Einträge",error:{error:"Fehler",common:"Es ist ein allgemeiner Fehler aufgetreten",serverNotResponse:"Der Server konnte nicht erreicht werden!",notImplemented:"Dieses Feature ist zur Zeit noch nicht implementiert",forbidden:"Zugriff verweigert!",noData:"Für diese Anfrage konnten keine Daten ermittelt werden!",emptyField:"Bitte fülle das Feld $field$ aus!",invalid:"Der eingegebene Wert ist ungültig!"},menu:{now:"Programm",magazine:"Magazin",timer:"Timer",records:"Aufnahmen",search:"Suche",options:"Einstellungen",help:"Hilfe"},pages:{now:{at:"am"},timer:{timerList:"Timer",searchTimerList:"Suchtimer",timersDone:"kürzliche Aufträge",timerListDone:"Auftragshistorie",timerJobList:"asynchrone Aufträge",messageList:"Systemmeldungen"},timerList:{empty:"Keine Timer vorhanden!",startTime:"Anfang",endTime:"Ende",folder:"Verzeichnis",file:"Dateiname",recordTime:"Aufnahmezeit",lifetime:"Lebenszeit",prio:"Priorität",inactive:"Inaktiv",newTimer:"Neuen Timer anlegen",namingMode:"Ermittlung des Dateinamens",namingModes:["VDR","Auto","Constable","Serie","Kategorisiert","Usermode","Template"],template:"Template",templateFields:{"%title%":": Titel (EPG)","%shorttext%":": Untertitel (EPG)","%starttime%":": Startzeit (EPG)","%year%":": Jahr (EPG)","%category%":": Kategorie (EPG)","%episodname%":": Titel der Serie (constabel)","%shortname%":": Kurz-Titel der Serie (constabel, optional)","%partname%":": Name der Folge (constabel)","%season%":": Staffel (constabel)","%part%":": Teil der Staffel (constabel)","%number%":": Nummer über alle Staffeln (constabel)","%extracol1%":": Zusätzliche Angaben z.B. bei Tatort die Ermittler (constabel, optional)","%extracol2%":": ... z.B. bei Tatort der Ort (constabel, optional)","%extracol3%":": ... z.B. bei Tatort der Sender (constabel, optional)"},episode:"Serientitel",noEpgMatch:"Ignoriere fehlende EPG Info",noRepeat:"Wiederholungen vermeiden",searchTimerReload:"Suchtimer updaten",chInclude:"Auf Kanäle einschränken",chExclude:"Kanäle ausschließen",nextDays:"innerhalb der nächsten $field$ Tage",confirmSaveBigResult:"Die Suche ergibt $cnt$ Treffer, trotzdem speichern?",timerStates:{D:"gelöscht",E:"Fehler",F:"Aufnahme erfolgreich",P:"wartet auf Aufnahmebeginn",R:"nimmt gerade auf...",U:"unbekannt"},timerActions:{C:"Timer wurde erstellt und muss noch von einem VDR übernommen werden",D:"Timer wurde gelöscht und muss noch im VDR gelöscht werden",F:"Zuweisung Timer an VDR fehlgeschlagen",M:"Timer wurde verändert und muss noch vom VDR verarbeitet werden"},doneStates:{f:"Timer konnte nicht erstellt werden",C:"Timer bereits erstellt",D:"Timer gelöscht",F:"Aufnahme fehlgeschlagen",Q:"Timer in Vorbereitung",R:"Aufnahme fertig"},messageStates:{N:"Neu",R:"gelesen"},messageTypes:{I:"Information",W:"Warnung",E:"Fehler",F:"Fataler Fehler"},chFormat:"bevorzugtes Sendeformat"},eventDetail:{record:"Aufnehmen",repeat:"Wiederholungen",ch_switch:"umschalten",eventNext:"nachfolgend",eventPrev:"vorher",parentalrating:"ab ",mergeSrc:"Quelle ",genre:"Genre",category:"Kategorie",country:"Land",year:"Jahr",season:"Staffel",part:"Folge",number:"Folge Insgesamt",extentedInfo:"weitere Informationen",scrapperMovieInfo:"Filminformation",scrapperSerieInfo:"Serieninformation",constabelInfo:"Constabel Episodenliste",addConstableLink:"Link erzeugen",loginConstable:"Login",title:"Titel",original_title:"Originaltitel",runtime:"Laufzeit",lang:"Sprache",release_date:"Erscheinungsdatum",actors:"Schauspieler",network:"Netzwerk",seriesstatus:"Status",gueststars:"Gäste",homepage:"Webseite",popularity:"Beliebtheit",vote_average:"&oslash; Bewertung",extInfo:{director:"Regie",camera:"Kamera",screenplay:"Drehbuch",producer:"Produktion",music:"Musik",moderator:"Moderator",commentator:"Kommentator",guest:"Gäste",info:"Info",other:"Sonstige"}},options:{profile:"allgemein",editChannels:"Kanäle bearbeiten",editUser:"Benutzer bearbeiten"},editChannels:{menu:{channelList:"Kanalliste",referenceList:"Referenzliste",insertAsText:"als Text einfügen",extentEmptyChannelNames:"leere Kanalnamen ergänzen",applyAllChannelNames:"Alle Kanalnamen übernehmen",applyChannelSort:"Kanalsortierung übernehmen"},headline:"Sortierung der Kanäle durch drag und drop, Blockmarkierung durch zus. gedrückter shift-Taste",checkWeb:"Kanal in Webansicht anzeigen",checkVDR:"Kanal zum VDR übertragen",desc_insertList:"Kopiere den Inhalt einer channels.conf in das Textfeld unten. Eine vollständige Liste gibt es beispielsweise hier:"},editUser:{user:"Benutzer",sel:"auswählen",add:"neu anlegen",active:"Aktiv",inActive:"Inaktiv",rights:{label:"Rechte",umConfig:"Konfiguration lesen",umConfigEdit:"Konfiguration ändern",umConfigUsers:"Benutzer konfigurieren",umTimer:"Timer lesen",umTimerEdit:"Timer bearbeiten",umSearchTimer:"Suchtimer lesen",umSearchTimerEdit:"Suchtimer bearbeiten",umFsk:"FSK",umRecordings:"Aufnahmen lesen",umRecordingsEdit:"Aufnahmen editieren"}},help:{url:"lang/hilfe.html",noHelp:"Hierzu konnte kein Hilfstext gefunden werden"},search:{search:"suchen",searchName:"Name",searchExpression:"Suchausdruck",caseSensitive:"Klein-/Großschreibung",searchModes:["exakte Übereinstimmung","regulärer Ausdruck","Muster","enthalten in"],searchFields:["Titel","Kurztext","Beschreibung"],empty:"Leider nichts gefunden.",matchdensity:"Treffergenauigkeit"},login:{label:"Login",userName:"Benutzername",password:"Passwort",loggedAlwaysIn:"angemeldet bleiben",logout:"Abmelden",error:"Fehler beim Anmelden!",logoutMessage:"Du wurdest abgemeldet!",needLogin:"Login erforderlich"},records:{ddLabel:"Drag und Drop",refreshMessage:"Aufnahmelisten werden neu geladen, Seite lädt in $sec$ Sekunden neu",moveMessage:"Aufnahme verschieben von \n$src$\nnach",notFoundMessage:"Aufnahme nicht gefunden, ggf einmal aktualisieren",deleteMessage:"Soll die Aufnahme $src$ wirklich gelöscht werden?",available:"Verfügbar",commonRecFolder:"gemeinsame Aufnahmen",similarTimer:"ähnliche Sendung aufnehmen"},profile:{mailReceiver:"eMail",sendTCC:"sende Mail bei Timerkonflikten",sendMessages:"sende Mail bei Systemmeldungen",magazinePan:"Scrollgeschwindigkeit in Minuten<br />(0 = aus)",magazinePanDelay:"Auslöseverzögerung",maxListEntries:"maximal Anzahl Einträge, die auf einmal vom Server geladen werden sollen, z.B. bei Suchen, Suchtimern usw.",system:{label:"epgd Backend"},vdr:{startWithSched:"EPG Menü startet mit Schedule"},record:{subFolderSort:"Sortierung der Unterordner"}}},dateTimePicker:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",timeOnlyTitle:"Zeit wählen",timeText:"Sendungsbeginn",timeTextBetween:"zwischen",prevText:"&#x3C;Zurück",nextText:"Vor&#x3E;",currentText:"Jetzt",closeText:"Fertig",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",timeFormat:"HH:mm",dateFormat:"D, dd.mm.yy",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:false,showMonthAfterYear:false,yearSuffix:""}};epgd.profile={needLogin:-1,channelLogoPath:"data/channellogo",eventImgPath:"data/eventimg",movieMediaPath:"data/moviemedia",serieImgPath:"data/seriesmedia",movieActorPath:"http://www.themoviedb.org/person/",serieSeasonPath:"http://www.thetvdb.com/?tab=seasonall&id=",constabelEditPath:"https://www.eplists.de/eplist.cgi?action=edit&back=&file=",constabelLinkPath:"https://www.eplists.de/eplist.cgi?action=show_form_redir&linkname=",minEventTime:0,maxEventTime:0,logoShowName:0};epgd.userProfile_defaults={defaultVDRuuid:"",constabelLoginPath:false,pickerFirstDay:"6",quickTimes:"",startWithSched:0,startPage:"menu_options",namingModeSerie:"0",namingModeSearchSerie:"0",namingModeMovie:"0",namingModeSearchMovie:"0",namingModeSerieTemplate:"",namingModeSearchSerieTemplate:"",namingModeMovieTemplate:"",namingModeSearchMovieTemplate:"",chFormat:"",timerDefaultVDRuuid:"",searchAdv:"0",mailReceiver:"",messageMailTypes:"",magazinePan:10,magazinePanDelay:400,maxListEntries:100,ratings:"",recordSubFolderSort:1};epgd.profile_load=function(b){var a=$.extend(epgd.profile,epgd.userProfile_defaults);epgd.ajax({url:epgd.login.url+"data/parameters",async:false,cache:false,dataType:"json"},function(l){var m,g,d,c,e,h={};for(g in l.parameters){m=l.parameters[g];c=a[m.name];if(c!=undefined&&c!=m.value){a[m.name]=m.type===0?parseInt(m.value,10):m.value;h[m.name]=c;if(m.name.indexOf("logo")==0){epgd.channels.isDirty=true}}}if(epgd.utils.timeOffset==null){epgd.utils.timeOffset=(l.timezone-new Date().getTimezoneOffset()*60)*1000;e=epgd.utils.now();epgd.$dtPicker.datetimepicker("setDate",new Date(e.setMinutes(parseInt(e.getMinutes()/15,10)*15)))}if(!a.minEventTime){e=epgd.utils.now();a.minEventTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0).getTime()/1000;h.minEventTime=0}if(!a.maxEventTime){a.maxEventTime=a.minEventTime+8*24*60*60-60;h.maxEventTime=0}for(d in h){$(window).trigger("profile_updated",h);break}epgd.channels.isDirty&&epgd.channels.load()})};epgd.pages={};epgd.login={user:"",session:"",rights:-1,url:""};epgd.rights={umConfig:2,umConfigEdit:4+2,umConfigUsers:8,umTimer:64,umTimerEdit:128+64,umSearchTimer:256+64,umSearchTimerEdit:512+256+128+64,umFsk:4096,umRecordings:32768,umRecordingsEdit:65536+32768};epgd.utils={timeOffset:null,now:function(){return new Date(new Date().getTime()-this.timeOffset)},date:function(a){return new Date(a*1000-this.timeOffset)},unixTime:function(a){return a?parseInt((a.getTime()+this.timeOffset)/1000,10):0},formatTime:function(a){var b=new Date(a*1000-this.timeOffset);return new String(100+b.getHours()).slice(1)+":"+new String(100+b.getMinutes()).slice(1)},formatDateTime:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)+" "+new String(100+c.getHours()).slice(1)+":"+new String(100+c.getMinutes()).slice(1)},formatDate:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)},popup:function(b,c){var d=$(window),a;c=$.extend({autoOpen:true,dialogClass:"popup",show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:1000},width:400,height:200,maxWidth:d.width()*0.8,maxHeight:d.height()*0.7},c);a=$('<div class="epgPopUp"><p>'+b+"</p></div>").dialog(c);c.autoClose&&window.setTimeout(function(){a.dialog("close").dialog("destroy")},c.autoClose);return a},confirm:function(a,c){var b={modal:true,buttons:{}};b.buttons[epgd.tr.yes]=function(){$(this).dialog("close");c(true)};b.buttons[epgd.tr.no]=function(){$(this).dialog("close");c(false)};this.popup(a,b)},topInfo:function(b,c){var e=c&&c.isError,d,a;c=$.extend({autoClose:e?0:3000,className:"ui-state-"+(e?"error":"highlight")},c);a=(c.autoClose||3000)/2;d=$('<div class="topInfo ui-corner-all '+c.className+'">'+b+'<button onclick="$(this).parent().remove();" class="iAsButton i-cancel" title="'+epgd.tr.close+'"></button></div>').appendTo(epgd.$menu).animate({opacity:0.4},a,function(){d.animate({opacity:1},a)});c.autoClose&&window.setTimeout(function(){d.remove()},c.autoClose)},sendMail:function(c,a,b,d){epgd.ajax({url:epgd.login.url+"data/sendmail",type:"post",data:JSON.stringify({receiver:(d||epgd.profile.mailReceiver),subject:c,body:a,mimetype:b})},function(e){e=e.result;if(e&&e.state==200){epgd.utils.topInfo(epgd.tr.dataSend)}else{epgd.utils.topInfo(e.message,{isError:1})}epgd.profile_load()})},loader:{$win:$('<div style="position:absolute;z-index:9999;width:100%;height:100%;position:fixed;left:0px;top:0px;background:url(images/loader.png) no-repeat 50% 50%"></div>'),cnt:0,process:function(b,c){var a=this;this.cnt++;this.$win.appendTo(document.body).stop().animate({opacity:0.7},{always:function(){try{b()}catch(d){epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),0);a.close()}!c&&a.close()}},200)},close:function(){if(this.cnt>0){this.cnt--;this.cnt==0&&this.$win.remove()}}},addAutoComplete:function(d,b){var c=$(d),e=c[0].className,a=c[0].style.width||"";$(d).autocomplete($.extend({minLength:0,multiselect:false,create:function(i,m){var l=$(this).autocomplete("instance"),n=l.options,k,h;l.selectedItems={};if(n.multiselect){l.multiselect=$("<div></div>").addClass("ui-autocomplete-multiselect ui-state-default ui-widget "+e).css("width",a).insertBefore(l.element).append(l.element).bind("click.autocomplete",function(){l.element.focus()});l.menu.element.css({height:"300px","overflow-y":"auto"});k=parseInt(l.element.css("fontSize")||10,10);function g(p){var o=$(this);o.width(1).width(this.scrollWidth+k-1)}h=$.ui.keyCode;l.element.bind({"keydown.autocomplete":function(p){if((this.value==="")&&(p.keyCode==h.BACKSPACE)){var o=l.element.prev();delete l.selectedItems[o.text()];o.remove()}},"focus.autocomplete blur.autocomplete":function(){l.multiselect.toggleClass("ui-state-active")},"keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete":g}).trigger("change");n.select=n.select||function(p,o){if(!l.selectedItems[o.item.label]){$("<div></div>").addClass("ui-autocomplete-multiselect-item").text(o.item.label).append($("<span></span>").addClass("ui-icon ui-icon-close").click(function(){var q=$(this).parent();delete l.selectedItems[q.text()];q.remove()})).insertBefore(l.element);l.selectedItems[o.item.label]=o.item}l._value("");return false}}else{n.select=n.select||function(p,o){l.selectedItems[0]=o.item;l._value(o.item.label);return false}}}},b)).focus(function(){$(this).autocomplete("search","")})},getAutoCompleteValues:function(i,c){c=c||"";var b="",a=","+c,g,d;try{g=$(i).autocomplete("instance").selectedItems;for(d in g){b+=a+g[d].value+c}}catch(h){}return b.slice(1)},setAutoCompleteValues:function(g,a){var d=$(g).autocomplete("instance"),c,b,e;d.multiselect&&d.multiselect.find(">div").remove();d.selectedItems={};if(a){for(b=0;b<a.length;b++){c=null;e=new RegExp($.ui.autocomplete.escapeRegex(a[b]),"i");$.each(d.options.source,function(){if(e.test(this.value||this.label||this)){return !(c=this)}});if(c){d._trigger("select",null,{item:c.label?c:{label:c,value:c}})}}}},addPlaceholders:function(g,d,a){var b=$(g)[0],c='<ul class="placeholders ui-menu ui-widget ui-widget-content">',e;for(e in a){c+='<li class="ui-menu-item"><b>'+e+"</b>"+a[e]+"</li>"}b.$placeholders=$(c+"</ul>").hide().insertAfter(b).click(function(i){var k=i.target.nodeName=="B"?$(i.target).text():i.target.nodeName=="LI"?$(i.target.firstChild).text():null,l=$(b).prop("selectionStart"),h=$(b).val();if(k){$(b).val(h.substring(0,l)+k+h.substring(l,h.length)).focus();l+=k.length;if(b.setSelectionRange){b.setSelectionRange(l,l)}else{if(b.createTextRange){h=b.createTextRange();h.collapse(true);h.moveEnd("character",l);h.moveStart("character",l);h.select()}}}$(this).hide()});$(b).keydown(function(h){if(h.key==d){$(document).one("click",function(){b.$placeholders.hide()});b.blur();return !b.$placeholders.show().position({my:"left top",at:"left bottom",of:b})}})},inherits:function(a,c){var b=function(){};b.prototype=c.prototype;a.prototype=new b();a.prototype.constructor=a;a.base=c.prototype;return a},log:function(a,c){console.log("error:"+a);try{$.ajax({url:"data/log",type:"get",async:true,cache:false,data:"level="+(c||0)+"&message="+escape(a)})}catch(b){}}};epgd.init=function(){epgd.$con=$('<div id="content"></div>').appendTo(document.body);$.datepicker.setDefaults(epgd.tr.dateTimePicker);$.datepicker.setDefaults({showOtherMonths:true,selectOtherMonths:true});$.timepicker.setDefaults(epgd.tr.dateTimePicker);$.timepicker.setDefaults({timeInput:true,controlType:{create:function(b,g,e,h,c,a,d){if(e=="hour"){if(!b.inst.settings.timeOnly){$("#ui-datepicker-div").width(($(window).width()>500?430:230)+"px")}$("<span><u>0</u><u>2</u><u>4</u><u>6</u><u>8</u><u>10</u><br /><u>12</u><u>14</u><u>16</u><u>18</u><u>20</u><u>22</u><span>").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="minute"){$("<span><u>0</u><u>15</u><u>30</u><u>45</u><span>").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="second"&&epgd.profile.quickTimes){g.closest("dl").find(".ui_tpicker_time").removeClass().bind("click",{tp_inst:b,obj:g,unit:"time"},$.timepicker.quicklink).html('<i><u title="'+epgd.profile.quickTimes.replace(/[^=~]+=@[a-z]+/gi,"").replace(/~{2,}/g,"~").replace(/=!?/g,'">').replace(/~/g,'</u></i><i><u title="')+"</u></i>");if(b.inst.settings.alwaysSetTime){epgd.pages.help.initButtons(b.inst.dpDiv.find(".ui-datepicker-buttonpane").append(epgd.pages.help.getButton("datepicker")))}else{$('<button class="iAsButton i-cancel" role="button">'+epgd.tr.clear+"</button>").appendTo(b.inst.dpDiv.find(".ui-datepicker-buttonpane")).click(function(){b.$input.val("");$.datepicker._hideDatepicker()})}return g}else{return g}}}$('<input class="ui-timepicker-input" value="'+h+'" style="width:20px">').prependTo(g).spinner({min:c,max:a,step:d,change:function(k,i){if(k.originalEvent!==undefined){b._onTimeChange()}b._onSelectHandler()},spin:function(k,i){b.control.value(b,g,e,i.value);b._onTimeChange();b._onSelectHandler()}});return g},options:function(a,d,c,b,e){if(typeof(b)=="string"&&e!==undefined){return d.find(".ui-timepicker-input").spinner(b,e)}return d.find(".ui-timepicker-input").spinner(b)},value:function(a,d,b,g){try{if(g!==undefined){return d.find(".ui-timepicker-input").spinner("value",g)}return d.find(".ui-timepicker-input").spinner("value")}catch(c){return false}}}});epgd.$menu=$('<nav id="menu-top"><ul id="ui-menu-top"><li id="menu_login"><a href="#menu_login">'+epgd.tr.pages.login.label+"</a></li></ul></nav>").appendTo(document.body).find("ul").hide();epgd.$menu.$maxBut=$('<span class="maxi i-menu" />').insertBefore(epgd.$menu).click(function(){epgd.$menu.parent().toggleClass("open")});epgd.$menu.checkMenuSize=function(a,b){if(window.wrm_i){if(window.wrm_w==$(window).width()){window.clearInterval(window.wrm_i);delete window.wrm_i;epgd.$menu.parent().removeClass("mini").width(window.wrm_w).offset({left:$(window).scrollLeft()});epgd.$menu.checkMenuSize(null,b)}else{window.wrm_w=$(window).width()}return}if(a){window.wrm_w=$(window).width();if(!window.wrm_i){window.wrm_i=window.setInterval(epgd.$menu.checkMenuSize,200,null,b)}}else{if(epgd.$menu.height()>40){epgd.$menu.parent().addClass("mini")}window.setTimeout(function(){document.body.style.paddingTop=(epgd.$menu.parent().height()+10)+"px";b&&window.setTimeout(b,200)},200)}};$(window).bind("resize",epgd.$menu.checkMenuSize);epgd.$dtPicker=$('<input type="text" id="selDate" readonly style="z-index:199;position:relative" />').appendTo(document.body).hide().bind("click",function(){$(this).datepicker("show");return false});epgd.$dtPicker.datetimepicker({beforeShow:function(){this.$overlay=$("<div />").addClass("ui-widget-overlay ui-front").appendTo(document.body)},onClose:function(){this.$overlay.remove();$(window).trigger("datepicker")},calendarStart:function(){var a=new Date(epgd.profile.minEventTime*1000);leadDays=(a.getDay()-parseInt(epgd.profile.pickerFirstDay,10)+7)%7;a.setHours(12,0);a.setDate(a.getDate()-leadDays);return a}});epgd.$menu.menu({position:{at:"left bottom"},select:function(a,b){var c=b.item.attr("id");if(!c||c.indexOf("menu_")!=0||(a.originalEvent&&a.originalEvent.target.nodeName!="A"&&a.originalEvent.target.nodeName!="LI")){return false}$(window).trigger("epgd_close");epgd.$menu.parent().removeClass("open");$(".menu-active",this).removeClass("menu-active");$(document.body).append(epgd.$dtPicker.hide());epgd.$menu.checkMenuSize(null,function(){try{b.item.addClass("menu-active").parent().parent(".ui-menu-item").addClass("menu-active");epgd.pages[c.slice(5)].render()}catch(d){epgd.utils.popup(epgd.tr.error.common,{title:epgd.tr.error.error});epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),2)}})}});$(window).bind("epgd_close",function(){$(".epgPopUp").dialog("destroy")}).bind("profile_updated",function(b,a){if(a.minEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{minDateTime:new Date((epgd.profile.minEventTime=parseInt(epgd.profile.minEventTime,10))*1000),minDate:new Date(epgd.profile.minEventTime*1000)})}if(a.maxEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{maxDateTime:new Date((epgd.profile.maxEventTime=parseInt(epgd.profile.maxEventTime,10))*1000),maxDate:new Date(epgd.profile.maxEventTime*1000)})}if(a.pickerFirstDay!=undefined){epgd.$dtPicker.datetimepicker("option",{firstDay:epgd.profile.pickerFirstDay})}if(a.defaultVDRuuid!=undefined){$("#menu_vdrs > select").val(epgd.profile.defaultVDRuuid)}if(a.quickTimes!=undefined){epgd.pages.magazine.initQT()}if(a.needLogin!=undefined){epgd.pages.login.doLogin()}}).bind("login_changed",function(a,b){epgd.$menu.html("").hide();epgd.$con.html("");if(epgd.login.rights){epgd.$menu.append('<li id="menu_now"><a href="#menu_now">'+epgd.tr.menu.now+"</a></li>");epgd.$menu.append('<li id="menu_magazine"><a href="#menu_magazine">'+epgd.tr.menu.magazine+"</a></li>");(epgd.login.rights&epgd.rights.umTimer)==epgd.rights.umTimer&&epgd.$menu.append("<li><a>"+epgd.tr.menu.timer+'</a><ul><li id="menu_timerList"><a href="#menu_timerList">'+epgd.tr.pages.timer.timerList+"</a></li>"+((epgd.login.rights&epgd.rights.umSearchTimer)==epgd.rights.umSearchTimer?'<li id="menu_searchTimerList"><a href="#menu_searchTimerList">'+epgd.tr.pages.timer.searchTimerList+"</a></li>":"")+'<li id="menu_timersDone"><a href="#menu_timersDone">'+epgd.tr.pages.timer.timersDone+'</a></li><li id="menu_timerListDone"><a href="#menu_timerListDone">'+epgd.tr.pages.timer.timerListDone+'</a></li><li id="menu_timerJobList"><a href="#menu_timerJobList">'+epgd.tr.pages.timer.timerJobList+'</a></li><li id="menu_messageList"><a href="#menu_messageList">'+epgd.tr.pages.timer.messageList+"</a></li></ul></li>");(epgd.login.rights&epgd.rights.umRecordings)==epgd.rights.umRecordings&&epgd.$menu.append('<li id="menu_records"><a href="#menu_records">'+epgd.tr.menu.records+"</a></li>");epgd.$menu.append('<li id="menu_search"><a href="#menu_search">'+epgd.tr.menu.search+"</a></li>");epgd.$menu.append("<li><a>"+epgd.tr.menu.options+'</a><ul><li id="menu_profile"><a href="#menu_profile">'+epgd.tr.pages.options.profile+"</a></li>"+((epgd.login.rights&epgd.rights.umConfigEdit)==epgd.rights.umConfigEdit?'<li id="menu_editChannels"><a href="#menu_editChannels">'+epgd.tr.pages.options.editChannels+"</a></li>":"")+((epgd.login.rights&epgd.rights.umConfigUsers)==epgd.rights.umConfigUsers?'<li id="menu_editUser"><a href="#menu_editUser">'+epgd.tr.pages.options.editUser+"</a></li>":"")+"</ul></li>");epgd.$menu.append('<li id="menu_help"><a href="#menu_help">'+epgd.tr.menu.help+"</a></li>");epgd.$menu.append('<li id="menu_vdrs"><a href="#menu_vdrs">VDR</a><select></select></li>')}epgd.profile.needLogin=="1"&&epgd.$menu.append('<li id="menu_login"><a href="#menu_login">'+(epgd.login.session?epgd.login.user+" "+epgd.tr.pages.login.logout:epgd.tr.pages.login.label)+"</a></li>");if(epgd.login.user!=b.user){epgd.profile_load();epgd.channels.isDirty=true;epgd.vdrs.list=null}epgd.channels.load();epgd.vdrs.load();epgd.$menu.show().menu("refresh");epgd.$menu.menu("select",{target:$(epgd.login.rights?(location.hash||"#"+epgd.profile.startPage||"#menu_profile"):"#menu_login")})}).bind("vdrs_load",function(){html="";for(var a in epgd.vdrs.list){html+='<option value="'+a+'"'+(a==epgd.vdrs.current.uuid?"selected":"")+">"+epgd.vdrs.list[a].name+"</option>"}$("<select>"+html+"</select>").replaceAll("#menu_vdrs > select").show().change(function(){epgd.vdrs.current=epgd.vdrs.get(this[this.selectedIndex].value)}).mousedown(function(b){b.stopPropagation();return true}).click(function(b){return false})}).bind("unload",function(){if(epgd.login.session){epgd.pages.login.doLogin("logout")}});epgd.pages.now.init();epgd.pages.magazine.init();epgd.profile_load();if(epgd.profile.needLogin==-1){epgd.profile.needLogin=0;epgd.pages.login.doLogin()}window.setInterval(epgd.profile_load,3600000)};window.onerror=function(i,g,b,d,c){var a=!d?"":"\ncolumn: "+d;a+=!c?"":"\nerror: "+c.stack;try{epgd.utils.log(i+"\nline: "+b+a,2)}catch(h){}return true};$.widget("custom.catcomplete",$.ui.autocomplete,{_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)")},_renderMenu:function(c,b){var d=this,a="";$.each(b,function(g,h){var e;if(h.category!=a){c.append("<li class='ui-autocomplete-category'>"+h.category+"</li>");a=h.category}e=d._renderItemData(c,h);if(h.category){e.attr("aria-label",h.category+" : "+h.label)}})}});$.datepicker._gotoToday=function(c){var b=this._getInst($(c)[0]),a=epgd.utils.now();this._base_gotoToday(c);this._setTime(b,a);this._setDate(b,a);this._hideDatepicker()};$.timepicker.quicklink=function(b){var g=b.target.nodeName=="I"?b.target.firstChild:b.target,a,i=null,h=false;try{a=b.data.tp_inst||$.datepicker._getInst(epgd.$dtPicker[0]).settings.timepicker}catch(c){epgd.utils.log((c.message||"common error")+"\n"+(c.stack||""),2);return false}if(g.nodeName=="U"){if(b.data.unit=="time"){i=$.datepicker.parseTime(a._defaults.timeFormat,g.innerHTML,a._defaults)}else{if(b.data.unit=="hour"){i={hour:parseInt(g.innerHTML,10),minute:a.minute}}}if(i){if(i.hour<a.hour-1){h=true}else{a.control.value(a,a.hour_slider,"hour",i.hour);a._onTimeChange();if(a.hour!=i.hour){h=true}}if(h){h=new Date(a.inst.selectedYear,a.inst.selectedMonth,a.inst.selectedDay+1,i.hour,i.minute);$.datepicker._setDate(a.inst,h);$.datepicker._setTime(a.inst,h);$.datepicker._updateDatepicker(a.inst)}else{a.control.value(a,a.minute_slider,"minute",i.minute)}}else{a.control.value(a,b.data.obj,b.data.unit,parseInt(g.innerHTML,10))}a._onTimeChange();a._onSelectHandler();if(b.target.nodeName=="I"){$.datepicker._hideDatepicker()}}};epgd.ajax=function(b,d,a){var c=$.extend({dataType:"json",contentType:"application/json; charset=utf-8"},b);return $.ajax(c).fail(function(h,g){epgd.utils.loader.close();if(h.status==401){epgd.pages.login.doLogin(null,null,function(){if(epgd.login.rights){c.url=c.url.replace(/sid[^\/]+\//,epgd.login.url);$.ajax(c).done(d).fail(function(){epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})})}else{epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}})}else{if(h.status==403){epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}else{if(h.status==501){epgd.utils.popup(epgd.tr.error.notImplemented,{title:epgd.tr.error.error})}else{if(a&&a.call(this,h,g)){return}var i="";try{if(h.responseJSON){i=h.responseJSON.result.message}}catch(g){i="";epgd.utils.log((g.message||"common error")+"\n"+(g.stack||"")+"\n options:"+JSON.stringify(b)+"\n jqhr:"+JSON.stringify(h),3)}epgd.utils.popup(i||h.responseText||epgd.tr.error.serverNotResponse,{title:epgd.tr.error.error})}}}}).done(d)};epgd.timerDialogBase=function(a){this.$win=null;this.list=null;if(a){this.options=$.extend({},this.options,a)}};epgd.timerDialogBase.prototype={options:{id:"baseDialog",modal:true,draggable:true,resizable:true,autoOpen:false,width:"auto",maxHeight:$(window).height(),close:function(){this.list.dialog.form.reset();$(this.list.dialog.form).next().remove()},buttons:[{text:epgd.tr.del,icons:{primary:"ui-icon-trash"},id:"tBDel",click:function(){$(this).dialog("close");this.list.del(this.list.dialog.form.tID.value)}},{text:epgd.tr.cancel,icons:{primary:"ui-icon-close"},click:function(){$(this).dialog("close")}},{text:epgd.tr.save,icons:{primary:"ui-icon-disk"},click:function(){this.list.dialog.save()}}]},save:function(d,b,a,c){this.list.save(d||this.getData(),b,a,c)&&!this.options.embed&&this.$win.dialog("close")},showError:function(b,a){epgd.utils.popup((a&&a.id?"<b>"+$('label[for="'+a.id+'"]').text()+"</b>":"")+"<div>"+b+"</div>",{autoClose:3000});a&&a.focus();return false},loadFolder:function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recordingdirs"},function(d){if(d.recordingdirs.length){var b=[],c=epgd.vdrs.list,e;$.each(d.recordingdirs,function(h,g){e=c[g.vdruuid];b.push({value:g.directory,category:e?e.name:"-"})});$(a.form.tFolder).catcomplete("option","source",b)}})},close:function(){if(this.$win){this.$win.dialog("close")}},create:function(){var d=this.options,c=epgd.tr.pages.timerList,b="",a;for(a=1;a<epgd.tr.dateTimePicker.dayNamesShort.length;a++){b+='<input name="tWeek" type="checkbox" />'+epgd.tr.dateTimePicker.dayNamesShort[a]}b+='<input name="tWeek" type="checkbox" />'+epgd.tr.dateTimePicker.dayNamesShort[0];this.$win=$('<div id="'+d.id+'" class="searchDialog"><form><div class="colBlock"><div><label>&nbsp;</label><select id="tType"><option value="R">'+epgd.tr.pages.eventDetail.record+'</option><option value="V">'+epgd.tr.pages.eventDetail.ch_switch+'</option></select></div><div><label for="tSName">'+epgd.tr.pages.search.searchName+'</label><input type="text" id="tSName" /></div><div><label for="tInactive">'+c.inactive+'</label><input type="checkbox" id="tInactive" /></div></div><div class="ui-corner-all week">'+b+'</div><div class="onlyTypeR"><label for="tNameMode">'+c.namingMode+epgd.pages.help.getIcon("sTNameMode")+'</label><br /><select id="tNameMode"><option>'+c.namingModes.join("</option><option>")+'</option></select></div><div class="onlyTypeR"><label for="tTemplate">'+c.template+'</label><input class="full" id="tTemplate" type="text" value="" /></div><div class="onlyTypeR"><label for="tFolder">'+c.folder+'</label><input class="full" type="text" id="tFolder" /></div><div class="colBlock"><div class="noTypeS"><label for="tVdr">VDR</label><select id="tVdr"><option value="">Auto</option>'+$("#menu_vdrs").find("select").html()+'</select></div><div class="onlyTypeR"><label for="tPrio">'+c.prio+'</label><input type="number" placeholder="..." min="0" max="99" id="tPrio" style="width:40px" /></div><div class="onlyTypeR"><label for="tLife">'+c.lifetime+'</label><input type="number" placeholder="..." min="0" max="99" style="width:40px" id="tLife"/></div><div class="onlyTypeR"><label for="tVPS">VPS</label><input type="checkbox" id="tVPS" /></div></div><input type="hidden" id="tID" /><br clear="all" /></form></div>');!d.embed&&this.$win.appendTo(document.body).dialog(d);this.$win[0].list=this.list;this.form=this.$win.find("form")[0];$(this.form.tFolder).catcomplete({minLength:0,maxHeight:300}).focus(function(){$(this).catcomplete("search","")});$(this.form.tType).change(function(){if(this.selectedIndex<0){this.selectedIndex=0}this.form.className=this.form.className.replace(/ ?type./,"")+" type"+this[this.selectedIndex].value});$(this.form.tNameMode).change(function(){this.form.tTemplate.parentNode.style.display=(this.selectedIndex==6)?"block":"none"});epgd.utils.addPlaceholders(this.form.tTemplate,"%",c.templateFields);this.loadFolder()},render:function(b){b=b||{};if(!this.$win){this.create()}!this.options.embed&&this.$win.dialog("open").dialog("moveToTop");var c=this.form,e,a;c.tSName.focus();if(b.id){c.tID.value=b.id;this.$win.parent().find("#tBDel").show();this.$win.parent().find("#tBToggle").hide()}else{c.tID.value="";this.$win.parent().find("#tBDel").hide();this.$win.parent().find("#tBToggle").show()}$(c.tType).val(b.type||"R").change();$(c.tVdr).val(b.vdruuid||epgd.profile.timerDefaultVDRuuid);e=b.weekdays||0;for(a=0,f=1;a<c.tWeek.length;a++,f*=2){c.tWeek[a].checked=(e&f)}c.tPrio.value=b.priority||"";c.tLife.value=b.lifetime||"";c.tVPS.checked=b.vps==1;c.tInactive.checked=b.active===0;c.tFolder.value=b.directory||"";c.tSName.value=b.name||"";epgd.pages.help.initButtons(this.$win);this.resize()},resize:function(){this.$win.dialog("option","maxHeight",$(window).height())}};epgd.timerDialog=epgd.utils.inherits(function(){epgd.timerDialogBase.call(this,{id:"timerDialog",title:epgd.tr.pages.timer.timerList+" "+epgd.tr.edit,buttons:[{text:epgd.tr.pages.timer.searchTimerList,icons:{primary:"ui-icon-transferthick-e-w"},id:"tBToggle",click:function(){var a=this.list.dialog.getData(true);if(a){$(this).dialog("close");if(a.title){a.expression=a.title;a.searchfields=1}epgd.pages.searchTimerList.dialog.render(a)}}}].concat(epgd.timerDialog.base.options.buttons)})},epgd.timerDialogBase);epgd.timerDialog.prototype.create=function(){epgd.timerDialog.base.create.call(this);var b=epgd.tr.pages.timerList,a=this.form;$(a).prepend('<input type="hidden" id="tEvID" /><div id="tTitle"></div>');$(a.tWeek[0]).parent().before('<div><label for="tStart">'+b.recordTime+'</label><br /><span id="tEvTime"></span>&nbsp;<input type="text" id="tStart" style="width:165px" /> - <input type="text" id="tEnd" style="width:40px" /></div>');$(a.tNameMode).after('&nbsp;<span id="tFile"></span>');$(a.tFolder).parent().after('<div><label for="tChannels">'+epgd.tr.channel+'</label><input id="tChannel" type="text" class="full"/></div>');$(this.form.tStart).datetimepicker({minDateTime:epgd.utils.now()});$(this.form.tEnd).timepicker({});epgd.utils.addAutoComplete(a.tChannel,{source:epgd.channels.autoCompleteData});a.tFile=$(a).find("#tFile")[0];a.tEvTime=$(a).find("#tEvTime")[0];a.tTitle=$(a).find("#tTitle").click(function(){if(a.tEvID.value){epgd.utils.loader.process(function(){new epgd.eventDetail(a.tEvID.value).render()})}})[0]};epgd.timerDialog.prototype.render=function(a){a=a||{};epgd.timerDialog.base.render.call(this,a);var b=this.form,c;b.tFile.innerHTML=a.file||"...";b.tEvID.value=a.eventid||"";epgd.utils.setAutoCompleteValues(b.tChannel,a.channelid?[a.channelid]:null);b.tTitle.innerHTML=a.title||"";b.tEvTime.innerHTML=a.evStartTime?epgd.utils.formatDateTime(a.evStartTime)+" - "+epgd.utils.formatTime(a.evStartTime+a.evDuration):"";$([b.tStart,b.tEnd]).datetimepicker("option","disabled",!!a.eventid);if(a.day||!a.evStartTime){if(a.starttime){c=epgd.utils.date((a.day+parseInt(a.starttime/100,10)*60*60+(a.starttime%100)*60))}else{if(a.day){c=epgd.utils.date(a.day)}else{c=epgd.utils.now()}}$(b.tStart).datetimepicker("setDate",c);$(b.tStart).datetimepicker("setTime",c);if(a.endtime){c=epgd.utils.date((a.day+parseInt(a.endtime/100,10)*60*60+(a.endtime%100)*60))}else{c=new Date(c.getTime()+2*60*60000)}$(b.tEnd).datetimepicker("setTime",c)}else{$([b.tStart,b.tEnd]).val("...")}b.tNameMode.selectedIndex=typeof a.namingmode=="undefined"?parseInt(a.category=="Serie"?epgd.profile.namingModeSerie:epgd.profile.namingModeMovie,10):a.namingmode;b.tTemplate.value=a.template||(a.category=="Serie"?epgd.profile.namingModeSerieTemplate:epgd.profile.namingModeMovieTemplate);$(b.tNameMode).change()};epgd.timerDialog.prototype.getData=function(g){var b=this.form,e,a,c={};if(b.tEvID.value){c.eventid=parseInt(b.tEvID.value,10)}c.active=b.tInactive.checked?0:1;if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tStart.value&&b.tStart.value!="..."){e=$(b.tStart).datepicker("getDate");c.starttime=e.getHours()*100+e.getMinutes();e.setHours(0);e.setMinutes(0);c.day=parseInt(e.getTime()/1000,10);c.endtime=parseInt(b.tEnd.value.replace(":",""),10)}else{if(!c.eventid&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.timerList.recordTime),b.tStart)}}c.weekdays=0;for(a=0,f=1;a<b.tWeek.length;a++,f*=2){if(b.tWeek[a].checked){c.weekdays+=f}}c.vps=b.tVPS.checked?1:0;if(b.tPrio.value){c.priority=parseInt(b.tPrio.value,10)}if(b.tLife.value){c.lifetime=parseInt(b.tLife.value,10)}c.channelid=epgd.utils.getAutoCompleteValues(b.tChannel);if(!c.channelid&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.channel),b.tChannel)}e=$(b.tVdr).val();if(e){c.vdruuid=e}c.namingmode=b.tNameMode.selectedIndex;c.template=b.tTemplate.value;c.type=$(b.tType).val();if(c.type=="V"&&!e&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$","VDR"),b.tVdr)}c.directory=b.tFolder.value;c.title=b.tTitle.innerHTML||"";c.name=b.tSName.value;return c};epgd.searchTimerDialog=epgd.utils.inherits(function(a){this.searchResultList=null;epgd.timerDialogBase.call(this,$.extend({},{id:"searchTimerDialog",width:530,title:epgd.tr.pages.timer.searchTimerList+" "+epgd.tr.edit,buttons:[{text:epgd.tr.pages.timer.timerList,icons:{primary:"ui-icon-transferthick-e-w"},id:"tBToggle",click:function(){var b=this.list.dialog.getData(true);if(b){$(this).dialog("close");b.channelids&&(b.channelid=b.channelids.split(",")[0]);b.expression&&(b.title=b.expression);epgd.pages.timerList.dialog.render(b)}}},{text:epgd.tr.test,click:function(){this.list.dialog.search()}}].concat(epgd.searchTimerDialog.base.options.buttons,{text:epgd.tr.copy,icons:{primary:"ui-icon-copy"},id:"tBCopy",click:function(b){$(b.currentTarget).hide();this.list.dialog.form.tID.value="";this.list.dialog.form.tSName.value+=" copy";this.list.dialog.form.tSName.select()}})},a))},epgd.timerDialogBase);epgd.searchTimerDialog.prototype.search=function(a,b){if(!this.searchResultList){this.searchResultList=new epgd.searchResultList(null)}if(!this.searchResultList.$con||(a&&a[0]!=this.searchResultList.$con[0])){this.searchResultList.render(a||($('<div style="border-top:1px solid #ccc"></div>').insertAfter(this.form)))}else{this.searchResultList.$con.find("tbody").empty()}if(!this.searchResultList.$con.parent().length){this.searchResultList.$con.insertAfter(this.form);this.searchResultList.init()}this.searchResultList.update(b||this.getData());this.searchResultList.$con[0].scrollIntoView(true)};epgd.searchTimerDialog.prototype.create=function(){epgd.searchTimerDialog.base.create.call(this);var c=epgd.tr.pages.timerList,e=epgd.tr.pages.search,d="",b=this.form,a;for(a in e.searchModes){d+='<option value="'+(parseInt(a,10)+1)+'">'+e.searchModes[a]+"</option>"}if(!epgd.categories){epgd.categories=[];epgd.ajax({url:"data/categories",async:false},function(g){epgd.categories=g.categories})}if(!epgd.genres){epgd.genres=[];epgd.ajax({url:"data/genres",async:false},function(g){epgd.genres=g.genres})}$(b.tSName).parent().parent().after('<div><label for="tExpr">'+e.searchExpression+epgd.pages.help.getIcon("sExpr")+'</label> <input type="text" id="tExpr" style="width:300px" /></div><div class="full"><select id="tSMode" style="width:auto">'+d+'</select>&nbsp;&nbsp;<input type="checkbox" id="tCaseSens" />&nbsp;<label for="tCaseSens">'+e.caseSensitive+'</label></div><div class="ui-corner-all week">'+[""].concat(e.searchFields).join('<input type="checkbox" name="tSFields" />')+'</div><div><label for="tAdv"><input type="checkbox" id="tAdv" />&nbsp;'+epgd.tr.advanced+epgd.pages.help.getIcon("sTAdv")+'</label><div class="ui-corner-all week"><span>'+c.episode+'</span><input type="text" id="tSFEpisode" style="width:200px" /> <span>'+epgd.tr.pages.eventDetail.season+'</span><input type="text" id="tSFSeason" style="width:40px" /> <span>'+epgd.tr.pages.eventDetail.part+'</span><input type="text" id="tSFSPart" style="width:40px" /> <br /><span>'+epgd.tr.pages.eventDetail.category+'</span><input type="text" id="tSFCat" style="width:300px" /> <br /><span>'+epgd.tr.pages.eventDetail.genre+'</span><input type="text" id="tSFGenre" style="width:300px" /> <br /><input type="checkbox" name="tSFTip" value="GoldTipp" />GoldTipp<input type="checkbox" name="tSFTip" value="TagesTipp" />TagesTipp<input type="checkbox" name="tSFTip" value="TopTipp" />TopTipp<br /><span>'+epgd.tr.pages.eventDetail.year+'</span><input type="text" id="tSFYear" style="width:70px" /><br /><input type="checkbox" id="tSFNoEpgMatch" />'+c.noEpgMatch+'</div></div><div class="noTypeS"><div><label for="tRepeat"><input type="checkbox" id="tRepeat" />&nbsp;'+c.noRepeat+epgd.pages.help.getIcon("sTRepeat")+'</label><div class="ui-corner-all week">'+[""].concat(e.searchFields).join('<input type="checkbox" name="tRFields" />')+'</div></div></div><div><input type="radio" name="tChExclude" value="1" id="tChExclude0" /><label for="tChInclude">'+c.chInclude+"</label>"+epgd.pages.help.getIcon("sTChannels")+'<input type="radio" name="tChExclude" value="0" id="tChExclude1" /><label for="tChExclude">'+c.chExclude+'</label></div><input type="text" id="tChannels" class="full"/><div class="noTypeS"><label for="tChFormat">'+c.chFormat+epgd.pages.help.getIcon("sTChFormat")+'</label><input id="tChFormat" readonly onclick="epgd.timerEditChFormat(this)" /></div><div><label for="tTime"><input type="checkbox" id="tTime" />&nbsp;'+epgd.tr.dateTimePicker.timeText+epgd.pages.help.getIcon("sTime")+"</label></div>");$(b.tWeek[0]).before("<span>"+epgd.tr.dateTimePicker.timeTextBetween+' <input type="text" id="tStart" style="width:40px" /> - <input type="text" id="tEnd" style="width:40px" /></span>').parent().append('<br /><span class="onlyTypeS">'+c.nextDays.replace("$field$",'<input style="width:40px" type="text" id="tNextDays" />')+"</span>").insertAfter(b.tTime.parentNode);$([b.tStart,b.tEnd]).timepicker({alwaysSetTime:false});$([b.tTime,b.tRepeat,b.tAdv]).change(function(){$(this).parent().next().toggle(this.checked)});$([b.tSFSeason,b.tSFSPart,b.tSFYear]).change(function(){this.value=this.value.replace(/[^0-9-]/g,"");if(this.value.length==1&&this.value=="-"){this.value=""}});$(b.tType).append('<option value="S">'+epgd.tr.menu.search+"</option>");epgd.utils.addAutoComplete(b.tChannels,{source:epgd.channels.autoCompleteData,multiselect:true});epgd.utils.addAutoComplete(b.tSFCat,{source:epgd.categories,multiselect:true});epgd.utils.addAutoComplete(b.tSFGenre,{source:epgd.genres,multiselect:true})};epgd.searchTimerDialog.prototype.render=function(b){b=b||{searchfields:1};epgd.searchTimerDialog.base.render.call(this,b);var c=this.form,e,a;c.tExpr.value=b.expression||"";$(c.tSMode).val(b.searchmode||4);c.tCaseSens.checked=b.casesensitiv==1;e=b.searchfields||0;for(a=0,f=1;a<c.tSFields.length;a++,f*=2){c.tSFields[a].checked=(e&f)}if(b.starttime||b.endtime||b.weekdays||b.nextdays){c.tTime.checked=true;b.starttime?$(c.tStart).datetimepicker("setTime",new Date(0,0,0,parseInt(b.starttime/100,10),(b.starttime%100))):c.tStart.value="";b.endtime?$(c.tEnd).datetimepicker("setTime",new Date(0,0,0,parseInt(b.endtime/100,10),(b.endtime%100))):c.tEnd.value;c.tNextDays.value=b.nextdays||""}else{c.tTime.checked=false}$(c.tTime).change();e=b.repeatfields||0;for(a=0,f=1;a<c.tRFields.length;a++,f*=2){c.tRFields[a].checked=(e&f)}c.tRepeat.checked=e>0;$(c.tRepeat).change();c.tSFEpisode.value=b.episodename||"";c.tSFSeason.value=b.season||"";c.tSFSPart.value=b.seasonpart||"";c.tSFYear.value=b.year||"";epgd.utils.setAutoCompleteValues(c.tSFCat,new String(b.category).replace(/'/g,"").split(","));epgd.utils.setAutoCompleteValues(c.tSFGenre,new String(b.genre).replace(/'/g,"").split(","));e=b.tipp||"";for(a=0;a<c.tSFTip.length;a++){c.tSFTip[a].checked=e.indexOf("'"+c.tSFTip[a].value+"'")>=0}c.tSFNoEpgMatch.checked=b.noepgmatch==1;c.tAdv.checked=b.episodename||b.season||b.seasonpart||b.year||b.category||b.genre||b.tipp||b.noepgmatch;$(c.tAdv).change();epgd.utils.setAutoCompleteValues(c.tChannels,new String(b.channelids).split(","));if(b.chexclude){c.tChExclude1.checked=1}else{c.tChExclude0.checked=1}c.tChFormat.value=b.chformat||(b.id?"":epgd.profile.chFormat);c.tNameMode.defaultIndex=parseInt(b.category=="Serie"?epgd.profile.namingModeSearchSerie:epgd.profile.namingModeSearchMovie,10);c.tNameMode.selectedIndex=b.namingmode||c.tNameMode.defaultIndex;c.tTemplate.value=b.template||(b.category=="Serie"?epgd.profile.namingModeSearchSerieTemplate:epgd.profile.namingModeSearchMovieTemplate);$(c.tNameMode).change();this.$win.parent().find("#tBCopy").toggle(!!b.id)};epgd.searchTimerDialog.prototype.getData=function(g){var b=this.form,e,a,c={expression:b.tExpr.value};if(b.tSFSeason.value){c.season=b.tSFSeason.value}if(b.tSFSPart.value){c.seasonpart=b.tSFSPart.value}if(b.tSFYear.value){c.year=b.tSFYear.value}if(!g){if(!c.expression){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.search.searchExpression),b.tExpr)}if(c.season&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.season)){return this.showError(epgd.tr.error.invalid,b.tSFSeason)}if(c.seasonpart&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.seasonpart)){return this.showError(epgd.tr.error.invalid,b.tSFSPart)}if(c.year&&!/^((19|20)[0-9]{2})?(-|-(19|20)[0-9]{2})?$/.test(c.year)){return this.showError(epgd.tr.error.invalid,b.tSFYear)}}if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tSFEpisode.value){c.episodename=b.tSFEpisode.value}c.category=epgd.utils.getAutoCompleteValues(b.tSFCat,"'");c.genre=epgd.utils.getAutoCompleteValues(b.tSFGenre,"'");e="";for(a=0;a<b.tSFTip.length;a++){if(b.tSFTip[a].checked){e+=",'"+b.tSFTip[a].value+"'"}}c.tipp=e.slice(1);c.noepgmatch=b.tSFNoEpgMatch.checked?1:0;c.searchmode=parseInt($(b.tSMode).val(),10);c.searchfields=0;for(a=0,f=1;a<b.tSFields.length;a++,f*=2){if(b.tSFields[a].checked){c.searchfields+=f}}c.casesensitiv=b.tCaseSens.checked?1:0;c.repeatfields=0;if(b.tRepeat.checked){for(a=0,f=1;a<b.tRFields.length;a++,f*=2){if(b.tRFields[a].checked){c.repeatfields+=f}}}c.active=b.tInactive.checked?0:1;c.channelids=epgd.utils.getAutoCompleteValues(b.tChannels);c.chformat=b.tChFormat.value;c.chexclude=b.tChExclude1.checked?1:0;if(b.tTime.checked){c.starttime=parseInt(b.tStart.value.replace(":",""),10);c.endtime=parseInt(b.tEnd.value.replace(":",""),10);c.weekdays=0;for(a=0,f=1;a<b.tWeek.length;a++,f*=2){if(b.tWeek[a].checked){c.weekdays+=f}}}c.vps=b.tVPS.checked?1:0;if(b.tPrio.value){c.priority=parseInt(b.tPrio.value,10)}if(b.tLife.value){c.lifetime=parseInt(b.tLife.value,10)}c.directory=b.tFolder.value;e=$(b.tVdr).val();if(e){c.vdruuid=e}c.namingmode=b.tNameMode.selectedIndex;c.template=b.tTemplate.value;c.type=$(b.tType).val();if(c.type=="V"&&!e&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$","VDR"),b.tVdr)}c.name=b.tSName.value;if(b.tNextDays.value){c.nextdays=parseInt(b.tNextDays.value,10)}return c};epgd.searchTimerDialog.prototype.save=function(h,e,c,g){h=h||this.getData();var a=this,i=h.id,b=h.name;h.max=0;h.id&&delete h.id;h.name&&delete h.name;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/search",type:"post",data:JSON.stringify(h)},function(d){h.id=i;h.name=b;if(d.count>50){epgd.utils.confirm(epgd.tr.pages.timerList.confirmSaveBigResult.replace("$cnt$",d.count),function(k){k&&epgd.searchTimerDialog.base.save.call(a,h)})}else{epgd.searchTimerDialog.base.save.call(a,h,e,c,g)}epgd.utils.loader.close()})},true)};epgd.searchDialog=epgd.utils.inherits(function(){epgd.searchTimerDialog.call(this,{id:"search",embed:true,buttons:null});this.searchResultList=new epgd.searchResultList({empty:epgd.tr.pages.search.empty},this)},epgd.searchTimerDialog);epgd.searchDialog.prototype.create=function(){epgd.searchDialog.base.create.call(this);var c=this.form,b=this,a=$('<div id="searchResult"></div>').appendTo(this.$win);$('<button type="submit" id="sSearch" class="iAsButton i-search">'+epgd.tr.pages.search.search+"</button>").insertAfter(c.tExpr).after(' <input type="checkbox" id="sAdv" />&nbsp;<label for="sAdv">'+epgd.tr.advanced+"</label>");$(c.tType).parent().hide().parent().css("border-top","1px solid #ccc").insertAfter($(c.tVdr.parentNode.parentNode).hide());$('<input type="button" class="iAsButton" id="tCopy" value="'+epgd.tr.copy+'" />').insertAfter(c.tSName).click(function(){b.form.tID.value="";b.form.tSName.value+=" copy";b.form.tSName.select()}).prop("disabled",true);$('<input type="button" class="iAsButton" id="tDel" value="'+epgd.tr.del+'" />').insertAfter(c.tSName).click(function(){b.list.del(this.form.tID.value,function(){b.form.tID.value="";b.loadSavedSearch()})}).prop("disabled",true);$('<input type="button" class="iAsButton" value="'+epgd.tr.save+'" />').insertAfter(c.tSName).click(function(){var e=b.getData();if(!e.name){return this.showError(epgd.tr.error.invalid,c.tSName)}b.save(e,null,null,function(){b.loadSavedSearch()})});$(c).submit(function(){b.search(a);return false});this.$win.find("#sExpr").keyup(function(d){if(d.keyCode==13){this.form.sSearch.click();$(this).blur()}}).focus();this.$win.find("#sAdv").change(function(){$(c).toggleClass("noAdv",!this.checked);b.resize()}).prop("checked",epgd.profile.searchAdv=="1").change();$(c.tSName).autocomplete({minLength:0,maxHeight:300,source:function(){return false},select:function(e,g){var h=g.item.data||{id:""};if(h.id){b.render(h);b.form.sSearch.click();$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",false);return false}else{c.tID.value="";$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",true)}}}).focus(function(){$(this).autocomplete("search","")});this.loadSavedSearch()};epgd.searchDialog.prototype.loadSavedSearch=function(){var a=this.form;epgd.ajax({url:epgd.login.url+"data/searchtimers?type=S"},function(c){var b=[];$.each(c.searchtimers,function(e,d){b.push({value:d.name||d.expression,label:d.name||d.expression,data:d})});$(a.tSName).autocomplete("option","source",b)})};epgd.searchDialog.prototype.resize=function(){var a=this.$win.find("#searchResult"),b=$(window).height()-a.offset().top-20;if(b<100){a.css({height:"auto","overflow-y":"visible"})}else{a.css({height:b+"px","overflow-y":"auto"})}};epgd.searchDialog.prototype.render=function(a){if(!epgd.$con.find("#search").length){$("#menu_search").addClass("menu-active");this.create();epgd.$con.html("");this.$win.appendTo(epgd.$con)}a=a||{searchfields:1};a.type="S";epgd.searchDialog.base.render.call(this,a)};epgd.searchDialog.prototype.close=function(){};epgd.channels={list:null,autoCompleteData:null,isDirty:false,selBox:$('<select id="selChannel"></select>')[0],load:function(){if(!this.list||this.isDirty){epgd.ajax({url:epgd.login.url+"data/channels",async:false,cache:false},function(d){var b=(epgd.profile.channelLogoPath?epgd.profile.channelLogoPath+"?maxW=70&maxH=50&id=":false),e="",c={},a=[];d.channels&&$.each(d.channels,function(g,h){var k=h.channelid||g;if(h.name){h.html='<div class="channel" id="'+k+'">'+(b?'<img src="'+b+k+'" alt="'+h.name+'" /><i class="i-tv" title="'+epgd.tr.pages.eventDetail.ch_switch+'" />'+(epgd.profile.logoShowName=="1"?h.name:""):h.name)+"</div>";h.visible&1&&(e+='<option value="'+k+'">'+h.name+"</option>")}else{h.html='<div class="channel" id="'+k+'"><i class="i-tv" title="'+epgd.tr.pages.eventDetail.ch_switch+'" />'+k+"</div>";h.visible&1&&(e+='<option value="'+k+'">'+k+"</option>")}c[k]=h;a.push({label:h.name,value:k})});epgd.channels.list=c;epgd.channels.autoCompleteData=a;$(epgd.channels.selBox).html(e);$(window).trigger("channels_load");this.dirty=false})}},getHtml:function(b){var a=this.list[b];return a?a.html:'<div class="channel" id="'+b+'"><i class="i-tv" title="'+epgd.tr.pages.eventDetail.ch_switch+'" />'+b+"</div>"},getName:function(b){var a=this.list[b];return a?a.name:b}};epgd.eventDetail=function(a){this.id=a;this.data=null;this.expire=0};epgd.eventDetail.prototype.imgPath=false;epgd.eventDetail.prototype.load=function(b,c){var a=this;epgd.ajax({url:epgd.login.url+"data/event?"+(b&&c?"channelid="+b+"&time="+c:"id="+this.id),async:false,cache:false},function(d){a.data=d.event;a.id=d.id;a.expire=epgd.utils.now().getTime()+900000});return this};epgd.eventDetail.prototype.render=function(){if(this.expire<epgd.utils.now().getTime()){this.load()}if(!this.data){return""}this.win.render(this)};epgd.eventDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.eventDetail.record}a=a||this.data;var b={id:a.timerid,eventid:a.id,channelid:a.channelid,title:a.title,evStartTime:a.starttime,evDuration:a.duration,category:a.category,shorttext:a.shorttext,expression:a.title};if(b.eventid){epgd.pages.timerList.dialog.render(b)}else{epgd.pages.searchTimerList.dialog.render(b)}};epgd.eventDetail.prototype.doRepeat=function(c){if(c){return true}var d=this.win,a=d.$con.find(".repeat"),b;if(!a.length){if(!this.searchResultList){this.searchResultList=new epgd.searchResultList(null,{resize:function(){d.$con.last().find('td[data-evId="'+d.detail.data.id+'"]').parent().remove();d.$con.accordion("refresh");a.click()}})}a=$('<h3 class="repeat">'+epgd.tr.pages.eventDetail.repeat+"</h3>").appendTo(d.$con);b={searchfields:1,expression:this.data.title,searchmode:1,casesensitiv:1,fromEventDetail:true};if(this.data.shorttext){b.searchfields1=2;b.expression1=this.data.shorttext}epgd.pages.search.search.call(this,$('<div class="desc"></div>').appendTo(d.$con),b)}else{a.click()}};epgd.eventDetail.prototype.doPlay=function(b){var a=parseInt(epgd.utils.now().getTime()/1000,10)-this.data.starttime;if(a<0||a>this.data.duration){return false}if(b){return true}epgd.vdrs.current.switchChannel(this.data.channelid)};epgd.eventDetail.prototype.doPrev=function(c){var b=this.data.starttime-500,a=this;if(b<epgd.profile.minEventTime){return false}if(c){return true}epgd.utils.loader.process(function(){new epgd.eventDetail().load(a.data.channelid,b).render()})};epgd.eventDetail.prototype.doNext=function(c){var b=this.data.starttime+this.data.duration+500,a=this;if(b>epgd.profile.maxEventTime){return false}if(c){return true}epgd.utils.loader.process(function(){new epgd.eventDetail().load(a.data.channelid,b).render()})};epgd.eventDetail.win=function(){this._create();this.closed=true;this.detail=null;var a=this;$(window).bind("epgd_close.eventDetail",function(){if(!a.closed){a.$win.css("z-Index","");a.$win.hide();$(document).unbind("keyup.eventDetail");a.closed=true;a.$openDialogs&&a.$openDialogs.removeClass("ui-state-disabled")}});$(window).bind("resize.eventDetail",function(b){if(!a.closed){try{a.$win.css("max-width",$(window).width());a.$win.show().position({of:window});a.$con.accordion("refresh")}catch(c){}if(parseInt(a.$win.css("top"),10)<69){a.$win.css("top","69px")}}})};epgd.eventDetail.win.prototype._create=function(){this.imgPath=epgd.profile.eventImgPath?epgd.profile.eventImgPath+"?no=0&maxW=270&maxH=146&id=":false;this.movieImgPath=epgd.profile.movieMediaPath?epgd.profile.movieMediaPath+"?actor_id=0&movie_id=":false;this.movieActorImgPath=epgd.profile.movieMediaPath?epgd.profile.movieMediaPath+"?maxW=60&maxH=90&media_type=4&actor_id=":false;this.serieImgPath=epgd.profile.serieImgPath?epgd.profile.serieImgPath+"?actor_id=0&series_id=":false;this.serieActorImgPath=epgd.profile.serieImgPath?epgd.profile.serieImgPath+"?maxW=60&maxH=90&season_number=0&episode_id=0&media_type=11&actor_id=":false;this.$win=$('<div id="eventDetail" class="ui-front"><div class="ui-front ui-widget ui-widget-content ui-corner-all" style="position:absolute;width:100%;height:100%"><div class="toolbar ui-widget-header ui-corner-all"></div><div></div></div><div class="ui-widget ui-widget-shadow ui-corner-all" style="position:absolute;width:100%;height:100%"></div></div>').appendTo(document.body);this.$con=this.$win.find(":first :last");var c=this,b=epgd.tr.pages.eventDetail,a=this.$win.find(".toolbar")[0];this.$rec=$('<button class="iAsButton i-record"/>').css("float","left").appendTo(a).click(function(){c.detail.doRecord()});$('<button class="iAsButton i-buffer" title="'+b.repeat+'" />').css("float","left").appendTo(a).click(function(){c.detail.doRepeat()});this.$play=$('<button class="iAsButton i-tv" title="'+b.ch_switch+'" />').css("float","left").appendTo(a).click(function(){c.detail.doPlay()});this.$prev=$('<button class="iAsButton i-rewind" title="'+b.eventPrev+'" />').appendTo(a).click(function(){c.detail.doPrev()});this.$next=$('<button class="iAsButton i-forward" title="'+b.eventNext+'" />').appendTo(a).click(function(){c.detail.doNext()});$('<button class="iAsButton i-cancel" title="'+epgd.tr.close+'" />').css("float","right").appendTo(a).click(function(){$(window).trigger("epgd_close.eventDetail")})};epgd.eventDetail.win.prototype.render=function(v){this.detail=v;var t=v.data,b=epgd.tr.pages.eventDetail,g=((parseInt(epgd.utils.now().getTime()/1000,10)-t.starttime)/t.duration*100),d="",x=t.episode||{},s=t.longdescription?'<div title="longdescription">'+t.longdescription+"</div>":"",u="",w=null,p=(this.imgPath&&t.imagecount?this.imgPath+t.id:""),o=null,m=x.episodename||t.title,n=$(window).width()<500,l,q,a,c,k,h,r="";if(t.cntlongdescription){s+='<hr><div title="cntlongdescription">'+t.cntlongdescription+"</div>"}if(t.rating){l=t.rating.slice(t.rating.indexOf("/")).split(" ");for(q=1;q<l.length;q+=3){d+=l[q]+'<div class="stars'+l[q+1].length+'"> </div>'}}u="";for(q in b.extInfo){if(t[q]){u+="<tr><th>"+b.extInfo[q]+"</th><td>"+t[q]+"</td></tr>"}}if(t.scraper&&(a=t.scraper.movie||t.scraper.serie)){a.media=a.media||[];if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="<div>"+(this.movieActorImgPath&&c.actorid?'<img src="'+this.movieActorImgPath+c.actorid+'" />':"")+'<a href="'+epgd.profile.movieActorPath+c.actorid+'" target="_blank">'+c.actorname+"</a>"+(c.actorrole||"")+"</div>"}}if(t.scraper.movie){a.isMovie=true;if(a.media&&this.movieImgPath){if(!p&&a.media["1"]){p=this.movieImgPath+a.movieid+"&media_type=1&maxW=270&maxH=146"}if(a.media["3"]){o=this.movieImgPath+a.movieid+"&media_type=3&maxW=400&maxH=999"}else{if(a.media["1"]){o=this.movieImgPath+a.movieid+"&media_type=1&maxW=400&maxH=999"}}}if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="<div>"+(this.movieActorImgPath?'<img src="'+this.movieActorImgPath+q+'" />':"")+'<a href="'+epgd.profile.movieActorPath+q+'" target="_blank">'+c.actorname+"</a>"+(c.actorrole||"")+"</div>"}}if(a.overview){s='<div title="overview">'+a.overview+"</div><hr />"+s}u="<h3><span>"+b.scrapperMovieInfo+'</span></h3><div><table class="colFull">'+(a.media["1"]&&this.movieImgPath?'<tr><th colspan="2"><img src="'+this.movieImgPath+a.movieid+'&media_type=1&maxW=397&maxH=400" /></th></tr>':"")+(a.title?"<tr><th>"+b.title+"</th><td>"+a.title+"</td></tr>":"")+(a.originaltitle?"<tr><th>"+b.original_title+"</th><td>"+a.originaltitle+"</td></tr>":"")+(a.runtime?"<tr><th>"+b.runtime+"</th><td>"+a.runtime+" "+epgd.tr.minutes+"</td></tr>":"")+(a.movie_release_date?"<tr><th>"+b.release_date+"</th><td>"+a.movie_release_date+"</td></tr>":"")+(a.genres?"<tr><th>"+b.genre+"</th><td>"+a.genres.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"</td></tr>":"")+(a.voteaverage?"<tr><th>"+b.vote_average+'</th><td class="stars"><div class="stars5" style="width:'+parseInt(a.voteaverage*8,10)+'px"></div> ('+a.voteaverage.toFixed(1)+" / 10)</td></tr>":"")+(a.popularity?"<tr><th>"+b.popularity+"</th><td>"+a.popularity.toFixed(1)+"</td></tr>":"")+u+(a.budget?"<tr><th>Budget</th><td>$"+a.budget+"</td></tr>":"")+(a.revenue?"<tr><th>Einnahmen</th><td>$"+a.revenue+"</td></tr>":"")+(a.homepage?"<tr><th>"+b.homepage+'</th><td><a href="'+a.homepage+'">'+a.homepage+"</a></td></tr>":"")+"</table>"+(a.media["0"]&&this.movieImgPath?'<img class="poster" src="'+this.movieImgPath+a.movieid+'&media_type=0&maxW=390&maxh=999" />':"")}else{a.isSerie=true;if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="<div>"+(this.serieActorImgPath?'<img src="'+this.serieActorImgPath+q+"&series_id="+a.seriesid+'" />':"")+"<a>"+c.actorname+"</a>"+(c.actorrole?c.actorrole.replace(/\|/g,"<br />"):"")+"</div>"}}l=a.episode;if(l){if(l.episodeoverview){if(t.longdescription&&l.episodeoverview.length>t.longdescription.length){s=s.replace(/^<div.+<\/div>/i,"")}s='<div title="episodeoverview">'+l.episodeoverview+"</div>"+s}s="<h5>"+l.episodename+"</h5>"+s;if(l.episodegueststars){w+='</div><div class="colFull actors"><h5>'+b.gueststars+"</h5><br />"+l.episodegueststars.replace(/^\||\|$/g,"").replace(/\|/g,"<br />")}}if(!p&&a.media["10"]&&this.serieImgPath){p=this.serieImgPath+a.seriesid+"&season_number="+l.seasonnumber+"&episode_id="+l.episodeid+"&media_type=10&maxW=270&maxH=146"}if(a.media["7"]){o=this.serieImgPath+a.seriesid+"&season_number=0&episode_id=0&media_type=7&maxW=400&maxh=999"}if(a.seriesoverview){s+=s?'<hr /><a href="#" onclick="return !$(this).next().toggle()">Serienbeschreibung</a><div style="display:none" title="seriesoverview">'+a.seriesoverview+"</div>":"<div>"+a.seriesoverview+"</div>"}u="<h3><span>"+b.scrapperSerieInfo+'</span></h3><div><table class="colFull">'+(a.media["1"]&&this.serieImgPath?'<tr><th colspan="2"><img src="'+this.serieImgPath+a.seriesid+'&season_number=0&episode_id=0&media_type=1&maxW=397&maxH=250" /></th></tr>':"")+(a.media["10"]&&this.serieImgPath?'<tr><th colspan="2"><img src="'+this.serieImgPath+a.seriesid+"&season_number="+l.seasonnumber+"&episode_id="+l.episodeid+'&media_type=10&maxW=397&maxH=400" /></th></tr>':"")+(a.seriesname?"<tr><th>"+b.title+"</th><td>"+a.seriesname+"</td></tr>":"")+(a.seriesnetwork?"<tr><th>"+b.network+"</th><td>"+a.seriesnetwork+"</td></tr>":"")+(a.seriesstatus?"<tr><th>"+b.seriesstatus+"</th><td>"+a.seriesstatus+"</td></tr>":"")+(a.seriesfirstaired?"<tr><th>"+b.release_date+"</th><td>"+a.seriesfirstaired+"</td></tr>":"")+(a.seriesgenre?"<tr><th>"+b.genre+"</th><td>"+a.seriesgenre.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"</td></tr>":"")+(a.seriesrating?"<tr><th>"+b.vote_average+'</th><td class="stars"><div class="stars5" style="width:'+parseInt(a.seriesrating*8,10)+'px"></div> ('+a.seriesrating.toFixed(1)+" / 10)</td></tr>":"")+u+(epgd.profile.serieSeasonPath?'<tr><td colspan="2"><a href="'+epgd.profile.serieSeasonPath+a.seriesid+'" target="_blank">'+b.homepage+"</a></td></tr>":"")+"</table>"+(a.media["6"]&&this.serieImgPath?'<img class="poster" src="'+this.serieImgPath+a.seriesid+"&season_number="+l.seasonnumber+'&episode_id=0&media_type=6&maxW=390&maxh=999" />':"")+(a.media["3"]&&this.serieImgPath?'<img class="poster" src="'+this.serieImgPath+a.seriesid+'&season_number=0&episode_id=0&media_type=3&maxW=390&maxh=999" />':"")}}else{a={};u="<h3><span>"+b.extentedInfo+'</span></h3><div><table class="colFull"><tr><th>'+b.title+"</th><td>"+t.title+"</td></tr>"+(x.partname?"<tr><th>"+b.part+"</th><td>"+x.partname+"</td></tr>":"")+(t.year?"<tr><th>"+b.release_date+"</th><td>"+t.year+"</td></tr>":"")+(x.lang?"<tr><th>"+b.lang+"</th><td>"+x.lang+"</td></tr>":"")+u+"</table>"}if(!w&&t.actor){w=t.actor.replace(/, /g,"<br />")}w&&(u+='<div class="colFull actors"><h5>'+b.actors+"</h5>"+w+"</div>");u&&(u+="</div>");k=(t.path?epgd.tr.pages.timerList.folder+"<br />"+t.path.replace(/\//g," / ")+"<br />":"")+(t.genre?(b.genre+"<b>"+t.genre+"</b><br />"):"")+(t.category?b.category+"<b>"+t.category+"</b><br />":"")+(t.country?b.country+"<b>"+t.country+"</b><br />":"")+(t.year?b.year+"<b>"+t.year+"</b><br />":"");h=(x.part?b.part+"<b>"+x.part+(x.parts?" / "+x.parts+"":"")+"</b><br />":"")+(x.season?b.season+"<b>"+x.season+"</b><br />":"")+(x.number?b.number+"<b>"+x.number+"</b><br />":"");if(t.recordings){for(q in t.recordings){l=t.recordings[q];r+='<div class="rec" data-start="'+l.starttime+'" data-owner="'+(l.owner||"")+'" data-md5="'+l.md5path+'" data-path="'+l.path+'"><em>'+epgd.utils.formatDateTime(l.starttime)+"</em><u>"+parseInt(l.duration/60,10)+" "+epgd.tr.minutes+'</u><b onclick="new epgd.recordDetail(this.parentNode).render()"><div class="progress" title="'+l.matchdensitytitle+"% "+epgd.tr.pages.search.matchdensity+'"><div style="width:'+l.matchdensitytitle+'%" ></div></div>'+l.title+(l.shorttext?'<i><div class="progress" title="'+l.matchdensityshorttext+"% "+epgd.tr.pages.search.matchdensity+'"><div style="width:'+l.matchdensityshorttext+'%" ></div></div>'+l.shorttext+"</i>":"")+"</b></div>"}}this.$con=$('<div><h3><div class="date">'+$.datepicker.formatDate(n?"d. M y":"d. MM yy",epgd.utils.date(t.starttime))+"</div>"+(n?"":t.title)+'<div class="time"><b>'+epgd.utils.formatTime(t.starttime)+"</b>&nbsp;&ndash;&nbsp;"+epgd.utils.formatTime(t.starttime+t.duration)+" "+epgd.tr.oClock+"&nbsp;|&nbsp;"+parseInt(t.duration/60,10)+" "+epgd.tr.minutes+'</div></h3><div><div class="colFull"><div class="imgBox">'+(p?'<img src="'+p+'" />':"")+'</div><div class="chPrFl">'+epgd.channels.getHtml(t.channelid)+(g>0&&g<=100?'<div class="progress"><div style="width: '+g+'%"></div></div>':"")+'<div class="audio">'+(t.flags&&t.flags.indexOf("16:9")>0?'<span class="a-169"></span>':"")+(t.audio&&t.audio.indexOf("DolbyDigital")>=0?'<span class="a-dd" title="DolbyDigital"></span>':"")+(t.flags&&t.flags.indexOf("Live")>0?"Live":"")+(t.parentalrating?'<div class="parRate'+t.parentalrating+'">'+b.parentalrating+t.parentalrating+"</div>":"")+"</div>"+(t.merge?"<div>"+b.mergeSrc+t.merge+"</div>":"")+"</div>"+(d?'<div class="stars">'+d+"</div>":"")+'<div class="col2">'+t.title+(x.partname?"<br /><i>"+x.partname+"</i>":(t.shorttext?"<br /><i>"+t.shorttext+"</i>":""))+'</div><div class="col2 rate rate'+(t.numrating||"0")+'">'+(t.tipp?'<b class="tipp">'+t.tipp+"</b>":"")+(t.txtrating?"<span>"+t.txtrating+"</span>":"")+(t.shortreview||"")+"</div>"+(k?'<div class="info">'+k+"</div>":"")+(h?'<div class="info">'+h+"</div>":"")+(o?'<img src="'+o+'" />':"")+'</div><div class="colFull desc">'+(s?s.replace(/\n/g,"<br />"):"")+"</div></div>"+u+(t.category=="Serie"||a.isSerie?'<h3 data-conti="'+m+'"><span>'+b.constabelInfo+'</span></h3><div class="desc"><a class="iAsButton i-edit" href="'+epgd.profile.constabelEditPath+encodeURIComponent(m)+'.episodes" target="constabel">'+epgd.tr.edit+'</a><a class="iAsButton i-link-ext" href="'+epgd.profile.constabelLinkPath+encodeURIComponent(m)+'" target="constabel">'+epgd.tr.pages.eventDetail.addConstableLink+"</a>"+epgd.pages.help.getButton("constabel",true)+(epgd.profile.constabelLoginPath?'<a class="iAsButton i-login" href="'+epgd.profile.constabelLoginPath+'" target="constabel">'+epgd.tr.pages.eventDetail.loginConstable+"</a>":"")+'<pre id="cRaw"></pre></div>':"")+(r?"<h3><span>"+epgd.tr.menu.records+'</span></h3><div class="recordings">'+r+"</div>":"")+"</div>").replaceAll(this.$con);this.$con.accordion({heightStyle:"fill",header:"h3",active:0,beforeActivate:function(e,i){if(i.newHeader.attr("data-conti")){epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/proxy?id=constabel&title="+encodeURIComponent(encodeURIComponent(i.newHeader.attr("data-conti")))+"&_"+new Date().getTime(),dataType:"html",contentType:"text/plain; charset=utf-8"},function(E){if(E.indexOf("Error:")==-1){var F=i.newPanel.find("#cRaw"),D="<thead><tr><th>"+b.season+"</th><th>"+b.part+"</th><th>"+b.number+"</th><th>"+b.title+"</th>",B="<tbody>",A=E.split(/\r?\n/),z,y,C;for(C=0;C<A.length;C++){z=A[C];if(z.charAt(0)=="#"){y=z.match(/EXTRACOL[0-9] (.+)/i);if(y){D+="<th>"+y[1]+"</th>"}}else{y=z.split(/\t/);if(y.length>3){B+="<tr><td>"+y.join("</td><td>")+"</td></tr>"}}}F.html(E).hide().before('<a href="#" onclick="return !!$(\'#cRaw\').toggle()[0].scrollIntoView()">Raw</a>');F.before("<table>"+D+"</thead>"+B+"</tbody></table>")}else{i.newPanel.find("#cRaw").html(epgd.tr.error.noData)}epgd.utils.loader.close()});i.newHeader.removeAttr("data-conti")},true)}}});this.$rec.toggleClass("hasTimer",!!t.timerid).prop("title",this.detail.doRecord(true));this.$play.toggle(this.detail.doPlay(true));this.$prev.toggle(this.detail.doPrev(true));this.$next.toggle(this.detail.doNext(true));this.$con.find(".channel .i-tv").click(function(){epgd.vdrs.current.switchChannel(this.parentNode.id)});this.closed=false;q=Math.max.apply(null,this.$win.siblings(".ui-front:visible").map(function(){return +$(this).css("z-index")}).get());if(q>=+this.$win.css("z-index")){this.$win.css("z-index",q+1)}$(window).trigger("resize.eventDetail");this.$openDialogs=$(".ui-dialog:visible:not(.ui-state-disabled)").addClass("ui-state-disabled");$(document).bind("keyup.eventDetail",function(i){if(i.keyCode==27){$(window).trigger("epgd_close.eventDetail")}});epgd.pages.help.initButtons(this.$con)};epgd.recordDetail=epgd.utils.inherits(function(a){this.elem=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.recordDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recording?starttime="+this.elem.getAttribute("data-start")+"&md5path="+this.elem.getAttribute("data-md5")+"&owner="+this.elem.getAttribute("data-owner"),async:false},function(b){a.data=b.recording});return this};epgd.recordDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.recordDetail.prototype.doPlay=function(a){if(a){return true}epgd.ajax({url:epgd.login.url+"data/replayrecording?vdruuid="+(!epgd.vdrs.list[this.data.vdruuid].usecommonrecfolder?this.data.vdruuid:epgd.vdrs.current.uuid)+"&starttime="+this.data.starttime+"&md5path="+this.data.md5path+"&owner="+(this.data.owner||""),cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.recordDetail.prototype.doPrev=function(b){var a=$(this.elem).prev(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.recordDetail.prototype.doNext=function(b){var a=$(this.elem).next(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.doneTimerDetail=epgd.utils.inherits(function(a){this.tr=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.doneTimerDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/donetimer?id="+this.tr.tData.id,async:false,cache:false},function(c){var b=c.donetimer;if(b.state){b.cntlongdescription=epgd.pages.timerListDone.stateIcons[b.state]}b.episode={lang:b.episodelang,season:b.episodeseason,part:b.episodepart};a.id=c.id;a.expire=epgd.utils.now().getTime()+900000;delete b.timerid;delete b.id;a.data=b});return this};epgd.doneTimerDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.doneTimerDetail.prototype.doPlay=function(a){return false};epgd.doneTimerDetail.prototype.doPrev=function(b){var a=$(this.tr).prev("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};epgd.doneTimerDetail.prototype.doNext=function(b){var a=$(this.tr).next("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};$(document).ready(function(){epgd.eventDetail.prototype.win=new epgd.eventDetail.win()});epgd.pages.editChannels={render:function(){if(!(epgd.login.rights&epgd.rights.umConfigEdit)==epgd.rights.umConfigEdit){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}var i=epgd.tr.pages.editChannels,m=epgd.$con,e,l="",h="",k,c,d,g,b,a;for(d in epgd.channels.list){a=epgd.channels.list[d];k=[];for(g in a.sources){c=a.sources[g];k[c.merge]="<li><u>"+g+'</u> <input type="text" readonly value="'+c.extid+'" /></li>'}l+='<li><em class="i-check'+(a.visible&1?"":"-empty")+'"></em><em style="display:none" class="i-check'+(a.visible&2?"":"-empty")+'"></em><span>'+d+'</span><input type="text" value="'+(a.name||"")+'" /></li>'}for(b in epgd.vdrs.list){h+='<li data-url="vdr&uuid='+b+'">'+epgd.vdrs.list[b].name+"</li>"}e=m.html('<div class="ui-widget"><div class="ui-state-highlight ui-corner-all" style="padding: 0.3em 0.7em; font-size:0.9em"><button class="iAsButton i-down-dir">'+i.menu.channelList+'</button> <span class="i-info-circled" style="display:inline-block"></span>'+epgd.tr.pages.editChannels.headline+'</div></div><div class="pageEditChannels" id="pageEditChannelsHead"><div class="selMarkBlock"><b title="'+epgd.tr.markAll+'" class="selected" data-t="1"></b><b title="'+epgd.tr.markNone+'" data-t="0"></b><b title="'+epgd.tr.markToggle+'"><b class="selected"></b></b></div><div class="selMarkBlock" data-index="0" title="'+epgd.tr.pages.editChannels.checkWeb+'">Web<em title="'+epgd.tr.markAll+'" class="iAsButton i-check"></em><em title="'+epgd.tr.markNone+'" class="iAsButton i-check-empty"></em></div><span><input type="text"/>channel-id</span><span><input type="text"/>channel-name</span></div>').find("button");e.click(function(){var n=this.$menu.show();$(document).bind("click.ui_menu",function(o){if(!$(o.target).closest(".ui-menu").length){n.hide();$(this).unbind("click.ui_menu")}});return false})[0].$menu=$('<ul style="font-size:0.8em; width:200px;position:absolute"><li data-id="loadList"><a>'+i.menu.referenceList+'</a><ul style="width:100px"><li data-id="channelpedia"><a>channelpedia</a></li>'+(h?"<li><a>VDR</a><ul>"+h+"</ul></li>":"")+'<li data-id="insertList"><a>'+i.menu.insertAsText+'</a></li></ul></li><li data-id="getChannelNames"><a>'+i.menu.extentEmptyChannelNames+'</a></li><li data-id="getAllChannelNames"><a>'+i.menu.applyAllChannelNames+'</a></li><li data-id="getOrder"><a>'+i.menu.applyChannelSort+"</a></li></ul>").hide().insertAfter(e).menu({select:function(p,q){var s=q.item,n,r,o="";if(!s.attr("data-id")){s=s.parents("li[data-id]:first")}switch(s.attr("data-id")){case"getChannelNames":o='[value=""]';case"getAllChannelNames":epgd.utils.loader.process(function(){var t=[];$("#pageEditChannelsSource li").each(function(){t[this.lastChild.innerHTML]=this.firstChild.innerHTML});$("#pageEditChannels > li > input"+o).each(function(){this.value=t[this.previousSibling.innerHTML]||this.value})});break;case"getOrder":epgd.utils.loader.process(function(){var u=$("#pageEditChannels"),t;$($("#pageEditChannelsSource span").get().reverse()).each(function(){t=u.find("> li > span:contains("+this.innerHTML+")");if(t.length){t.parent().prependTo(u)}})});break;case"insertList":$('<div title="channel.conf"><p>'+i.desc_insertList+' <a href="http://channelpedia.yavdr.com/gen/DVB-S/S19.2E/S19.2E_complete_sorted_by_groups.channels.conf" target="forList">channelpedia.yavdr.com</p><textarea style="width:100%; height:60%"></textarea><button>ok</button></div>').dialog({modal:true,width:500,height:400}).find("textarea").change(function(){epgd.pages.editChannels.insertReferenceList(this.value);$(this).parent().dialog("destroy")});break;case"loadList":if(q.item.attr("data-url")){epgd.ajax({url:epgd.login.url+"data/proxy?id="+q.item.attr("data-url"),dataType:"html",contentType:"text/plain; charset=utf-8"},epgd.pages.editChannels.insertReferenceList);break}case"channelpedia":n=$('<ul style="width:100px" />').appendTo(q.item)[0];epgd.ajax({url:epgd.login.url+"data/proxy?id=channelpedia",dataType:"html",contentType:"text/plain; charset=utf-8"},function(u){s.attr("data-id","");var t=$(u.replace(/<img [^>]+>/g,"")).find(".entryMenu > ul:first");t.find("br").remove();t.find("a").each(function(){this.parentNode.setAttribute("data-url",this.getAttribute("href"));this.removeAttribute("href")});t.find(">li").each(function(){$('<li data-id="channelpediaList"><a>'+this.firstChild.innerHTML+"</a></li>").append($(this).next("ul").width(400)).appendTo(n)});$(p.target).menu("refresh").menu("expand")});return true;case"channelpediaList":r=q.item.attr("data-url");s.attr("data-id","loadList");q.item.removeAttr("data-url");epgd.ajax({url:epgd.login.url+"data/proxy?id=channelpedia&path="+r,dataType:"html",contentType:"text/plain; charset=utf-8"},function(u){var t=$("<ul />");$(u).find('.singleSourceMainMenu li:contains("channels.conf")').each(function(){var v=$(this);$('<li title="'+v.find(".description").text()+'" data-url="channelpedia&path='+r+v.find(".button a").attr("href")+'"><a>'+v.find(".caption").text()+"</a></li>").appendTo(t)});t.appendTo(q.item);$(p.target).menu("refresh").menu("expand")});return true;default:return false}$(document).trigger("click.ui_menu")}}).position({my:"left top",at:"left bottom",of:e[0]});$('<button class="iAsButton i-save">'+epgd.tr.save+"</button>").insertAfter(e).click(function(){var n={};$("#pageEditChannels > li").each(function(p){var q=$(this),o={};k={};q.find(">ol>li").each(function(s){var t=$(this),r=t.find("input").val();o[t.find("u").text()]=k={merge:s};if(r){k.extid=r}});n[q.find("span").text()]={name:q.find("input").val(),visible:q.find("em:eq(0)").hasClass("i-check")*1+q.find("em:eq(1)").hasClass("i-check")*2,order:p+1,sources:o}});epgd.ajax({url:epgd.login.url+"data/save-channels",type:"post",data:JSON.stringify({channels:n})},function(o){o=o.result;if(o.state==200){epgd.utils.popup(epgd.tr.dataSaved);epgd.channels.isDirty=true}else{epgd.utils.popup(o.message)}})});$('<ol id="pageEditChannels" class="pageEditChannels">'+l+"</ol>").appendTo(m).sortable({revert:"invalid",handle:":not(em)"}).click(function(o){if(o.target.nodeName=="EM"){$(o.target).toggleClass("i-check i-check-empty")}else{$li=$(o.target).closest("li");if($li.parent("#pageEditChannels").length){$li.toggleClass("selected");if(o.shiftKey&&this.lastSel){var n=$(this.lastSel),p=$li.index()-n.index();if(p>0){n.nextAll(":lt("+p+"):not(.filterHide)").toggleClass("selected",n.hasClass("selected"))}else{n.prevAll(":lt("+-p+"):not(.filterHide)").toggleClass("selected",n.hasClass("selected"))}}else{this.lastSel=$li[0]}}}});$('<ol id="pageEditChannelsSource" class="pageEditChannels"></ol>').appendTo(m).sortable({connectWith:"#pageEditChannels",revert:"invalid",remove:function(o,n){$('<li><em class="i-check"></em><span>'+n.item.find("span").text()+'</span><input type="text" value="'+n.item.find("i").text()+'" /></li>').insertAfter(n.item);return false}}).hide();m.append('<br clear="all" />');$(window).bind("resize.editChannels",function(){var n=$(window).height()-$("#pageEditChannels").offset().top-20;if($("#pageEditChannelsSource:visible").length==0||(m.width()-$("#pageEditChannels").width()-$("#pageEditChannelsSource").width()-80)>0){$("#pageEditChannels,#pageEditChannelsSource").css({height:n})}else{$("#pageEditChannels").height(n*0.66);$("#pageEditChannelsSource").height(n*0.33)}}).trigger("resize");$(window).bind("epgd_close.editChannels",function(){$(window).unbind(".editChannels");epgd.channels.load()});$("#pageEditChannelsHead em").click(function(){var p=null,n;try{p=$(window.getSelection().getRangeAt(0).cloneContents()).children()}catch(o){p=null}if(!p||!p.length){n=$("#pageEditChannels > li");p=n.filter(".selected");if(!p.length){p=n}}p.find("> em:eq("+this.parentNode.getAttribute("data-index")+").i-check"+(this.className.indexOf("i-check-empty")>0?"":"-empty")).toggleClass("i-check i-check-empty")});$("#pageEditChannelsHead b").click(function(){var n=this.getAttribute("data-t");$("#pageEditChannels > li").toggleClass("selected",n==1?true:n==0?false:undefined);return false});this.inp_ChID=$("#pageEditChannelsHead input:eq(0)").keyup(this.filter)[0];this.inp_ChName=$("#pageEditChannelsHead input:eq(1)").keyup(this.filter)[0]},filter:function(){var b=epgd.pages.editChannels.inp_ChID.value.toLowerCase(),a=epgd.pages.editChannels.inp_ChName.value.toLowerCase();$("#pageEditChannels > li").each(function(){var c=$(this);if((!b||c.find("span").text().toLowerCase().indexOf(b)>=0)&&(!a||c.find("input").val().toLowerCase().indexOf(a)>=0)){c.removeClass("filterHide")}else{c.addClass("filterHide")}})},insertReferenceList:function(c){var a="",b;$(c.split("\n")).each(function(){b=this.split(":");if(b[0]){a+="<li><i>"+b[0].split(/,|;/)[0]+"</i><span>"+b[3]+"-"+b[10]+"-"+b[11]+"-"+b[9]+"</span></li>"}});$("#pageEditChannelsSource").show().html(a);$(window).trigger("resize.editChannels")}};epgd.pages.editUser={cur:null,render:function(){if(!(epgd.login.rights&epgd.rights.umConfigUsers)==epgd.rights.umConfigUsers){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}var b=epgd.tr.pages.editUser,a=$("<form></form>"),c=$('<select size="10"></select>').change(function(){epgd.pages.editUser.showUser(this[this.selectedIndex].data,a,epgd.pages.editUser.render)});$("<option>"+b.add+"</option>").appendTo(c)[0];epgd.$con.html('<div id="page_editUser"><div><h2>'+b.user+"</h2></div></div>");epgd.ajax({url:epgd.login.url+"data/users",cache:false},function(d){for(var e in d.users){$("<option>"+e+"</option>").appendTo(c)[0].data=d.users[e]}});epgd.$con.find("#page_editUser").append(a).children().first().append(c)},showUser:function(a,d,i){epgd.pages.editUser.cur=a||{user:"",active:1,rights:epgd.login.rights};var h=epgd.tr.pages.editUser,g=epgd.pages.editUser.cur,c="",e;for(e in epgd.rights){c+='<div><input type="checkbox"'+((g.rights&epgd.rights[e])==epgd.rights[e]?' checked="checked"':"")+' name="uRights" id="uR'+e+'" value="'+epgd.rights[e]+'"/><label for="uR'+e+'">'+(h.rights[e]||e)+"</label></div>"}d.html((!g.user?"<h2>"+epgd.tr.pages.login.userName+'</h2><div><input type="text" id="uName" value="" /></div><br />':"")+'<div><input type="radio"'+(g.active=="1"?' checked="checked"':"")+' name="uActive" value="1" id="uActive"/><label for="uActive">'+h.active+'</label> <input type="radio"'+(g.active=="0"?' checked="checked"':"")+' name="uActive" value="0" id="uInactive" /><label for="uInActive">'+h.inActive+"</label>"+(g.user&&' <input type="radio" name="uActive" value="-1" id="uDel"/><label for="uDel">'+epgd.tr.del+"</label>")+"</div><h2>"+epgd.tr.pages.login.password+'</h2><div><input type="password" id="uPass" /></div><h2>'+h.rights.label+"</h2><div>"+c+'</div><div><br /><button class="iAsButton i-save">'+epgd.tr.save+"</button></div>");d.find("button").click(function(){return epgd.pages.editUser.save(this.form,i)});$uRights=$(d[0].uRights).each(function(){this.r=parseInt(this.value,10)});function b(){var k=this.r;if(this.checked){$uRights.each(function(){if(this.r<k&&(k&this.r)==this.r){this.checked=this.disabled=true}})}else{$uRights.each(function(){if(this.r<k&&(k&this.r)==this.r){this.disabled=false;var l=this;$uRights.each(function(){if(this.checked&&this.r>l.r&&(this.r&l.r)==l.r){l.checked=l.disabled=true}})}})}}$uRights.each(b).click(b)},save:function(b,d){var a={rights:1},c=epgd.pages.editUser.cur;$(b.uRights).each(function(){if(this.checked){a.rights|=this.r}});a.active=parseInt(b.uActive.value,10);if(c.user){a.user=c.user;if(a.active==-1){delete a.active;a.state="D"}else{a.state="M";if(a.active==c.active){delete a.active}if(a.rights==c.rights){delete a.rights}if(b.uPass.value){a.passwd=YaMD5.hashStr(a.user+b.uPass.value)}}}else{a.state="C";a.user=b.uName.value;if(!a.user){return !epgd.utils.topInfo(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.login.userName),{isError:1})}a.passwd=YaMD5.hashStr(a.user+b.uPass.value)}epgd.ajax({url:epgd.login.url+"data/save-users",type:"post",data:JSON.stringify({users:[a]})},function(e){if(e.Error||e.result.state!=200){return epgd.utils.topInfo(e.Error||e.result.message,{isError:1})}(a.user==epgd.login.user)&&$(window).trigger("login_changed",a);if($.isFunction(d)){d(e)}});return false}};epgd.pages.help={$con:null,render:function(){$("#menu_help").addClass("menu-active");if(!this.$con){this.load()}epgd.$con.html(this.$con);this.init()},getButton:function(b,a){return(a?"<a":"<button")+' id="bh_'+b+'" class="help iAsButton i-help" role="button">'+epgd.tr.menu.help+"</"+(a?"a>":"button>")},getIcon:function(a){return'<a id="bh_'+a+'" class="help iAsIcon i-help" />'},initButtons:function(a){if(!a){a=epgd.$con}a.tooltip({items:".help",tooltipClass:"quickInfo",content:function(){return epgd.pages.help.getQuickInfo(this.id.slice(3))},open:function(b,c){$(c.tooltip).position({of:b.toElement,my:"left top"});b.preventDefault()}})},getQuickInfo:function(b){var a=epgd.pages.help;if(!a.$con){a.load()}return a.$con.find("#h_"+b).html()||epgd.tr.pages.help.noHelp},load:function(){var a=this;epgd.ajax({url:epgd.tr.pages.help.url,async:false,dataType:"html",contentType:"text/plain; charset=utf-8"},function(b){a.$con=$($(b).filter("#help")[0]);$(b).filter("#help_js").appendTo(document.body)})}};epgd.pages.login={useCookie:document.cookie.match(/login=([^;]+)/),render:function(){if(epgd.login.session){this.doLogin("logout")}this.showForm()},showForm:function(c){var b=epgd.tr.pages.login,a=$("#login");if(!a.length){a=$('<div id="login" title="'+b.label+'" class="searchDialog ui-dialog" style="margin:5% auto"><form class="ui-dialog-content ui-widget-content"><table cellpadding="5"><tr><td>'+b.userName+'</td><td><input type="text" id="lUser" /></td></tr><tr><td>'+b.password+'</td><td><input type="password" id="lPass" /></td></tr><tr><td colspan="2"><input type="checkbox" id="lAlways" /> <label for="lAlways">'+b.loggedAlwaysIn+"</label></td></tr></table></form></div>");a.dialog({modal:true,width:"auto",closeOnEscape:false,buttons:[{text:b.label,icons:{primary:"ui-icon-unlocked"},click:function(){var d=a.find("form")[0];if(!d.lUser.value){return !!epgd.utils.topInfo(epgd.tr.error.emptyField.replace("$field$",b.userName),{isError:1})}$(this).dialog("close");epgd.pages.login.useCookie=d.lAlways.checked?[]:null;epgd.pages.login.doLogin(d.lUser.value,d.lPass.value,c)}}]}).keypress(function(d){if(d.keyCode==13){$(this).parent().find(".ui-dialog-buttonpane button:eq(0)").trigger("click")}}).parent().find(".ui-dialog-titlebar-close").remove()}else{a.dialog("open")}},doLogin:function(c,g,i){var d=epgd.login,b="",h=sessionStorage;try{h.setItem("_storagetest_",1);h.removeItem("_storagetest_")}catch(e){h={removeItem:function(){},setItem:function(){},getItem:function(){return null}}}function a(){if(epgd.login.user!=d.user||epgd.login.rights!=d.rights){if(!epgd.login.session){if(epgd.pages.login.useCookie){epgd.pages.login.useCookie[1]=null;document.cookie="login=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}h.removeItem("login");epgd.login.url=""}else{if(epgd.pages.login.useCookie){epgd.pages.login.useCookie[1]=b;var k=new Date();k.setTime(k.getTime()+365*24*60*60*1000);document.cookie="login="+b+"; expires="+k.toUTCString()}h.setItem("login",b);epgd.login.url="sid"+epgd.login.session+"/"}$(window).trigger("login_changed",d)}epgd.login.url=epgd.login.session?"sid"+epgd.login.session+"/":"";if($.isFunction(i)){i()}}if(c!="logout"){if(d.session){$.ajax({url:d.url+"data/login",data:JSON.stringify({key:""}),type:"post",contentType:"application/json; charset=utf-8",dataType:"json"});epgd.login.url=""}if(epgd.profile.needLogin=="0"){epgd.login={user:"",session:"",rights:4294967295,url:""};return a()}if(c){b=YaMD5.hashStr(c+g)}else{b=h.getItem("login");if(!b&&epgd.pages.login.useCookie){b=epgd.pages.login.useCookie[1]}if(!b){return this.showForm(i)}}}$.ajax({url:epgd.login.url+"data/login",data:JSON.stringify({key:b}),type:"post",contentType:"application/json; charset=utf-8",dataType:"json"}).done(function(l){var k=epgd.tr.pages.login;epgd.login=l.login||{user:"",session:"",rights:0,url:""};if(!epgd.login.session){if(c=="logout"){epgd.utils.topInfo(k.logoutMessage)}else{epgd.utils.topInfo(k.error,{isError:1})}$("#menu_login a").text(k.label)}else{$("#menu_login a").text(epgd.login.user+" "+k.logout);if(location.hash=="#menu_login"||location.hash=="#"){location.hash=""}}return a()})}};epgd.pages.magazine={startTime:null,endTime:null,$head:null,$con:null,list:[],viewCnt:0,scrollStart:0,timeLineL:null,timeLineR:null,qt:{},imgPath:epgd.profile.eventImgPath?epgd.profile.eventImgPath+"?no=0&maxW=100&maxH=70&id=":false,init:function(){this.select=epgd.channels.selBox;$(window).bind("channels_load",function(){var a=epgd.pages.magazine,b;if(!a.$head){return}a.$head.empty();for(b in a.list){a.list[b].index=-1}a._initChannels();for(b in a.list){if(a.list[b].index==-1){a.preTime.removeChild(a.list[b].col);delete a.list[b]}}})},initQT:function(){var a={};epgd.profile.quickTimes.replace(/=([0-9]{1,2}):([0-9]{1,2})/g,function(c,d,b){a[parseInt(d,10)]="<p"+(b?' style="margin-top:'+(b*2)+'px"':"")+"> </p>"});this.qt=a},_initChannels:function(){var b,a;for(a=0;a<this.select.length;a++){b=this.list[this.select[a].value];if(!b){b=new epgd.pages.magazine.channel(this.select[a].value,a,$('<div class="ui-widget-content"/>')[0]);this.list[b.id]=b}else{b.index=a}this.preTime.appendChild(b.col);this.select[a].ch=b;this.$head.append('<div class="ui-widget-content ui-corner-top">'+epgd.channels.getHtml(b.id)+"</div>")}this.$head.css("width",(208*this.select.length+55)+"px")},_initWinBindings:function(){$(window).bind("epgd_close.pages_magazine",function(){epgd.$dtPicker.hide();$(window).unbind(".pages_magazine");clearInterval(this.pages_magazine.timeInterval);delete this.pages_magazine}).bind("resize.pages_magazine",function(){var b=$(window).width(),a=$(this).scrollLeft();this.pages_magazine.$nav.width(b+"px");this.pages_magazine.$con.css("height",($(window).height()-10-$("#magazine").offset().top)+"px");this.pages_magazine.viewCnt=parseInt((b-110)/208,10);if(this.pages_magazine.viewCnt<5){this.pages_magazine.timeLineR.style.left="-50px";this.pages_magazine.$con.css("width",(208*this.pages_magazine.select.length+25)+"px")}else{if(this.pages_magazine.viewCnt>=this.pages_magazine.select.length){this.pages_magazine.viewCnt=this.pages_magazine.select.length;this.pages_magazine.timeLineR.style.left="-50px";b=this.pages_magazine.viewCnt*208+55;this.pages_magazine.$con.css("width",(b-30)+"px")}else{this.pages_magazine.timeLineR.style.left=(a+b-52)+"px";this.pages_magazine.$con.css("width",(208*this.pages_magazine.select.length+150)+"px")}}this.pages_magazine.lineNow.style.width=(b-10)+"px";epgd.$menu.parent().offset({left:a});this.pages_magazine.$nav.offset({left:a});this.pages_magazine.update()}).bind("scroll.pages_magazine",function(){this.pages_magazine.timeLineL.style.left="-50px";this.pages_magazine.timeLineR.style.left="-50px"}).bind("scrollstop.pages_magazine",function(){var a=$(this).scrollLeft();this.pages_magazine.timeLineL.style.left=this.pages_magazine.lineNow.style.left=a+"px";if(this.pages_magazine.viewCnt>=5&&this.pages_magazine.viewCnt<this.pages_magazine.select.length){this.pages_magazine.timeLineR.style.left=(a+$(window).width()-52)+"px"}this.pages_magazine.nextMain=parseInt((a+104)/208,10);if(this.pages_magazine.select.selectedIndex!=this.pages_magazine.nextMain){this.pages_magazine.setMain(0,this.pages_magazine.nextMain,true)}epgd.$menu.parent().offset({left:a});this.pages_magazine.$nav.offset({left:a});return false}).bind("datepicker.pages_magazine",function(){this.pages_magazine.setTime(epgd.utils.unixTime(epgd.$dtPicker.datetimepicker("getDate")||epgd.utils.now()),true)})[0].pages_magazine=this;this.$con.bind("scrollstop.pages_magazine",function(){var a=$(this).scrollTop();if(a>this.pages_magazine.scrollEnd){this.pages_magazine.setTime(a*30+epgd.profile.minEventTime)}else{if(a<this.pages_magazine.scrollStart){this.pages_magazine.setTime(Math.max(this.pages_magazine.startTime-43200,epgd.profile.minEventTime))}}});this._setLineNow();this.timeInterval=setInterval(this._setLineNow,60000)},_setLineNow:function(){var a=window.pages_magazine,b=new Date().getTime()/1000;if(b>a.endTime||(a.startTime-epgd.profile.minEventTime)<-3600){$(window).trigger("epgd_close");$('<div class="ui-widget-overlay ui-front"></div>').click(function(){epgd.profile.minEventTime=epgd.utils.now().getTime()/1000-10800;$(window).trigger("profile_updated",{minEventTime:true});epgd.$dtPicker.datetimepicker("setDate",epgd.utils.now());a.$con.empty();a.render();$(this).remove()}).appendTo(document.body);return}a.lineNow.style.top=((b-a.startTime)/30+a.scrollStart)+"px";a.lineNow.innerHTML=epgd.utils.formatTime(b)},render:function(b){$("#menu_magazine").addClass("menu-active").append(epgd.$dtPicker.show());var a=epgd.utils.unixTime(epgd.utils.now()),c;if(this.startTime&&(this.startTime-epgd.profile.minEventTime)<-3600){this.startTime=null;this.list=[]}if(!this.startTime){$(window).trigger("epgd_close");$(this.select).appendTo(epgd.$menu.find("#menu_magazine")).mousedown(function(d){d.stopPropagation();return true}).click(function(d){return false}).change(function(){epgd.pages.magazine.render($(this).val())});if(this.select.selectedIndex<0){this.select.selectedIndex=0}this.$nav=$('<div id="magazine-nav"><div class="ui-widget-content ui-corner-top left"><div class="ui-widget-content ui-corner-top"><span class="iAsButton i-left-dir"></span><span class="iAsButton i-rewind"></span></div></div><div class="ui-widget-content ui-corner-top right"><div class="ui-widget-content ui-corner-top"><span class="iAsButton i-right-dir"></span><span class="iAsButton i-forward"></span></div></div></div>');this.$head=$('<div id="magazine-head"></div>');this.$con=$('<div id="magazine"></div>');this.$con[0].pages_magazine=this;this.preTime=$('<div style="height:'+parseInt((epgd.profile.maxEventTime-epgd.profile.minEventTime)/30,10)+'px"></div>').appendTo(this.$con)[0];this.timeLineL=$('<div class="ui-widget-content timeLine"></div>').appendTo(this.preTime)[0];this.timeLineR=$('<div class="ui-widget-content timeLine tlr"></div>').appendTo(this.preTime)[0];this.lineNow=$('<p class="timeNow"></p>').appendTo(this.preTime)[0];this._initChannels();this.startTime=a+3600;c=new Date(this.startTime*1000);if(c.getMinutes()>0){c.setMinutes(0);this.startTime=c.getTime()/1000}this.endTime=this.startTime;this.setTime(this.startTime-7200)}if(!window.pages_magazine){this._initWinBindings();epgd.$con.empty();this.$nav.appendTo(epgd.$con).bind("click",this.actionHead);this.$head.appendTo(epgd.$con).bind("click",function(d){if(d.target.className=="i-tv"){epgd.vdrs.current.switchChannel(d.target.parentNode.id)}});this.$con.appendTo(epgd.$con).bind("click",this.actionCon).bind("touchend",this.actionConOpen);if(!$.support.touch&&epgd.profile.magazinePan>0){this._pan()}}$(window).trigger("resize.pages_magazine");if(b){this.setChannel(b)}if(a<this.startTime||a>this.endTime){this.setTime(a)}this.$con.scrollTop((a-epgd.profile.minEventTime)/30-15);$(window).trigger("resize.pages_magazine")},_pan:function(){var b=false,a=$('<div style="width:90%; height:35px; margin-top:15px; position:fixed;z-index:99;left:5%"></div>').prependTo(epgd.$con)[0],c=$('<div style="width:90%; height:35px; position:fixed;z-index:99;bottom:0;left:5%"></div>').appendTo(epgd.$con)[0];this.timeLineL.pan=-1;this.timeLineR.pan=1;a.pan=epgd.profile.magazinePan*-30;c.pan=epgd.profile.magazinePan*30;window.tp=a;window.bp=c;window.p=b;$([this.timeLineL,this.timeLineR,a,c]).mouseover(function(d){if(b){return}b=this.pan;window.setTimeout(function(){if(b){var e=window.setInterval(function(){if(!b||!window.pages_magazine){return window.clearInterval(e)}if(b<-1||b>1){window.pages_magazine.setTime((window.pages_magazine.$con.scrollTop()+15)*30+epgd.profile.minEventTime+b,true)}else{window.pages_magazine.setMain(b)}},(b<-1||b>1?100:1200))}},epgd.profile.magazinePanDelay)}).mouseout(function(){b=false})},setChannel:function(a){this.setMain(0,this.list[a].index)},setMain:function(e,a,d){var b=this.select,c=isNaN(a)?b.selectedIndex:a;c+=e;if(c<0){c=0}else{if(c>=b.length-this.viewCnt){c=b.length-this.viewCnt}}b.selectedIndex=c;this.update();!d&&$(window).scrollLeft(c*208)},setTime:function(g,a){var b,e="",c,d=g+43200;if(g<this.startTime){do{this.startTime-=3600;b=epgd.utils.formatTime(this.startTime);c=parseInt(b,10);if(c%4==0){b+=$.datepicker.formatDate("<br />D,<br />dd<br />MM<br />yy",new Date(this.startTime*1000))}e=(this.qt[c]||"")+"<dfn>"+b+"</dfn>"+e}while(this.startTime>g);$(this.timeLineL).prepend(e);$(this.timeLineR).prepend(e);this.scrollStart=(this.startTime-epgd.profile.minEventTime)/30;if(this.scrollStart<0){this.scrollStart=0;this._setLineNow()}this.preTime.style.paddingTop=this.scrollStart+"px"}if(this.endTime<d){e="";d=Math.max(d,this.endTime+43200);for(;this.endTime<d;this.endTime+=3600){b=epgd.utils.formatTime(this.endTime);c=parseInt(b,10);if(c%4==0){b+=$.datepicker.formatDate("<br />D,<br />dd<br />M<br />yy",new Date(this.endTime*1000))}e+=(this.qt[c]||"")+"<dfn>"+b+"</dfn>"}$(this.timeLineL).append(e);$(this.timeLineR).append(e);this.scrollEnd=(this.endTime-epgd.profile.minEventTime-43200)/30}e&&this.update();a&&this.$con.scrollTop((g-epgd.profile.minEventTime)/30-15)},actionHead:function(b){var a=epgd.pages.magazine,d;if(b.target.nodeName=="SPAN"){d=b.target.className;if(d.indexOf("i-left-dir")>-1){a.setMain(-1)}else{if(d.indexOf("i-rewind")>-1){a.setMain(-a.viewCnt)}else{if(d.indexOf("i-right-dir")>-1){a.setMain(1)}else{if(d.indexOf("i-forward")>-1){a.setMain(a.viewCnt)}}}}}},actionConOpen:function(b){var a=$(b.target).closest("dt")[0];if(a){a.firstOpen=(a.clientHeight!=a.scrollHeight)}},actionCon:function(b){var a=$(b.target).closest("dt")[0];if(a){if(a.firstOpen){return false}if(!a.eventDetail){a.eventDetail=new epgd.eventDetail(a.title)}epgd.utils.loader.process(function(){a.eventDetail.render()})}},update:function(){var a=this,b;for(b=0,j=this.select.selectedIndex;b<this.viewCnt&&j<this.select.length;b++){this.select[j++].ch.updateTime()}window.setTimeout(function(){for(var d=0,c=a.select.selectedIndex+a.viewCnt;d<a.viewCnt&&c<a.select.length;d++){a.select[c++].ch.updateTime()}},500)}};epgd.pages.magazine.channel=function(c,b,a){this.id=c;this.index=b;this.col=a;this.startTime;this.endTime};epgd.pages.magazine.channel.prototype={updateTime:function(){if(!this.startTime){this.startTime=epgd.pages.magazine.startTime;this.endTime=epgd.pages.magazine.endTime;this.loadData(epgd.pages.magazine.startTime,epgd.pages.magazine.endTime)}else{if(epgd.pages.magazine.startTime<this.startTime){this.loadData(epgd.pages.magazine.startTime,this.startTime)}if(epgd.pages.magazine.endTime>this.endTime){this.loadData(this.endTime,epgd.pages.magazine.endTime)}}},loadData:function(c,b){var a=this,d=(a.endTime<b);if(d){a.endTime=b}else{a.startTime=c}epgd.ajax({url:epgd.login.url+"data/events?time="+c+"&endtime="+b+"&channelid="+this.id},function(k){var g="",n=k.events[0],l,e,s=null,r=$(a.col),o,m,p,q;if(n){if(d){s=r.find("dt:last");q=s[0].eTime;if(s.attr("title")==n.id){delete k.events[0]}}else{q=n.starttime;s=r.find("dt:first");if(s.attr("title")==k.events[k.events.length-1].id){delete k.events[k.events.length-1]}}for(l=0;l<k.events.length;l++){e=k.events[l];o=e.shortdescription||e.shorttext;m=e.duration;p=parseInt(m/60,10);m+=(e.starttime-q);m=m<600?20:parseInt(m/30,10);q+=m*30;g+='<dt title="'+e.id+'" style="height:'+m+"px;min-height:"+m+'px"><div class="title">'+e.title+"</div>"+(epgd.pages.magazine.imgPath&&e.imagecount?'<img src="'+epgd.pages.magazine.imgPath+e.id+'" />':"")+'<div class="time'+(e.timerid?" hasTimer":"")+'"><u>'+epgd.utils.formatTime(e.starttime)+"</u><i>"+p+"&nbsp;"+epgd.tr.minutes+"</i></div>"+(e.numrating?'<span class="rate rate'+e.numrating+'"> </span>':"")+(e.tipp?'<b class="tipp">'+e.tipp+"</b>":"")+'<div class="desc">'+(e.genre?"<span>"+e.genre+"</span> ":"")+(o?o.replace(/\n/g,"<br />"):"")+"</div></dt>"}}else{m=(b-c)/30;g='<div style="height:'+m+"px;min-height:"+m+'px"></div>';n={starttime:c};q=c}if(d){r.append(g);r.find("dt:last")[0].eTime=q}else{r.prepend(g);if(s&&s.length){s.css("margin-top","");m=s[0].starttime-q;if(m){m=parseInt(m/30,10)+parseInt(s.css("min-height"),10);s.css({height:m+"px","min-height":m+"px"})}}else{r.find("dt:last")[0].eTime=q}r.find("dt:first").css("margin-top",parseInt((n.starttime-c)/30,10))[0].starttime=n}})}};epgd.pages.now={$ul:null,timestamp_min:-1,timestamp_max:0,timestamp_cur:0,init:function(){$(window).bind("channels_load",function(){epgd.pages.timestamp_max=0})},render:function(){if(!window.pages_now){this.$search=$('<div style="float:left;margin-left:5px"></div>').appendTo($("#menu_now")).click(function(){if(this.curType=="@Now"){window.pages_now.setTime(null,"@Now")}});var a=this.$searchMenu=$('<ul class="ui-menu ui-widget ui-widget-content"></ul>').appendTo($("#menu_now")).hide();epgd.profile.quickTimes&&epgd.profile.quickTimes.replace(/([^=]+)=!?([^~]+)~?/g,function(c,b,d){a.append('<li data-type="'+d+'" class="ui-menu-item '+(d.indexOf("@")==0&&d!="@Next"&&d!="@Now"?"i-search":"i-clock")+'">'+b+"</li>")});if(!a.find('li[data-type="@Next"]').length){a.prepend('<li data-type="@Next" class="ui-menu-item">'+epgd.tr.pages.eventDetail.eventNext+"</li>")}if(!a.find('li[data-type="@Now"]').length){a.prepend('<li data-type="@Now" class="ui-menu-item">'+epgd.tr.pages.dateTimePicker.currentText+"</li>")}this.$searchMenu.click(function(b){if(b.target.getAttribute("data-type")){window.pages_now.setTime(null,b.target.getAttribute("data-type"));a.hide()}});$(window).bind("epgd_close.pages_now",function(){if(window.pages_now){epgd.$dtPicker.hide();window.pages_now.$searchMenu.remove();window.pages_now.$search.remove();delete window.pages_now}$(window).unbind(".pages_now");$("#menu_now").unbind(".pages_now")}).bind("datepicker.pages_now",function(){this.pages_now.setTime(epgd.utils.unixTime(epgd.$dtPicker.datetimepicker("getDate")))})[0].pages_now=this;this.$ul=epgd.$con.html('<div id="pageNow"><ul class="teaserList"></ul></div>').find("ul").click(function(c){if($(c.target).closest(".channel").length){$(window).trigger("epgd_close.eventDetail");if(c.target.className=="i-tv"){epgd.vdrs.current.switchChannel(c.target.parentNode.id)}else{epgd.$menu.menu("select",{target:"#menu_magazine"});epgd.pages.magazine.setChannel(c.target.parentNode.id)}return}var b=$(c.target).closest("li")[0];if(!b){return}if(!b.eventDetail){b.eventDetail=new epgd.eventDetail(b.title)}epgd.utils.loader.process(function(){b.eventDetail.render()})});this.setTime(null,"@Now")}$("#menu_now").addClass("menu-active").bind("click.pages_now",function(b){if((b.target==this||b.target.nodeName=="A")&&window.pages_now){window.pages_now.$searchMenu.show();b.preventDefault()}return false}).append(epgd.$dtPicker.show())},setTime:function(c,b){b=b||"@time";var a=" "+epgd.tr.pages.now.at;if(b=="@Now"||b=="@time"){this.timestamp_cur=c||epgd.utils.unixTime(epgd.utils.now());this.load("data/events?time="+this.timestamp_cur);epgd.$dtPicker.datetimepicker("setDate",epgd.utils.date(this.timestamp_cur))}else{if(b=="@Next"){this.load("data/events?next=1&time="+this.timestamp_cur)}else{if(b[0]=="@"){a=" "+epgd.tr.menu.search;this.load("data/search","post",JSON.stringify({autotimername:b.slice(1)}))}else{$.timepicker.quicklink({target:{nodeName:"U",innerHTML:b},data:{unit:"time"}});$(window).trigger("datepicker")}}}this.$search[0].curType=b;this.$search.text(this.$searchMenu.find('li[data-type="'+b+'"]').text()+a)},load:function(a,b,c){epgd.utils.loader.process(function(){pages_now.$ul.empty();epgd.ajax({url:epgd.login.url+a,async:false,cache:false,type:b,data:c},function(h){if(!h.events||!h.events.length){epgd.utils.loader.close();return epgd.utils.popup(epgd.tr.error.noData)}var i=epgd.profile.eventImgPath?epgd.profile.eventImgPath+"?no=0&maxW=100&maxH=70&id=":false,g=0,d=2000000000,e=epgd.tr.dateTimePicker.dateFormat.replace(/\.?y+/,"");now=parseInt(epgd.utils.now().getTime()/1000,10);$.each(h.events,function(o,m){var k=m.starttime+m.duration,l=((now-m.starttime)/m.duration*100),n=m.shortdescription||m.shorttext;if(m.starttime>g){g=m.starttime}if(k<d){d=k}$('<li title="'+m.id+'" class="ui-widget-content ui-corner-all">'+epgd.channels.getHtml(m.channelid)+'<div class="time'+(m.timerid?" hasTimer":"")+'"><b>'+epgd.utils.formatTime(m.starttime)+"</b>&nbsp;&ndash;&nbsp;"+epgd.utils.formatTime(k)+" "+epgd.tr.oClock+(m.tipp?'<b class="tipp">'+m.tipp+"</b>":"")+"</div>"+(l>0&&l<=100?'<div class="progress"><div style="width: '+l+'%"></div></div>':'<div class="date">'+epgd.utils.formatDate(m.starttime,e)+"</div>")+'<div class="desc">'+(i&&m.imagecount?'<img src="'+i+m.id+'" />':"")+'<div class="title">'+m.title+(m.numrating?'<span class="rate rate'+m.numrating+'"> </span>':"")+"</div>"+(m.genre?"<span>"+m.genre+"</span> ":"")+(n?n.replace(/\n/g,"<br />"):"")+"</div></li>").appendTo(pages_now.$ul)});epgd.pages.now.timestamp_min=g;epgd.pages.now.timestamp_max=d;epgd.utils.loader.close()})},true)}};epgd.pages.profile={render:function(){var b=epgd.profile.startPage.slice(5),c="<option>"+epgd.tr.pages.timerList.namingModes.join("</option><option>")+"</option>",a='<form id="page_profile"><h3>Interface</h3><div><table><tr><td>startpage</td><td><select id="startPage">'+jQuery.map(epgd.tr.menu,function(e,d){return'<option value="menu_'+d+(b==d?'" selected="selected">':'">')+e+"</option>"}).join("")+'</select></td></tr><tr><td>default VDR</td><td><select id="defaultVDRuuid">'+$("#menu_vdrs").find("select").html()+'</select></td></tr><tr><td>datepicker first day</td><td><select id="pickerFirstDay"><option>'+epgd.tr.dateTimePicker.dayNames.join("</option><option>")+'</option></select></td></tr><tr><td>quicklinks</td><td><textarea rows="5" style="float:left;width:50%; margin-right:10px" id="quickTimes" onchange="epgd.pages.profile.validate.quickTimes(this)">'+epgd.profile.quickTimes.replace(/~/g,"\n")+'</textarea><span>enter in each line label=hh:mm(24h), eg:<br />prime time=20:15 or prime time=!20:15 (this time will not be highlighted in magazine)<br />now=@Now or next=@Next<br />tip=@searchtimerName</span></td></tr><tr><td>constabel-login</td><td><input type="text" class="full" id="constabelLoginPath" value="'+(epgd.profile.constabelLoginPath||"")+'" /><br />e.g.https://www.eplists.de/eplist.cgi?action=login&login=[username]&secret=[password]</td></tr><tr><td>'+epgd.tr.pages.profile.maxListEntries+'</td><td><input type="text" id="maxListEntries" value="'+epgd.profile.maxListEntries+'" data-valexp="^[1-9]{0,3}$" /></td></tr><tr><th colspan="2">'+epgd.tr.menu.magazine+"</th><tr><tr><td>"+epgd.tr.pages.profile.magazinePan+'</td><td><input type="text" id="magazinePan" value="'+epgd.profile.magazinePan+'" data-valexp="^[0-9]{1,2}$" /></td></tr><tr><td>'+epgd.tr.pages.profile.magazinePanDelay+'</td><td><input type="text" id="magazinePanDelay" value="'+epgd.profile.magazinePanDelay+'" data-valexp="^[1-9][0-9]{2,3}$" /></td></tr><tr><th colspan="2">'+epgd.tr.pages.timer.timerList+"</th><tr><tr><td>"+epgd.tr.pages.timerList.namingMode+"</td><td><b>"+epgd.tr.pages.eventDetail.scrapperSerieInfo+"</b><div>"+epgd.tr.pages.timer.timerList+': <select id="namingModeSerie">'+c+'</select><input id="namingModeSerieTemplate" value="'+epgd.profile.namingModeSearchSerieTemplate+'" type="text" style="width:90%" /></div><div>'+epgd.tr.pages.timer.searchTimerList+': <select id="namingModeSearchSerie">'+c+'</select><input id="namingModeSearchSerieTemplate" value="'+epgd.profile.namingModeSearchSerieTemplate+'" type="text" style="width:90%" /></div><b style="text-decoration:line-through">'+epgd.tr.pages.eventDetail.scrapperSerieInfo+"</b><div>"+epgd.tr.pages.timer.timerList+': <select id="namingModeMovie">'+c+'</select><input id="namingModeMovieTemplate" value="'+epgd.profile.namingModeMovieTemplate+'" type="text" style="width:90%" /></div><div>'+epgd.tr.pages.timer.searchTimerList+': <select id="namingModeSearchMovie">'+c+'</select><input id="namingModeSearchMovieTemplate" value="'+epgd.profile.namingModeSearchMovieTemplate+'" type="text" style="width:90%" /></div></td></tr><tr><td>'+epgd.tr.pages.timerList.chFormat+'</td><td><input id="chFormat" readonly onclick="epgd.timerEditChFormat(this)" value="'+epgd.profile.chFormat+'" /></td></tr><tr><td>VDR</td><td><select id="timerDefaultVDRuuid"><option value="">Auto</option>'+$("#menu_vdrs").find("select").html()+"</select></td></tr><tr><td>"+epgd.tr.pages.profile.mailReceiver+'</td><td><input type="mail" value="'+(epgd.profile.mailReceiver||"")+"\" id=\"mailReceiver\" /><button onclick=\"epgd.utils.sendMail('checkMailAddress','it works','',$(form.mailReceiver).val())\">"+epgd.tr.test+"</button></td></tr><tr><td>"+epgd.tr.pages.profile.sendMessages+"</td><td>"+jQuery.map(epgd.tr.pages.timerList.messageTypes,function(e,d){return'<input type="checkbox" value="'+d+'" name="messageMailTypes"'+(epgd.profile.messageMailTypes.indexOf(d)>=0?' checked="checked"':"")+" />"+e}).join("&nbsp;&nbsp;")+'</td></tr><tr><th colspan="2">'+epgd.tr.menu.search+"</th><tr><tr><td>"+epgd.tr.advanced+'</td><td><input type="checkbox" id="searchAdv" /></td></tr><tr><th colspan="2">VDR OSD</th><tr><tr><td>'+epgd.tr.pages.profile.vdr.startWithSched+'</td><td><input type="checkbox" id="startWithSched"'+(epgd.profile.startWithSched=="1"?' checked="checked"':"")+' /></td></tr><tr><th colspan="2">'+epgd.tr.menu.records+"</th><tr><tr><td>"+epgd.tr.pages.profile.record.subFolderSort+'</td><td><select id="recordSubFolderSort"><option value="1">'+epgd.tr.pages.eventDetail.title+' up</option><option value="2">'+epgd.tr.pages.eventDetail.title+' down</option><option value="3">'+epgd.tr.pages.timerList.folder+' up</option><option value="4">'+epgd.tr.pages.timerList.folder+' down</option><option value="5">'+epgd.tr.pages.timerList.recordTime+' up</option><option value="6">'+epgd.tr.pages.timerList.recordTime+" down</option></select></td></tr></table></div>";if((epgd.login.rights&epgd.rights.umConfigEdit)==epgd.rights.umConfigEdit){a+="<h3>System</h3><div></div>"}epgd.$con.html(a+'</form><br /><input type="button" value="'+epgd.tr.save+'" onclick="epgd.pages.profile.save()" class="ui-button ui-widget ui-state-default ui-corner-all">');this.form=$("#page_profile").tooltip().accordion({headers:"<h3>",collapsible:true,heightStyle:"content",activate:function(e,g){var d=g.newPanel[0];if(d&&!d.hasLoaded){d.hasLoaded=true;if(g.newHeader.text()=="System"){$(d).html('<table><tr><th colspan="2">'+epgd.tr.pages.login.label+"</th></tr><tr><td>"+epgd.tr.pages.login.needLogin+'</td><td><input type="checkbox" id="needLogin" /></td></tr></table>').find("#needLogin").click(function(){if(this.checked&&!this.hasUsers){this.checked=false;var h=this;epgd.ajax({url:epgd.login.url+"data/users",cache:false},function(l){var i=null,k,m;for(m in l.users){i=l.users[m];if(i.active){return(h.hasUsers=h.checked=true)}}k=$('<form title="'+epgd.tr.pages.editUser.user+" "+(i?i.user:epgd.tr.pages.editUser.add)+'"></form>');epgd.pages.editUser.showUser(i,k,function(){k.dialog("close");if(!i){h.hasUsers=h.checked=true}else{$(h).click()}});k.dialog({modal:true,width:"auto"})})}}).prop("checked",epgd.profile.needLogin=="1");epgd.ajax({url:epgd.login.url+"data/parameters",async:true,cache:false,dataType:"json"},function(n){var l="",k,q,r,m=epgd.tr.pages.profile.system,o=1,h=2;for(k in n.parameters){q=n.parameters[k];if(q.owner=="epgd"){l+="<tr><td>"+(m[q.name]||q.name)+"</td><td>";r=typeof q.value=="undefined"?q["default"]:q.value;if(q.type==o){r=epgd.utils.formatDateTime(r)}if(q.readonly){l+=r}else{l+='<input data-value="'+r+'" data-valexp="'+(q.valexp||"")+'" id="'+q.name+'"';if(q.type==h){l+=' type="checkbox"'+(r=="1"?" checked":"")}else{l+=' type="text" class="full" value="'+r+'"'}l+=" /></td></tr>"}}}l&&$(d).find("table").append('<tbody id="pSystem"><tr><th>'+m.label+'</th><th style="min-width:300px"></th></tr>'+l+"</tbody>")})}}}})[0];this.form.namingModeSerie.selectedIndex=epgd.profile.namingModeSerie;this.form.namingModeSearchSerie.selectedIndex=epgd.profile.namingModeSearchSerie;this.form.namingModeMovie.selectedIndex=epgd.profile.namingModeMovie;this.form.namingModeSearchMovie.selectedIndex=epgd.profile.namingModeSearchMovie;$([this.form.namingModeSerie,this.form.namingModeSearchSerie,this.form.namingModeMovie,this.form.namingModeSearchMovie]).change(function(){this.nextSibling.style.display=(this.selectedIndex==6)?"block":"none"}).change();epgd.utils.addPlaceholders(this.form.namingModeSerieTemplate,"%",epgd.tr.pages.timerList.templateFields);epgd.utils.addPlaceholders(this.form.namingModeSearchSerieTemplate,"%",epgd.tr.pages.timerList.templateFields);epgd.utils.addPlaceholders(this.form.namingModeMovieTemplate,"%",epgd.tr.pages.timerList.templateFields);epgd.utils.addPlaceholders(this.form.namingModeSearchMovieTemplate,"%",epgd.tr.pages.timerList.templateFields);$(this.form.quickTimes).one("focus",function(){var d=this;epgd.ajax({url:epgd.login.url+"data/searchtimers?type=S"},function(g){var e={"@Now":": current time","@Next":": next event"};$.each(g.searchtimers,function(i,h){e["@"+h.name||h.expression]=": saved timer"});epgd.utils.addPlaceholders(d,"@",e)})});this.form.searchAdv.checked=epgd.profile.searchAdv=="1";epgd.profile.defaultVDRuuid&&$(this.form.defaultVDRuuid).val(epgd.profile.defaultVDRuuid);$(this.form.timerDefaultVDRuuid).val(epgd.profile.timerDefaultVDRuuid);$(this.form.recordSubFolderSort).val(epgd.profile.recordSubFolderSort);this.form.pickerFirstDay.selectedIndex=(epgd.profile.pickerFirstDay||epgd.tr.dateTimePicker.firstDay)},save:function(){var d=epgd.profile,g=[],e=this.form,a="@"+epgd.login.user,b;function c(h){if(d[h.name]!=h.value){g.push(h)}}if(!this.validate.quickTimes(e.quickTimes)||!this.validate.checkRegex(e.magazinePan)||!this.validate.checkRegex(e.magazinePanDelay)){return false}c({name:"defaultVDRuuid",value:$(e.defaultVDRuuid).val()||"",owner:a});c({name:"quickTimes",value:e.quickTimes.value.replace(/\n/g,"~"),owner:a});c({name:"startWithSched",value:$(e.startWithSched).prop("checked")?"1":"0",owner:a});c({name:"pickerFirstDay",value:new String(e.pickerFirstDay.selectedIndex),owner:a});c({name:"startPage",value:$(e.startPage).val()||"",owner:a});c({name:"namingModeSerie",value:new String(this.form.namingModeSerie.selectedIndex),owner:a});c({name:"namingModeSearchSerie",value:new String(this.form.namingModeSearchSerie.selectedIndex),owner:a});c({name:"namingModeMovie",value:new String(this.form.namingModeMovie.selectedIndex),owner:a});c({name:"namingModeSearchMovie",value:new String(this.form.namingModeSearchMovie.selectedIndex),owner:a});c({name:"namingModeSerieTemplate",value:new String(this.form.namingModeSerieTemplate.value),owner:a});c({name:"namingModeSearchSerieTemplate",value:new String(this.form.namingModeSearchSerieTemplate.value),owner:a});c({name:"namingModeMovieTemplate",value:new String(this.form.namingModeMovieTemplate.value),owner:a});c({name:"namingModeSearchMovieTemplate",value:new String(this.form.namingModeSearchMovieTemplate.value),owner:a});c({name:"timerDefaultVDRuuid",value:$(e.timerDefaultVDRuuid).val()||"",owner:a});c({name:"constabelLoginPath",value:$(e.constabelLoginPath).val()||"",owner:a});c({name:"chFormat",value:$(e.chFormat).val()||"",owner:a});c({name:"searchAdv",value:$(e.searchAdv).prop("checked")?"1":"0",owner:a});c({name:"messageMailTypes",value:$(e.messageMailTypes).map(function(){return this.checked?this.value:""}).toArray().join(""),owner:a});c({name:"mailReceiver",value:$(e.mailReceiver).val()||"",owner:a});c({name:"magazinePan",value:$(e.magazinePan).val()||"",owner:a});c({name:"magazinePanDelay",value:$(e.magazinePanDelay).val()||"",owner:a});c({name:"maxListEntries",value:$(e.maxListEntries).val()||"",owner:a});c({name:"recordSubFolderSort",value:$(e.recordSubFolderSort).val()||"1",owner:a});b=$("#pSystem").parent().parent()[0];if(b&&b.hasLoaded){c({name:"needLogin",value:$(e.needLogin).prop("checked")?"1":"0",owner:"webif"});$("#pSystem input").each(function(){if(this.type=="checkbox"){if(this.checked!=(this.getAttribute("data-value")=="1")){g.push({name:this.id,value:(this.checked?"1":"0"),owner:"epgd",valexp:this.getAttribute("data-valexp")})}}else{if(this.getAttribute("data-value")!=this.value){if(epgd.pages.profile.validate.checkRegex(this)){g.push({name:this.id,value:this.value,owner:"epgd"})}else{g=[];return false}}}})}if(g.length){if(b){b.hasLoaded=false}b=$("#page_profile").accordion("option","active");$("#page_profile").accordion("option","active",false).accordion("option","active",b);epgd.ajax({url:epgd.login.url+"data/save-parameters",type:"post",data:JSON.stringify({parameters:g})},function(h){h=h.result;if(h&&h.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(h.message,{isError:1})}epgd.profile_load()},function(k){try{var i="";$(k.responseJSON.result.failed).each(function(){i+="<li>"+e[g[this].name].parentNode.previousSibling.innerHTML+"</li>"});if(i){epgd.utils.popup("<ol>"+i+"</ol>",{title:epgd.tr.error.invalid});return true}}catch(h){}return false})}},validate:{quickTimes:function(a){a.value=a.value.replace(/\n{2,}/g,"\n").replace(/^\n+|\n+$/g,"");if(!/^(\n?[^=]+=!?(([0-1]?[0-9]|2[0-4]):[0-5]?[0-9]|@Now|@Next|@[A-Za-z0-9]*))*$/.test(a.value)){a.focus();epgd.utils.popup(epgd.tr.error.invalid);return false}return true},checkRegex:function(a){if(a.getAttribute("data-valexp")&&!new RegExp(a.getAttribute("data-valexp")).test(a.value)){a.focus();epgd.utils.popup(epgd.tr.error.invalid);return false}return true}}};epgd.pages.records={render:function(){if(!(epgd.login.rights&epgd.rights.umRecordings)==epgd.rights.umRecordings){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}if(!epgd.profile.recordSubFolderSort){epgd.profile.recordSubFolderSort=1}$("#menu_records").addClass("menu-active");var a=epgd.tr.pages.records;if(!this.$bar){this.$bar=$('<div class="ui-widget ui-state-highlight ui-corner-all" style="padding:3px 10px"><button class="iAsButton i-trash" title="'+epgd.tr.del+'"/><div id="recBar"><button class="iAsButton i-refresh" onclick="epgd.pages.records.update()">'+epgd.tr.reload+"</button>"+epgd.pages.help.getIcon("recRefresh")+"&nbsp;&nbsp; "+epgd.tr.pages.search.search+epgd.pages.help.getIcon("recSearch")+'<button class="iAsButton" onclick="this.checked = !this.checked; $(this).toggleClass(\'ui-state-highlight\', this.checked); epgd.pages.records.search();">&nbsp;&#8727;</button><input id="rSVal" type="text" onkeyup="epgd.pages.records.search(this.value)" /><button class="iAsButton" onclick="this.checked = !this.checked;$(this).toggleClass(\'ui-state-highlight\', this.checked); epgd.pages.records.search();">&#8727;&nbsp;</button><span style="display:none"><button class="iAsButton i-rewind" onclick="epgd.pages.records.searchMove(1)"></button><span id="rSCnt">0</span><button class="iAsButton i-forward" onclick="epgd.pages.records.searchMove(-1)"></button></span>&nbsp;&nbsp; <input type="checkbox" id="dragdrop"'+($.support.touch?"":' checked="checked"')+' onchange="epgd.pages.records.dd(this.checked)" />'+a.ddLabel+epgd.pages.help.getIcon("recDD")+"</div></div>");this.$trash=this.$bar.find(".i-trash").droppable({accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(c,d){var b=d.helper.context;epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$",b.getAttribute("data-path")),function(e){e&&epgd.pages.records.del(b)});return false}}).click(function(){var b=$("#records").find(".rec.selected");b.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(b.length>1?"<br />"+b.length+epgd.tr.entries:""),function(c){c&&b.each(function(){epgd.pages.records.del(this)})})});this.curSearch={pattern:"",searchValue:"",hits:$(),cur:0,$count:this.$bar.find("#rSCnt"),fromStart:this.$bar.find("#rSVal").prev("button")[0],toEnd:this.$bar.find("#rSVal").next("button")[0]};epgd.pages.help.initButtons(this.$bar)}this.$bar.insertAfter(epgd.$menu);epgd.$menu.checkMenuSize();$(window).bind("epgd_close.records",function(){epgd.pages.records.$bar.remove();epgd.$menu.checkMenuSize();$(window).unbind(".records")});epgd.$con.html('<div id="records"></div>');epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/recordings",cache:false},function(x){var b=x.recordings,g,y,o,l,n,r,m={f:{},r:[]},d={},s,k,h="",q=" "+epgd.tr.minutes,u,e=epgd.profile.recordSubFolderSort==6?function(p,i){return p.starttime>i.starttime?-1:1}:epgd.profile.recordSubFolderSort==5?function(p,i){return p.starttime>i.starttime?1:-1}:epgd.profile.recordSubFolderSort==4?function(p,i){return p.path>i.path?-1:1}:epgd.profile.recordSubFolderSort==3?function(p,i){return p.path>i.path?1:-1}:epgd.profile.recordSubFolderSort==2?function(p,i){return p.tit>i.tit?-1:1}:function(p,i){return p.tit>i.tit?1:-1};for(s in epgd.vdrs.list){k=epgd.vdrs.list[s];if(!k.usecommonrecfolder){d[s]={f:{},r:[]}}h+="<div>VDR - "+k.name+": "+k.videodir+" - "+parseInt(k.videofree/1000,10)+" GB "+a.available+" / "+parseInt(k.videototal/1000,10)+" GB</div>"}if(!$("#dragdrop").parent().length){return false}epgd.$con.find("#records").before(h);h="";for(r in b){g=b[r];l=d[g.vdruuid]||m;o=g.path.split("/");o.pop();for(n=0;n<o.length;n++){y=o[n].replace(/_/g," ");l=l.f[y]||(l.f[y]={f:{},r:[]})}l.r.push(g)}function w(z){var i=false,v,p;z.cnt=0;for(v in z.f){p=z.f[v];if(p.r.length==1){z.r.push(p.r.pop())}w(p);if(w(p)){i=true;z.cnt+=p.cnt}else{delete z.f[v]}}if(!i){delete z.f}z.cnt+=z.r.length;return i||z.r.length>0}function c(i){Object.keys(i.f).sort().forEach(function(v){var t=i.f[v],p;h+=v?'<div class="folder"><h4><span class="i-folder-closed">('+(t.cnt)+')</span><m class="i-"/>'+v+"</h4>":"<div>";t.f&&c(t);if(t.r.length){for(p in t.r){g=t.r[p];g.tit=((g.name!=v?g.name:"")+(v!=g.title&&(g.title!=g.name)?"<br />"+g.title:"")+(g.shorttext&&(g.shorttext!=g.name)?"<i>"+g.shorttext+"</i>":""))||v;g.html='<div class="rec" data-start="'+g.starttime+'" data-owner="'+(g.owner||"")+'" data-md5="'+g.md5path+'" data-path="'+g.path+'"><em>'+epgd.utils.formatDateTime(g.starttime)+"</em><u>"+parseInt(g.duration/60,10)+q+"</u><b>"+g.tit+"</b></div>"}t.r.sort(e);for(p in t.r){h+=t.r[p].html}}h+="</div>"})}n={};if(w(m)){n[a.commonRecFolder]=m}for(s in d){l=d[s];if(w(l)){n["VDR - "+epgd.vdrs.list[s].name]=l}}c({f:n});u=epgd.$con.find("#records").html(h);if(!u.length){return false}u=u.click(epgd.pages.records.action).find(">div");if(u.length==1){u.first().toggleClass("open")}epgd.pages.records.$menu=$('<ul class="ui-menu ui-widget ui-widget-content" style="position:absolute"><li class="ui-menu-item" data-type="title"><a class="iAsButton i-sort-name-up" data-sort="1"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="2"></a>&nbsp;'+epgd.tr.pages.eventDetail.title+'</li><li class="ui-menu-item" data-type="path"><a class="iAsButton i-sort-name-up" data-sort="3"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="4"></a>&nbsp;'+epgd.tr.pages.timerList.folder+'</li><li class="ui-menu-item" data-type="start"><a class="iAsButton i-sort-name-up" data-sort="5"></a>&nbsp;<a class="iAsButton i-sort-name-down" data-sort="6"></a>&nbsp;'+epgd.tr.pages.timerList.recordTime+"</li></ul>").hide().appendTo(epgd.$con);$("#dragdrop").change();epgd.pages.records.curSearch.$recs=null;epgd.utils.loader.close()})},true)},search:function(e){var c=this.curSearch,h,b,d,a=c.fromStart.checked,g=c.toEnd.checked;if(!c.$recs){c.$recs=epgd.$con.find("#records .rec,h4")}if(typeof e=="string"){c.searchValue=e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}d=(a?">"+c.searchValue:c.searchValue).toLowerCase()+(g?"<":"");if(d==c.pattern){return}h=c.searchValue.length;b=c.$recs;if(c.hits.length){$(c.hits).each(function(){this.innerHTML=this.innerHTML.replace(/<mark>([^<]+)<\/mark>/gi,"$1")}).parents(".tmp-open").removeClass("tmp-open");if(d.indexOf(c.pattern)==0){b=$(c.hits)}else{c.cur=0}c.hits=[]}else{c.cur=0}c.pattern=d;if(h>2){b.each(function(){var i=this.innerHTML.toLowerCase().indexOf(d);if(i>0){c.hits.push(this);$(this).parents(".folder").addClass("tmp-open");do{if(a){i++}this.innerHTML=this.innerHTML.slice(0,i)+"<mark>"+c.searchValue+"</mark>"+this.innerHTML.slice(i+h)}while((i=this.innerHTML.toLowerCase().indexOf(d,i+13))>0)}});c.$count.text(c.hits.length).parent().show();this.searchMove(0)}else{c.$count.parent().hide()}},searchMove:function(a){this.curSearch.cur+=a;var b=this.curSearch.hits[this.curSearch.cur];if(!b){this.curSearch.cur=a<0?this.curSearch.hits.length-1:0;b=this.curSearch.hits[this.curSearch.cur]}if(b){b.scrollIntoView(false);$(b).css({"background-color":"green"});window.setTimeout(function(){$(b).css({"background-color":""})},1500)}},action:function(b){var a=b.target;if(a.nodeName=="MARK"){a=a.parentNode}if(a.nodeName=="M"){epgd.pages.records.$menu.show().position({my:"left top",at:"left bottom",of:a}).find("a").removeClass("ui-state-highlight");epgd.pages.records.$menu.find("a[data-sort="+(a.curSort||epgd.profile.recordSubFolderSort)+"]").addClass("ui-state-highlight");$(document).one("click.recmenu",function(d){if(d.target.nodeName=="A"){var c=d.target.parentNode.getAttribute("data-type");if(c){a.curSort=d.target.getAttribute("data-sort");epgd.pages.records.sort(a.parentNode.parentNode,a.curSort)}}epgd.pages.records.$menu.hide();$(document).unbind(".recmenu")}).bind("keyup.recmenu",function(c){if(c.keyCode==27){$(document).trigger("click.recmenu")}});return false}if(a.nodeName=="I"||a.nodeName=="SPAN"){a=a.parentNode}if(a.nodeName=="B"){a=a.parentNode;if(!a.recDetail){a.recDetail=new epgd.recordDetail(a)}epgd.utils.loader.process(function(){a.recDetail.render()})}else{if(a.nodeName=="H4"){a=a.parentNode;if(a.nodeName=="DIV"&&a.className.indexOf("folder")>=0){if(a.className.indexOf("open")==-1){if($(window).width()<500){$(a).siblings(".open").removeClass("open");document.body.scrollTop=$(a).offset().top-35}$(a).addClass("open")}else{$(a).removeClass("open")}}}else{$(a).closest(".rec").toggleClass("selected")}}},dd:function(b){var c=$("#records"),a=c.find(".rec").has(".ui-draggable");if(b&&a.length==0){c.find("h4").droppable(this.__dropSettings);a.end().draggable({cancle:"b",revert:"invalid",distance:15,helper:function(){return $(this).clone().css("display","block")},appendTo:"body",cursor:"pointer",cursorAt:{left:-15,top:5},start:function(d,e){$(document).trigger("click.recmenu");$(document.body).addClass("dd-open");document.body.style.paddingTop=epgd.pages.records.$bar.height()+"px";document.body.scrollTop-=d.pageY-$(d.delegateTarget).closest(".folder").offset().top},stop:function(d,e){$(document.body).removeClass("dd-open");epgd.$menu.checkMenuSize()}})}else{if(a.length){a.draggable(b?"enable":"disable")}}},__dropSettings:{accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(b,c){console.log("Dropped!",b,c);var a=$(b.target),d="";do{d=a.text().replace(/^\(.*\)/,"")+"/"+d;a=a.parent()}while((a=a.prevAll("h4")).length);epgd.pages.records.move(c.draggable.context,d.slice(d.indexOf("/",2)+1).replace(/ /g,"_"),b.target.parentNode);return false}},update:function(){epgd.ajax({url:epgd.login.url+"data/updaterecordings"},function(a){epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace("$sec$",5),{autoClose:5000});$(window).trigger("epgd_close.records");window.setTimeout(function(){epgd.pages.records.render()},5000)})},move:function(e,h,d){var g=e.getAttribute("data-path").split("/"),b=g.pop(),c,a=0;g=g.join("/")+"/";for(c=0;c<Math.min(h.length,g.length)&&h[c]==g[c];c++){if(h[c]=="/"){a=c}}g=window.prompt(epgd.tr.pages.records.moveMessage.replace("$src$",g),h.concat(g.slice(a)).replace(/\/{2,}/g,"/").replace(/\/$/,""));if(g){epgd.ajax({url:epgd.login.url+"data/renamerecording?starttime="+e.getAttribute("data-start")+"&md5path="+e.getAttribute("data-md5")+"&owner="+e.getAttribute("data-owner")+"&name="+g.replace(/\//g,"~"),async:true},function(n){n=n.result;if(n&&n.state==200){var k=$(e),p=k.prevAll("h4").find("span"),o=$(d),m=g.split("/"),l;k.attr("data-path",g+"/"+b);k.attr("data-md5","").draggable("disable").addClass("ui-state-disabled");m.shift();k.parents(".folder:not(:last)").find(">h4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");for(l=0;l<m.length;l++){if(o.find(">.folder>h4").each(function(){if(this.lastChild.nodeValue==m[l]){o=$(this.parentNode);p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");return true}else{return false}}).length==0){for(;l<m.length;l++){o=$('<h4><span class="i-folder-closed">(1)</span><m class="i-"/>'+m[l]+"</h4></div>").droppable(epgd.pages.records.__dropSettings).wrap('<div class="folder open"></div>').parent().appendTo(o)}}}k.appendTo(o);epgd.pages.records.sort(d);epgd.utils.topInfo(epgd.tr.dataSaved);epgd.pages.records.__updateRec(e)}else{epgd.utils.topInfo(n.message,{isError:1});return false}})}return !!g},__updateRec:function(b,a){epgd.ajax({url:epgd.login.url+"data/recording?starttime="+b.getAttribute("data-start")+"&path="+b.getAttribute("data-path")+"&owner="+b.getAttribute("data-owner")+"&"+a,async:true},function(c){$(b).attr("data-md5",c.recording.md5path).draggable("enable").removeClass("ui-state-disabled")},function(d,c){if(!a){a=0}else{if(a>=5){return epgd.utils.popup(epgd.tr.pages.records.notFoundMessage,{title:epgd.tr.error.error})}}window.setTimeout(epgd.pages.records.__updateRec,3000,b,++a);return true})},del:function(a){epgd.ajax({url:epgd.login.url+"data/deleterecording?starttime="+a.getAttribute("data-start")+"&md5path="+a.getAttribute("data-md5")+"&owner="+a.getAttribute("data-owner"),async:true},function(b){b=b.result;if(b&&b.state==200){epgd.utils.topInfo(a.getAttribute("data-path")+"<br />"+epgd.tr.dataSaved);$(a).parents(".folder:not(:last)").find(">h4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});$(a).remove()}else{epgd.utils.topInfo(a.getAttribute("data-path")+"<br />"+b.message,{isError:1})}})},sort:function(a,d){var e=$(a).find(">div.rec"),b=d%2?1:-1,c;if(!d){d=$(">h4>m",a)[0].curSort||epgd.profile.recordSubFolderSort}if(d<3){e.sort(function(h,g){return h.lastChild.innerHTML>g.lastChild.innerHTML?b:-b}).appendTo(a)}else{c=d<5?"data-path":"data-start";e.sort(function(h,g){return h.getAttribute(c)>g.getAttribute(c)?b:-b}).appendTo(a)}$(a).find(">div.folder").each(function(){epgd.pages.records.sort(this,d)})}};epgd.sortTable=function(a){this.o=$.extend({conSel:epgd.$con,empty:"",right:1},a)};epgd.sortTable.prototype={sortIcons:'<span class="iAsButton i-sort-name-down sort"></span><span class="iAsButton i-sort-name-up sort"></span>',update:function(){},hideHead:function(){var a=this.$con.find("thead:first").hide().find(">tr>th");this.$con.find("tbody:first").html('<tr><td colspan="'+a.length+'">'+this.o.empty+(a.last().find(".i-doc-new").wrapAll("<div />").parent().html()||"")+"</td></tr>")},showHead:function(){this.$con.find(">table>thead").show();this.filter();this.sort()},getTable:function(){},action:function(a,c,b){switch(c){case"refresh":this.update();break;case"detail":if(!a[0].eventDetail){a[0].eventDetail=new epgd.eventDetail(b)}epgd.utils.loader.process(function(){a[0].eventDetail.render()});break}},render:function(a,b){this.trs=[];this.$con=a||$(this.o.conSel);this.$con.empty();if(!(epgd.login.rights&this.o.right)==this.o.right){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}this.$con.html(this.getTable());this.init();this.update(b)},init:function(){var b=this,a=0;this.$con.find(">table").click(function(h){var e=$(h.target),g=e[0],i=g.getAttribute("data-evId"),k,c;if(i){b.action(e,"detail",i)}else{if(h.target.className=="i-tv"){epgd.vdrs.current.switchChannel(h.target.parentNode.id)}else{e=e.closest("span.sort");if(e.length){e.parent().parent().find(".ui-state-highlight").removeClass("ui-state-highlight");e.addClass("ui-state-highlight");b.sort(e)}else{e=$(g).closest("span.edit");if(e.length){b.action(e,e[0].className.match(/i-([a-z0-9-]+)/)[1])}if(b.o.selectable){if(g.nodeName=="TD"){e=$(g).parent().toggleClass("selected");if(h.shiftKey&&this.lastSel){c=$(this.lastSel);k=e.index()-c.index();if(k>0){c.nextAll(":lt("+k+"):visible").toggleClass("selected",c.hasClass("selected"))}else{c.prevAll(":lt("+-k+"):visible").toggleClass("selected",c.hasClass("selected"))}}else{this.lastSel=e[0]}}else{if(g.nodeName=="B"){k=g.getAttribute("data-t");$(b.trs).filter(":visible").toggleClass("selected",k==1?true:k==0?false:undefined);return false}}}}return false}}}).find(">thead>tr").find(">th").each(function(){this.cIndex=a;a+=this.colSpan}).end().find('[data-defaultSort="1"]>span.sort:last,[data-defaultSort="-1"]>span.sort:first').addClass("ui-state-highlight");this.$con.find(">table>thead input.filter").keyup(function(){b.filter()}).each(function(){if(!this.result){this.result=$('<i style="padding-left:5px;font-weight:normal"></i>').insertAfter(this)[0]}})},sort:function(e){e=e||this.$con.find(">table>thead .ui-state-highlight");if(!e.length){return}var c=e.parent()[0],g=(e.hasClass("i-sort-name-down")?-1:1),a=this.trs,b,h;if(!c.sortInfo){c=c.cIndex;for(b=0;b<a.length;b++){h=a[b].cells[c];h.sort=h.getAttribute("data-sort")||$(h).text().toLowerCase()}}else{c=c.cIndex}a.sort(function(i,d){var l=i.cells[c].sort,k=d.cells[c].sort;return(l>k?1*g:l==k?0:-1*g)});this.$con.find(">table>tbody").append(a.slice())},filter:function(){var b={},a,d,e,c;this.$con.find(">table>thead input.filter").each(function(){if(this.value){b[this.parentNode.cIndex]=[this.value.toLowerCase(),0,this.result||{}]}else{if(this.result){this.result.innerHTML=""}}});for(a=0;a<this.trs.length;a++){e=this.trs[a];c="";for(d in b){if(e.cells[d].innerHTML.toLowerCase().indexOf(b[d][0])==-1){c="none"}else{b[d][1]++}}e.style.display=c}for(d in b){if(b[d][2].innerHTML=b[d][1]){}}}};epgd.timerEditChFormat=function(c){var a=",SD,HD,3D",b=c.value,d;if(b){b=b.split(",");for(d=0;d<b.length;d++){a=a.replace(","+b[d]+",",",")}}$('<div title="'+epgd.tr.pages.timerList.chFormat+'"><ol style="float:left; border:2px inset #ddd; min-height:50px; margin-right:20px;">'+(b.length?"<li>"+b.join("</li><li>")+"</li>":"")+'</ol><ul style="float:left; border:2px inset #ddd; min-height:50px;list-style-type:none">'+(a.length>1?"<li>"+a.slice(1).replace(/,/g,"</li><li>")+"</li>":"")+"</div>").dialog({modal:true,buttons:[{text:epgd.tr.apply,click:function(){var e="";$(this).find("ol > li").each(function(){e+=","+this.innerHTML});c.value=e.slice(1);$(this).dialog("close")}},{text:epgd.tr.cancel,click:function(){$(this).dialog("close")}}]}).find("ul,ol").sortable({connectWith:"ul,ol"}).disableSelection()};epgd.timerListBase=epgd.utils.inherits(function(a,b){this.dialog=b;if(this.dialog){this.dialog.list=this}if(!a.conSel){a.conSel="#content"}if(!a.empty){a.empty=epgd.tr.pages.timerList.empty}epgd.sortTable.call(this,a)},epgd.sortTable);epgd.timerListBase.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'<table id="timerList" class="timerTable"><thead><tr><th style="min-width:120px">'+epgd.tr.channel+this.sortIcons+'</th><th></th><th data-defaultSort="1" colspan="2">'+a.startTime+this.sortIcons+' <input type="text" class="filter" style="width:50px" /></th><th>'+a.endTime+'</th><th style="min-width:120px">'+epgd.tr.pages.eventDetail.title+this.sortIcons+' <input type="text" class="filter" style="width:100px" /></th><th style="min-width:120px">VDR'+this.sortIcons+' <input type="text" class="filter" style="width:50px" /></th><th style="min-width:130px">'+this.sortIcons+(this.o.addNew?'<span class="iAsButton i-doc-new edit" title="'+a.newTimer+'"></span><span class="iAsButton i-refresh edit" title="'+epgd.tr.reload+'"></span>':"")+(this.o.selectable?'<br clear="all" /><span style="margin-top:3px" class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span><div class="selMarkBlock" style="width:auto"><b title="'+epgd.tr.markAll+'" class="selected" data-t="1"></b><b title="'+epgd.tr.markNone+'" data-t="0"></b><b title="'+epgd.tr.markToggle+'"><b class="selected"></b></b></div>':"")+"</th></tr></thead><tbody></tbody></table>"};epgd.timerListBase.prototype.update=function(){var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(g){if(!g.timers.length){a.hideHead()}else{var b=[],i=a.editIcons,h="DF",e={D:'<div class="i-trash">'+epgd.tr.pages.timerList.timerStates.D+"</div>",E:'<div class="i-warning">'+epgd.tr.pages.timerList.timerStates.E+"</div>",F:'<div class="i-ok">'+epgd.tr.pages.timerList.timerStates.F+"</div>",R:'<div class="i-progress">'+epgd.tr.pages.timerList.timerStates.R+"</div>",P:'<div class="i-clock">'+epgd.tr.pages.timerList.timerStates.P+"</div>",U:'<div class="i-help">'+epgd.tr.pages.timerList.timerStates.U+"</div>"},d=epgd.tr.pages.timerList.timerActions,c='<span class="iAsButton i-flashlight edit" title="'+epgd.tr.pages.timer.searchTimerList+" "+epgd.tr.edit+'" data-id="$id$">$title$</span>';$.each(g.timers,function(n,k){k.action=k.action?k.action.toUpperCase():"A";k.state=k.state?k.state.toUpperCase():"U";var m=epgd.vdrs.list[k.vdruuid]||{name:"--"},l=$("<tr"+(k.active?"":' class="ui-state-disabled"')+"><td>"+epgd.channels.getHtml(k.channelid)+"</td><td>"+(k.action!="A"?'<div class="i-wait">'+d[k.action]+"</div>":e[k.state])+(k.info||"")+'</td><td data-sort="'+new String(k.day)+new String(10000+k.starttime).slice(1)+'">'+(k.day?epgd.utils.formatDate(k.day):"-")+"</td><td>"+new String(100+parseInt(k.starttime/100,10)).slice(1)+":"+new String(100+parseInt(k.starttime%100,10)).slice(1)+"</td><td>"+new String(100+parseInt(k.endtime/100,10)).slice(1)+":"+new String(100+parseInt(k.endtime%100,10)).slice(1)+"</td><td"+(k.eventid?' data-evId="'+k.eventid+'">'+(k.title||"")+"<br />"+(k.shorttext||""):">")+"</td><td>"+m.name+"<br />"+(k.directory?k.directory+"~":"")+(k.file||"")+"</td><td>"+(k.autotimerid?c.replace("$id$",k.autotimerid).replace("$title$",k.autotimername||k.expression||epgd.tr.pages.timer.searchTimerList):"")+(h.indexOf(k.state)==-1?i:"")+"</td></tr>")[0];l.tData=k;b.push(l)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.timerListBase.prototype.action=function(a,d,b){var c;switch(d){case"edit":case"doc-new":this.dialog.render(a.closest("tr")[0].tData);break;case"trash":this.del(this.getSelectedIds(a));break;case"flashlight":c=a.attr("data-id"),list=this;$(window).one("searchTimerList_updated",function(){list.$con.find("tbody>tr").each(function(){if(this.tData.id==c){epgd.pages.searchTimerList.dialog.render(this.tData);return false}})});epgd.$menu.menu("select",{target:"#menu_searchTimerList"});break;default:epgd.sortTable.prototype.action.call(this,a,d,b)}};epgd.timerListBase.prototype.editIcons='<span class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span><span class="iAsButton i-edit edit" title="'+epgd.tr.edit+'"></span>';epgd.timerListBase.prototype.getSelectedIds=function(a){var b=[];if(a[0].parentNode.nodeName=="TH"){$(this.trs).filter(".selected:visible").each(function(){b.push(this.tData.id)})}else{b.push(a.closest("tr")[0].tData.id)}return b};epgd.timerListBase.prototype.del=function(c,d,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)];c&&a.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(a.length>1?"<br />"+a.length+epgd.tr.entries:""),function(g){g&&b.saveArray(a,e||"delete",d)})};epgd.timerListBase.prototype.saveArray=function(c,g,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)],d={};d[g]=a;c&&a.length&&this.save(d,null,function(k){try{var h=",";$(k.responseJSON.result.failed).each(function(){h+=a[this]+","});if(h.length>1){$(b.trs).each(function(){if(h.indexOf(","+this.tData.id+",")>=0){this.style.backgroundColor="red"}})}}catch(i){}return false},e)};epgd.timerListBase.prototype.save=function(d,b,a,c){if(!d){return false}var e=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+(b||e.o.saveUrl),type:"post",data:JSON.stringify(d)},function(g){g=g.result;if(g.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(g.message,{isError:1})}epgd.utils.loader.close();e.$con&&e.$con.parent().length&&e.update();c&&c.call(e)},a)},true);return true};epgd.searchResultList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-searchtimer"},a),b)},epgd.timerListBase);epgd.searchResultList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'<table id="searchResultList" class="timerTable"><thead><tr><th style="min-width:120px">'+epgd.tr.channel+this.sortIcons+'</th><th data-defaultSort="1" colspan="2">'+a.startTime+this.sortIcons+"</th><th>"+a.endTime+"</th><th>"+epgd.tr.pages.eventDetail.title+this.sortIcons+"</th><th></th></tr></thead><tbody></tbody></table>"};epgd.searchResultList.prototype.update=function(b){if(!b){return false}var a=this;b.id&&delete b.id;b.name&&delete b.name;b.max=epgd.profile.maxListEntries;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+"data/search",type:"post",data:JSON.stringify(b)},function(e){var c=[],d;if(!e.events||!e.events.length){a.hideHead()}else{e.count>b.max&&epgd.utils.popup("Achtung! Es wurden "+e.count+" Ergebnisse gefunden. Angezeigt werden aber nur "+b.max+".<br /> Das Nachladen ist noch nicht implementiert! Der Wert kann in den Einstellungen angepasst werden");$.each(e.events,function(l,h){var k="",g="",i;if(h.dones){for(d in h.dones){i=h.dones[d];g+='<span class="iAsButton" title="'+epgd.tr.pages.timerList.doneStates[i.state]+" data-id="+i.id+'">'+i.state+"</span>";if(i.state=="R"){k=' class="ui-state-disabled"'}}}c.push($("<tr"+k+"><td>"+epgd.channels.getHtml(h.channelid)+'</td><td data-sort="'+h.starttime+'">'+epgd.utils.formatDate(h.starttime)+"</td><td>"+epgd.utils.formatTime(h.starttime)+"</td><td>"+epgd.utils.formatTime(h.starttime+h.duration)+'</td><td data-evId="'+h.id+'">'+h.title+"<br />"+(h.shorttext||"")+"</td><td>"+g+"</td></tr>").tooltip()[0])});a.trs=c;a.showHead()}epgd.utils.loader.close();a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100)})},true)};epgd.searchTimerTimerList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-timer",updateUrl:"data/timers?state=P,R"},a),b)},epgd.timerListBase);epgd.searchTimerTimerList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'<table class="timerTable"><thead><tr><th>'+epgd.tr.channel+this.sortIcons+'</th><th data-defaultSort="1" colspan="2">'+a.startTime+this.sortIcons+"</th><th>"+a.endTime+"</th><th>"+epgd.tr.pages.eventDetail.title+this.sortIcons+"</th><th>VDR"+this.sortIcons+"</th><th></th></tr></thead><tbody></tbody></table>"};epgd.searchTimerTimerList.prototype.update=function(b){if(!b){return false}var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl+"&autotimerid="+b.id,async:true,cache:false},function(d){var c=[],e='<span class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span>';if(!d.timers.length){a.hideHead()}else{$.each(d.timers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$("<tr"+(g.active?"":' class="ui-state-disabled"')+"><td>"+epgd.channels.getHtml(g.channelid)+'</td><td data-sort="'+new String(g.day)+new String(10000+g.starttime).slice(1)+'">'+(g.day?$.datepicker.formatDate(epgd.tr.dateTimePicker.dateFormat,epgd.utils.date(g.day)):"-")+"</td><td>"+new String(100+parseInt(g.starttime/100,10)).slice(1)+":"+new String(100+parseInt(g.starttime%100,10)).slice(1)+"</td><td>"+new String(100+parseInt(g.endtime/100,10)).slice(1)+":"+new String(100+parseInt(g.endtime%100,10)).slice(1)+"</td><td"+(g.eventid?' data-evId="'+g.eventid+'">'+g.title+"<br />"+(g.shorttext||""):">")+"</td><td>"+i.name+"<br />"+g.file+"</td><td>"+e+"</td></tr>")[0];h.tData=g;c.push(h)});a.trs=c;a.showHead()}a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100);epgd.utils.loader.close()})})};epgd.pages.timerList=new epgd.timerListBase({updateUrl:"data/timers?state=P,R",saveUrl:"data/save-timer",selectable:true,addNew:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.timersDone=new epgd.timerListBase({updateUrl:"data/timers?state=D,F,E&action=A",right:epgd.rights.umTimer});epgd.pages.timersDone.getTable=function(){return epgd.timerListBase.prototype.getTable.call(this).replace('data-defaultSort="1"','data-defaultSort="-1"')};epgd.pages.timerListDone=new epgd.timerListBase({updateUrl:"data/donetimers",saveUrl:"data/store-donetimers",selectable:true,right:epgd.rights.umTimer});epgd.pages.timerListDone.getTable=function(){return'<table id="timerListDone" class="timerTable"><thead><tr><th style="min-width:120px"><input type="text" class="filter" style="width:40px" />'+this.sortIcons+'</th><th data-defaultSort="-1" style="min-width:180px">'+epgd.tr.pages.timerList.recordTime+this.sortIcons+"</th><th>"+epgd.tr.pages.eventDetail.title+' <input type="text" class="filter" />'+this.sortIcons+'</th><th style="min-width:120px">'+epgd.tr.channel+this.sortIcons+'</th><th style="min-width:100px">'+this.sortIcons+'<span style="margin-top:3px" class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span><div class="selMarkBlock" style="width:auto"><b title="'+epgd.tr.markAll+'" class="selected" data-t="1"></b><b title="'+epgd.tr.markNone+'" data-t="0"></b><b title="'+epgd.tr.markToggle+'"><b class="selected"></b></b></div></th></tr></thead><tbody></tbody></table>'};epgd.pages.timerListDone.action=function(a,c,b){if(c=="detail"&&!a[0].eventDetail){a[0].eventDetail=new epgd.doneTimerDetail(a.parent()[0])}epgd.timerListBase.prototype.action.call(this,a,c,b)};epgd.pages.timerListDone.stateIcons={D:'<div class="i-trash">'+epgd.tr.pages.timerList.doneStates.D+"</div>",F:'<div class="i-warning">'+epgd.tr.pages.timerList.doneStates.F+"</div>",f:'<div class="i-warning">'+epgd.tr.pages.timerList.doneStates.f+"</div>",R:'<div class="i-ok">'+epgd.tr.pages.timerList.doneStates.R+"</div>",C:'<div class="i-buffer">'+epgd.tr.pages.timerList.doneStates.C+"</div>",Q:'<div class="i-clock">'+epgd.tr.pages.timerList.doneStates.Q+"</div>"};epgd.pages.timerListDone.update=function(){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(h){a.$con.find("tbody").empty();if(!h.donetimers.length){a.hideHead()}else{var b=[],g,e,d,c='<span class="iAsButton i-flashlight edit" title="'+epgd.tr.pages.timer.searchTimerList+" "+epgd.tr.edit+'" data-id="$id$">$title$</span>';for(e in h.donetimers){d=h.donetimers[e];g=$("<tr><td>"+(d.state&&a.stateIcons[d.state]||"")+'</td><td data-sort="'+d.starttime+'">'+epgd.utils.formatDateTime(d.starttime)+"<br />"+parseInt(d.duration/60,10)+" "+epgd.tr.minutes+'</td><td data-evId="'+d.id+'">'+(d.title||"")+"<br />"+(d.shorttext||"")+'</td><td data-sort="'+d.channelid+'">'+epgd.channels.getHtml(d.channelid)+'</td><td><span class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span>'+(d.autotimerid?c.replace("$id$",d.autotimerid).replace("$title$",d.autotimername||d.expression||epgd.tr.pages.timer.searchTimerList):"")+"</td></tr>")[0];g.tData=d;b.push(g)}a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.pages.timerJobList=new epgd.timerListBase({updateUrl:"data/timers?notaction=A",saveUrl:"data/delete-timerjobs",selectable:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.searchTimerList=new epgd.timerListBase({saveUrl:"data/save-searchtimer",right:epgd.rights.umSearchTimer},new epgd.searchTimerDialog());epgd.pages.searchTimerList.getTable=function(){var a=epgd.tr.pages.timerList;return'<table id="timerSearchList" class="timerTable"><thead><tr><th data-defaultSort="1">'+epgd.tr.pages.search.searchName+"/"+epgd.tr.pages.search.searchExpression+' <input type="text" class="filter" />'+this.sortIcons+"</th><th>hits"+this.sortIcons+'</th><th style="min-width:120px">VDR'+this.sortIcons+'</th><th><span class="iAsButton i-doc-new edit" title="'+a.newTimer+'"></span><span class="iAsButton i-refresh edit" title="'+epgd.tr.reload+'"></span><span class="iAsButton i-link-ext edit" title="'+a.searchTimerReload+'"></span></th></tr></thead><tbody></tbody></table>'};epgd.pages.searchTimerList.action=function(c,e,d){epgd.timerListBase.prototype.action.call(this,c,e,d);switch(e){case"link-ext":this.triggerUpdate();break;case"down-dir":if(!c[0].tList){var b={$td:c.parent().css("position","relative"),tdHeight:c.parent().outerHeight()+10,data:c.parent().parent()[0].tData,resize:function(){var g=this.list.$con.find(">table").addClass("sub");g.width(this.$td.parent().outerWidth());this.$td.height(this.tdHeight+g.outerHeight(true)+10)},toggle:function(g){this.list.$con.toggle(g);if(g){this.$td.css("height","100px");this.list.update(this.data)}else{this.$td.css("height","auto")}}},a={conSel:$('<div style="position:absolute;z-index:5;top:'+b.tdHeight+'px" />').appendTo(document.body)};c[0].tList=b.data.type=="S"?new epgd.searchResultList(a,b):new epgd.searchTimerTimerList(a,b);c[0].tList.render();b.$td.append(b.list.$con)}c[0].tList.dialog.toggle(true);c.removeClass("i-down-dir").addClass("i-right-dir");break;case"right-dir":c.removeClass("i-right-dir").addClass("i-down-dir");if(c[0].tList){c[0].tList.dialog.toggle(false)}break}};epgd.pages.searchTimerList.update=function(){var a=this;this.$con.find("tbody").empty();epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/searchtimers",async:false,cache:false},function(d){var b=[],e=a.editIcons,c={V:"i-tv",R:"i-record",S:"i-search"};if(!d.searchtimers.length){a.hideHead()}else{$.each(d.searchtimers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$("<tr"+(g.active?"":' class="ui-state-disabled"')+'><td><span class="iAsButton i-down-dir edit" title="'+epgd.tr.pages.timer.timerList+'"></span><div class="'+c[g.type]+'">'+(g.name||g.expression)+"</div></td><td"+(g.type=="S"?">--":' data-sort="'+new String("00000"+g.hits).slice(-5)+'">'+g.hits)+"</td><td>"+i.name+"</td><td>"+e+"</td></tr>")[0];h.tData=g;b.push(h)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("searchTimerList_updated",a)})})};epgd.pages.searchTimerList.triggerUpdate=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/updatesearchtimer"},function(b){if(b.result.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(b.message,{isError:1})}a.update()})};epgd.pages.search=new epgd.searchDialog();epgd.pages.messageList=new epgd.timerListBase({saveUrl:"data/markmessages",selectable:true});epgd.pages.messageList.getTable=function(){return'<table id="messageList" class="timerTable"><thead><tr><th style="width:70px">id'+this.sortIcons+'</th><th style="width:120px">Typ <input type="text" class="filter" style="width:18px" />'+this.sortIcons+'</th><th style="width:140px">Zeit'+this.sortIcons+'</th><th style="width:100px">Titel <input type="text" class="filter" style="width:50px" />'+this.sortIcons+'</th><th style="min-width:140px">infotext <input type="text" class="filter" />'+this.sortIcons+'</th><th style="min-width:190px"><div class="selMarkBlock" style="width:auto;float: right;"><b title="'+epgd.tr.markAll+'" class="selected" data-t="1"></b><b title="'+epgd.tr.markNone+'" data-t="0"></b><b title="'+epgd.tr.markToggle+'"><b class="selected"></b></b></div>Status <input type="text" class="filter" style="width:20px" /><br />'+this.sortIcons+'<span class="iAsButton i-refresh edit" title="'+epgd.tr.reload+'"></span><span style="margin-top:3px" class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span><span style="margin-top:3px" class="iAsButton i-check edit" title="'+epgd.tr.pages.timerList.messageStates.R+'"></span><span style="margin-top:3px" class="iAsButton i-check-empty edit" title="'+epgd.tr.pages.timerList.messageStates.N+'"></span></th></tr></thead><tbody></tbody></table>'};epgd.pages.messageList.update=function(b){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/messages",async:false,cache:false},function(l){a.$con.find("tbody").empty();if(!l.messages.length){a.hideHead()}else{var c=[],k,h,g,e={N:'<span class="iAsButton i-check-empty edit">'+epgd.tr.pages.timerList.messageStates.N+"</span>",R:'<span class="iAsButton i-check edit">'+epgd.tr.pages.timerList.messageStates.R+"</span>"},d={E:'<div class="i-error">'+epgd.tr.pages.timerList.timerStates.E+"</div>",F:'<div class="i-flash-outline">'+epgd.tr.pages.timerList.timerStates.F+"</div>",I:'<div class="i-info">'+epgd.tr.pages.timerList.messageTypes.I+"</div>",W:'<div class="i-warning">'+epgd.tr.pages.timerList.messageTypes.W+"</div>"};for(h in l.messages){g=l.messages[h];k=$('<tr><td data-sort="'+new String("0000000"+g.id).slice(-7)+'">'+g.id+"</td><td>"+(d[g.type]||"")+'</td><td data-sort="'+g.updsp+'">'+epgd.utils.formatDateTime(g.updsp)+"</td><td>"+g.title+"</td><td>"+g.text+'</td><td data-sort="'+g.state+g.updsp+'"><span class="iAsButton i-trash edit" title="'+epgd.tr.del+'"></span>'+(e[g.state]||"")+"</td></tr>")[0];k.tData=g;c.push(k)}a.trs=c;a.$con.find(">table>tbody").append(c.sort(function(m,i){return m.tData.state==i.tData.state?m.tData.state.updsp>i.tData.state.updsp?-1:1:m.tData.state>i.tData.state}).slice());a.showHead()}epgd.utils.loader.close();$(window).trigger("messagelist_updated",a)})},true)};epgd.pages.messageList.action=function(b,g,e){var c=this.getSelectedIds(b),d=null,a;if(c){switch(g){case"check":d=b[0].parentNode.nodeName=="TH"?"R":"N";break;case"check-empty":d=b[0].parentNode.nodeName=="TH"?"N":"R";break;case"trash":d="D";break}if(d){for(a in c){c[a]={id:c[a],state:d}}d=="D"?this.del(c,null,"messages"):this.saveArray(c,"messages");return true}}return epgd.timerListBase.prototype.action.call(this,b,g,e)};epgd.vdr=function(a,b){this.uuid=a;$.extend(this,b)};epgd.vdr.prototype.switchChannel=function(a){epgd.ajax({url:epgd.login.url+"data/channelswitch?uuid="+this.uuid+"&channel="+a,cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.vdr.prototype.wol=function(){epgd.ajax({url:epgd.login.url+"data/wakeupvdr?uuid="+this.uuid,cache:false},function(a){epgd.utils.popup(a.result.message,{title:"VDR",autoClose:5000})})};epgd.vdrs={list:null,current:null,load:function(){if(!this.list){this.list={};epgd.ajax({url:epgd.login.url+"data/vdrs",async:false},function(b){var a;for(a in b.vdrs){epgd.vdrs.list[a]=new epgd.vdr(a,b.vdrs[a])}if(!epgd.vdrs.current){if(epgd.profile.defaultVDRuuid){epgd.vdrs.current=epgd.vdrs.list[epgd.profile.defaultVDRuuid];if(!epgd.vdrs.current){epgd.utils.log("the default VDR ("+epgd.profile.defaultVDRuuid+" is invalid! Please change this in Web Interface/options)")}}if(!epgd.vdrs.current){for(a in epgd.vdrs.list){epgd.vdrs.current=epgd.vdrs.list[a];break}}if(!epgd.vdrs.current){epgd.utils.log("no VDR found",2);epgd.vdrs.current=new epgd.vdr("000-missing-vdr-000",{name:"no VDR found"})}}$(window).trigger("vdrs_load")})}},get:function(a){return this.list[(a||this.current)]||{}}};epgd.pages.vdrs={render:function(){epgd.$con.html('<div><button class="iAsButton" onclick="epgd.vdrs.current.wol()">WOL</button>')}}; \ No newline at end of file
diff --git a/http/www/favicon.ico b/http/www/favicon.ico
new file mode 100644
index 0000000..33886c4
--- /dev/null
+++ b/http/www/favicon.ico
Binary files differ
diff --git a/http/www/font/LICENSE.txt b/http/www/font/LICENSE.txt
new file mode 100644
index 0000000..6a22557
--- /dev/null
+++ b/http/www/font/LICENSE.txt
@@ -0,0 +1,75 @@
+Font license info
+
+
+## Fontelico
+
+ Copyright (C) 2012 by Fontello project
+
+ Author: Crowdsourced, for Fontello project
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://fontello.com
+
+
+## Font Awesome
+
+ Copyright (C) 2016 by Dave Gandy
+
+ Author: Dave Gandy
+ License: SIL ()
+ Homepage: http://fortawesome.github.com/Font-Awesome/
+
+
+## Entypo
+
+ Copyright (C) 2012 by Daniel Bruce
+
+ Author: Daniel Bruce
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://www.entypo.com
+
+
+## Typicons
+
+ (c) Stephen Hutchings 2012
+
+ Author: Stephen Hutchings
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://typicons.com/
+
+
+## Modern Pictograms
+
+ Copyright (c) 2012 by John Caserta. All rights reserved.
+
+ Author: John Caserta
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://thedesignoffice.org/project/modern-pictograms/
+
+
+## Zocial
+
+ Copyright (C) 2012 by Sam Collins
+
+ Author: Sam Collins
+ License: MIT (http://opensource.org/licenses/mit-license.php)
+ Homepage: http://zocial.smcllns.com/
+
+
+## Elusive
+
+ Copyright (C) 2013 by Aristeides Stathopoulos
+
+ Author: Aristeides Stathopoulos
+ License: SIL (http://scripts.sil.org/OFL)
+ Homepage: http://aristeides.com/
+
+
+## Linecons
+
+ Copyright (C) 2013 by Designmodo
+
+ Author: Designmodo for Smashing Magazine
+ License: CC BY ()
+ Homepage: http://designmodo.com/linecons-free/
+
+
diff --git a/http/www/font/epgd.eot b/http/www/font/epgd.eot
new file mode 100644
index 0000000..afecad6
--- /dev/null
+++ b/http/www/font/epgd.eot
Binary files differ
diff --git a/http/www/font/epgd.svg b/http/www/font/epgd.svg
new file mode 100644
index 0000000..e59f432
--- /dev/null
+++ b/http/www/font/epgd.svg
@@ -0,0 +1,102 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
+<defs>
+<font id="epgd" horiz-adv-x="1000" >
+<font-face font-family="epgd" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
+<missing-glyph horiz-adv-x="1000" />
+<glyph glyph-name="progress" unicode="&#xe800;" d="M855 9c-189-190-520-172-705 13-190 190-200 494-28 695 11 13 21 26 35 34 36 23 85 18 117-13 30-31 35-76 16-112-5-9-9-15-16-22-140-151-145-379-8-516 153-153 407-121 542 34 106 122 142 297 77 451-83 198-305 291-510 222l0 1c236 82 492-24 588-252 71-167 37-355-72-493-11-15-23-29-36-42z" horiz-adv-x="1000" />
+
+<glyph glyph-name="record" unicode="&#xe801;" d="M1000 654v-608q0-23-22-32-7-3-14-3-15 0-25 10l-225 225v-92q0-67-47-114t-113-47h-393q-67 0-114 47t-47 114v392q0 67 47 114t114 47h393q66 0 113-47t47-114v-92l225 225q10 10 25 10 7 0 14-2 22-10 22-33z" horiz-adv-x="1000" />
+
+<glyph glyph-name="cancel" unicode="&#xe802;" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="help" unicode="&#xe803;" d="M393 149v-134q0-9-7-15t-15-7h-134q-9 0-16 7t-7 15v134q0 9 7 16t16 6h134q9 0 15-6t7-16z m176 335q0-30-8-56t-20-43-31-33-32-25-34-19q-23-13-38-37t-15-37q0-10-7-18t-16-9h-134q-8 0-14 11t-6 20v26q0 46 37 87t79 60q33 16 47 32t14 42q0 24-26 41t-60 18q-36 0-60-16-20-14-60-64-7-9-17-9-7 0-14 4l-91 70q-8 6-9 14t3 16q89 148 259 148 45 0 90-17t81-46 59-72 23-88z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="help-circled" unicode="&#xe804;" d="M500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-13 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-15-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="info-circled" unicode="&#xe805;" d="M571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="info" unicode="&#xe806;" d="M357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="link-ext" unicode="&#xe807;" d="M786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-25t-25-11-25 11l-98 98-364-364q-5-6-13-6t-12 6l-64 64q-6 5-6 12t6 13l364 364-98 98q-11 11-11 25t11 25 25 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
+
+<glyph glyph-name="trash" unicode="&#xe808;" d="M286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="folder-closed" unicode="&#xe809;" d="M857 118v393q0 22-15 38t-38 15h-393q-23 0-38 16t-16 38v36q0 22-15 38t-38 15h-179q-22 0-38-15t-16-38v-536q0-22 16-38t38-16h679q22 0 38 16t15 38z m72 393v-393q0-51-37-88t-88-37h-679q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h375q51 0 88-37t37-88z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="folder-opened" unicode="&#xe80a;" d="M994 331q0 19-30 19h-607q-22 0-48-12t-39-29l-164-203q-11-13-11-22 0-20 30-20h607q23 0 48 13t40 29l164 203q10 12 10 22z m-637 90h429v90q0 22-16 38t-38 15h-321q-23 0-38 16t-16 38v36q0 22-15 38t-38 15h-179q-22 0-38-15t-16-38v-476l143 175q25 30 65 49t78 19z m708-90q0-35-25-67l-165-203q-24-30-65-49t-78-19h-607q-51 0-88 37t-37 88v536q0 51 37 88t88 37h179q51 0 88-37t37-88v-18h303q52 0 88-37t37-88v-90h107q30 0 56-13t37-40q8-17 8-37z" horiz-adv-x="1071.4" />
+
+<glyph glyph-name="menu" unicode="&#xe80b;" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="login" unicode="&#xe80c;" d="M661 350q0-14-11-25l-303-304q-11-10-26-10t-25 10-10 25v161h-250q-15 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 10 25t25 10 26-10l303-304q11-10 11-25z m196 196v-392q0-67-47-114t-114-47h-178q-7 0-13 5t-5 13q0 2-1 11t0 15 2 13 5 11 12 3h178q37 0 64 27t26 63v392q0 37-26 64t-64 26h-174t-6 0-6 2-5 3-4 5-1 8q0 2-1 11t0 15 2 13 5 11 12 3h178q67 0 114-47t47-114z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="logout" unicode="&#xe80d;" d="M357 46q0-2 1-11t0-14-2-14-5-11-12-3h-178q-67 0-114 47t-47 114v392q0 67 47 114t114 47h178q8 0 13-5t5-13q0-2 1-11t0-15-2-13-5-11-12-3h-178q-37 0-63-26t-27-64v-392q0-37 27-63t63-27h174t6 0 7-2 4-3 4-5 1-8z m518 304q0-14-11-25l-303-304q-11-10-25-10t-25 10-11 25v161h-250q-14 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 11 25t25 10 25-10l303-304q11-10 11-25z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="down-dir" unicode="&#xe80e;" d="M571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="up-dir" unicode="&#xe80f;" d="M571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25 11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="left-dir" unicode="&#xe810;" d="M357 600v-500q0-14-10-25t-26-11-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11 10-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="right-dir" unicode="&#xe811;" d="M321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11-11 25v500q0 15 11 25t25 11 25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
+
+<glyph glyph-name="refresh" unicode="&#xe812;" d="M843 261q0-3 0-4-36-150-150-243t-267-93q-81 0-157 31t-136 88l-72-72q-11-11-25-11t-25 11-11 25v250q0 14 11 25t25 11h250q14 0 25-11t10-25-10-25l-77-77q40-36 90-57t105-20q74 0 139 37t104 99q6 10 30 66 4 13 16 13h107q8 0 13-6t5-12z m14 446v-250q0-14-10-25t-26-11h-250q-14 0-25 11t-10 25 10 25l77 77q-82 77-194 77-75 0-140-37t-104-99q-6-10-29-66-5-13-17-13h-111q-7 0-13 6t-5 12v4q36 150 151 243t268 93q81 0 158-31t137-88l72 72q11 11 25 11t26-11 10-25z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="check" unicode="&#xe813;" d="M786 331v-177q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q35 0 65-14 9-4 10-13 2-10-5-16l-27-28q-6-5-13-5-1 0-5 1-13 3-25 3h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v141q0 8 5 13l36 35q6 6 13 6 3 0 7-2 11-4 11-16z m129 273l-455-454q-13-14-31-14t-32 14l-240 240q-14 13-14 31t14 32l61 62q14 13 32 13t32-13l147-147 361 361q13 13 31 13t32-13l62-61q13-14 13-32t-13-32z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="check-empty" unicode="&#xe814;" d="M625 707h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v464q0 37-26 63t-63 26z m161-89v-464q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q66 0 114-48t47-113z" horiz-adv-x="785.7" />
+
+<glyph glyph-name="save" unicode="&#xe815;" d="M214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-7 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z" horiz-adv-x="857.1" />
+
+<glyph glyph-name="sort-down" unicode="&#xe816;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="sort-up" unicode="&#xe817;" d="M571 457q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25 11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.4" />
+
+<glyph glyph-name="sort-name-up" unicode="&#xe818;" d="M665 622h98l-40 122-6 26q-2 9-2 11h-2l-1-11q0 0-2-10t-5-16z m-254-576q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m466-66v-130h-326v50l206 295q7 11 12 16l6 5v1q-1 0-3 0t-5 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-296q-4-4-12-14l-6-7v-1l8 1q5 2 16 2h139v66h67z m50 501v-60h-161v60h42l-26 80h-136l-26-80h42v-60h-160v60h39l128 369h91l128-369h39z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="sort-name-down" unicode="&#xe819;" d="M665 51h98l-40 122-6 26q-2 9-2 11h-2l-1-11q0-1-2-10t-5-16z m-254-5q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m516-137v-59h-161v59h42l-26 80h-136l-26-80h42v-59h-160v59h39l128 370h91l128-370h39z m-50 643v-131h-326v51l206 295q7 10 12 15l6 5v2q-1 0-3-1t-5 0q-6-2-16-2h-130v-64h-67v128h317v-50l-206-295q-4-5-12-15l-6-5v-2l8 2q5 0 16 0h139v67h67z" horiz-adv-x="928.6" />
+
+<glyph glyph-name="flashlight" unicode="&#xe81a;" d="M807 706q62-62 85-130t-5-92l-134-134q-16-16-62-26t-96-4l-408-408q-18-18-57-6t-75 50q-36 36-49 74t5 56l408 408q-6 50 4 96t26 62l136 136q24 28 92 4t130-86z m-448-408q32-32 80 14 46 46 14 82-14 14-38 10t-44-24-23-43 11-39z m336 298q30-30 68-50t62-25 28-1q2 4-4 27t-26 60-50 67-66 50-59 26-27 2 1-28 25-62 48-66z" horiz-adv-x="902" />
+
+<glyph glyph-name="wait" unicode="&#xe81b;" d="M560 622q0-44-48-96t-97-99-49-77 49-76 97-97 48-97l0-118q0-34-86-73t-194-39-194 39-86 73l0 118q0 46 48 97t97 97 49 76-49 77-97 99-48 96l0 118q0 32 87 71t193 39 193-39 87-71l0-118z m-482 112l-18-14q-4-8 4-14 92-52 216-52 132 0 220 50 14 10-16 30-96 54-202 54-120 0-204-54z m228-384q0 18 4 33t18 33 20 25 31 31 29 28q92 92 92 122l2 50q-100-54-222-54t-222 54l4-50q0-32 90-122 6-6 22-21t23-22l19-19t17-21 11-20 9-23 3-24q0-10-1-19t-6-18-8-16-11-17l-12-15t-15-16-16-15-18-16-17-16q-90-90-90-122l0-66q8 4 66 23t92 43 34 58q0 30 26 30t26-30q0-34 33-58t94-43 67-23l0 66q0 30-92 122-4 4-21 20t-22 21-18 19-18 22-12 20-9 23-2 23z" horiz-adv-x="560" />
+
+<glyph glyph-name="play" unicode="&#xe81c;" d="M486 376q14-10 14-26 0-14-14-24l-428-266q-24-16-41-6t-17 40l0 514q0 30 17 40t41-6z" horiz-adv-x="500" />
+
+<glyph glyph-name="stop" unicode="&#xe81d;" d="M526 650q74 0 74-64l0-470q0-66-74-66l-450 0q-76 0-76 66l0 470q0 36 18 50t58 14l450 0z" horiz-adv-x="600" />
+
+<glyph glyph-name="pause" unicode="&#xe81e;" d="M440 700q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z m-350 0q90 0 90-64l0-570q0-66-90-66t-90 66l0 570q0 64 90 64z" horiz-adv-x="530" />
+
+<glyph glyph-name="to-end" unicode="&#xe81f;" d="M412 374q14-10 14-24 0-12-14-22l-362-228q-22-14-36-5t-14 35l0 442q0 26 14 35t36-5z m114 268q74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466q0 58 76 58z" horiz-adv-x="600" />
+
+<glyph glyph-name="to-start" unicode="&#xe820;" d="M174 350q0 14 14 24l364 228q20 14 34 5t14-35l0-442q0-26-14-35t-34 5l-364 228q-14 10-14 22z m-174 234q0 58 76 58 74 0 74-58l0-466q0-58-74-58-76 0-76 58l0 466z" horiz-adv-x="600" />
+
+<glyph glyph-name="forward" unicode="&#xe821;" d="M866 374q14-10 14-24t-14-22l-372-248q-22-14-37-6t-15 36l0 482q0 28 15 36t37-6z m-454 0q14-10 14-24t-14-22l-360-248q-20-14-36-6t-16 36l0 482q0 28 16 36t36-6z" horiz-adv-x="880" />
+
+<glyph glyph-name="rewind" unicode="&#xe822;" d="M0 350q0 14 14 24l374 248q20 14 36 6t16-36l0-482q0-28-16-36t-36 6l-374 248q-14 8-14 22z m454 0q0 14 14 24l360 248q20 14 36 6t16-36l0-482q0-28-16-36t-36 6l-360 248q-14 8-14 22z" horiz-adv-x="880" />
+
+<glyph glyph-name="ok" unicode="&#xe823;" d="M365-41q-66 0-111 45l-208 209q-46 46-46 110 0 65 46 111 44 44 110 44t110-44l63-62 160 287q20 38 57 60t79 22q88 0 134-76t2-157l-260-469q-43-80-136-80z m-209 417q-21 0-37-16t-15-37q0-20 16-36l208-209q18-19 44-15t38 26l260 469q11 23 4 43t-24 28q-19 10-39 4t-31-24l-227-408-160 160q-15 15-37 15z" horiz-adv-x="783" />
+
+<glyph glyph-name="warning" unicode="&#xe824;" d="M514 701q-49 0-81-55l-308-513q-32-55-11-95t87-40l625 0q65 0 87 40t-12 95l-307 513q-33 55-80 55z m0 105q106 0 169-107l308-513q63-105 12-199-52-93-177-93l-625 0q-123 0-177 93-53 92 11 199l309 513q62 107 170 107z m-69-652q0 69 69 69 67 0 67-69 0-67-67-67-69 0-69 67z m146 313q0-14-6-29l-71-179q-44 108-73 179-6 15-6 29 0 32 23 55t56 24 55-24 22-55z" horiz-adv-x="1026" />
+
+<glyph glyph-name="clock" unicode="&#xe825;" d="M406 757c224 0 407-182 407-407 0-223-183-406-407-406-225 0-406 183-406 406 0 225 181 407 406 407z m0-723c175 0 317 143 317 318s-142 316-317 316-317-141-317-316 142-318 317-318z m120 268l-127 0c-14 0-25 5-33 15l-143 156c-39 41 25 101 65 61l130-142 108 0c62 0 55-90 0-90z m-145 287c0 13 12 24 24 24s24-11 24-24-11-24-24-24-24 12-24 24z m167-65c0 13 11 24 23 24s24-11 24-24-11-24-24-24-23 12-23 24z m73-171c0 12 12 24 24 24s24-12 24-24-11-24-24-24-24 11-24 24z m-66-168c0 13 11 24 24 24s24-11 24-24-12-23-24-23-24 11-24 23z m-175-72c0 12 11 24 24 24s24-12 24-24-12-24-24-24-24 11-24 24z m-162 65c0 12 11 24 23 24s24-12 24-24-11-24-24-24-23 11-23 24z m-75 175c0 12 11 24 23 24s24-12 24-24-11-24-24-24-23 11-23 24z" horiz-adv-x="813" />
+
+<glyph glyph-name="buffer" unicode="&#xe826;" d="M0 88q11 15 32 26t49 20 40 15q19 0 34-4t33-15 25-13q47-21 260-119 19-4 36 0t39 18 24 14q20 9 77 35t87 39q4 2 42 21t60 24q13 2 28-1t23-7 23-13 18-11 16-6 18-8 11-11q3-4 4-14-10-13-31-24t-51-22-40-16q-43-20-128-62t-129-61q-7-3-21-12t-23-13-26-11-27-7-30 2l-264 123q-6 3-32 14t-51 22-54 24-46 24-22 16q-4 4-4 13z m0 268q11 15 32 25t50 20 41 15q19 0 34-4t35-15 25-14q42-19 127-58t127-59q19-5 37 0t39 17 25 14q68 32 160 72 11 5 32 17t38 19 36 11q16 3 32-1t37-17 23-13q5-3 16-6t18-8 11-11q3-5 4-14-10-14-31-25t-53-23-41-16q-48-23-135-65t-123-59q-7-3-26-14t-29-15-32-10-36 0q-214 101-260 122-6 3-44 19t-69 30-62 30-34 22q-4 4-4 14z m0 267q10 15 32 27t52 22 41 16l348 162q30 0 54-7t56-26 40-22q39-18 117-54t117-55q4-2 37-15t54-24 27-20q3-4 4-13-9-13-26-22t-43-19-35-14q-47-22-140-66t-139-67q-6-3-20-11t-23-12-25-11-27-6-28 1q-245 114-256 119-4 2-63 28t-102 46-48 30q-4 4-4 13z" horiz-adv-x="979" />
+
+<glyph glyph-name="doc-new" unicode="&#xe827;" d="M0-150l0 818 188 182 519 0 0-348-86 0 0 260-369 0 0-156-166 0 0-668 418 0 0-88-504 0z m373 207l0 162 209 0 0 207 160 0 0-207 207 0 0-162-207 0 0-207-160 0 0 207-209 0z" horiz-adv-x="949" />
+
+<glyph glyph-name="search" unicode="&#xe828;" d="M0-41q0 47 33 80l260 260q-43 82-43 176 0 154 109 265t266 110 266-110 109-266-109-265-266-109q-94 0-176 43l-260-260q-33-33-80-33-45 0-77 32t-32 77z m55 1q0-22 16-39t39-16 40 17l252 252q-45 33-78 78l-252-252q-17-17-17-40z m258 515q0-129 91-221t221-91 221 91 91 221-91 221-221 91-221-91-91-221z m93 0q0 90 65 154t154 65q16 0 16-16t-16-16q-78 0-133-54t-54-133q0-16-16-16t-16 16z" horiz-adv-x="1000" />
+
+<glyph glyph-name="edit" unicode="&#xe829;" d="M0-41q0 4 1 8t1 8 1 8 1 6l0 2 74 267q10 31 31 53l325 324 0 2 2 2 150 152q60 59 146 59 106 0 186-80 74-74 81-171t-58-161l-476-481q-24-23-55-31l-263-70-3-1q-3-1-7-2t-9-1-10-1-9-1q-45 0-77 32t-32 77z m63 0q0-19 13-33t33-14q6 0 22 4l115 32q4 58-43 105-45 45-105 43l-32-119q-3-14-3-18z m44 168q67-2 118-52t52-120l116 30 11 6q41 47 34 115t-61 121q-51 49-115 59t-112-24q-7-10-11-21z m131 225q45-2 90-20l295 295q-88 22-144-33z m119-35q38-20 65-45 21-22 41-55l297 299q-16 31-39 55-30 29-67 45z m122-129q17-41 21-82l0-24 242 245 0 2q61 60 31 156z m101 508q106 0 186-80 70-73 78-166l0-22 52 55q45 45 41 111-5 74-62 131-63 62-143 62-60 0-101-41z" horiz-adv-x="1000" />
+
+<glyph glyph-name="tv" unicode="&#xe82a;" d="M0 100l0 625q0 39 27 66t67 28l812 0q39 0 67-28t27-66l0-625q0-39-27-66t-67-28l-312 0 0-37 195-25q23-6 23-32 0-13-8-22t-23-9l-562 0q-14 0-23 9t-8 22q0 26 23 32l195 25 0 37-312 0q-39 0-67 28t-27 66z m63 0q0-14 8-22t23-9l812 0q14 0 23 9t8 22l0 625q0 14-8 22t-23 9l-812 0q-14 0-23-9t-8-22l0-625z m62 125l0 437q0 14 9 23t22 9l688 0q13 0 22-9t9-23l0-437q0-14-9-22t-22-9l-688 0q-13 0-22 9t-9 22z m31 0l688 0 0 437-688 0 0-437z" horiz-adv-x="1000" />
+
+<glyph glyph-name="thumb-rate-up" unicode="&#xe82b;" d="M1204-51c-5-81-14-128-31-164-26-57-103-145-151-173-30-17-103-35-148-35-43-1-54 4-75 36-26 38-56 64-100 85-58 29-72 47-72 99-1 42-12 63-51 92-52 38-79 72-87 110-7 49 33 101 17 149-30 26-56 45-81 76-33 64-10 159 49 196 34 17 87 30 148 35 62 6 88 15 144 49 70 38 111 60 205 61l6 124c-81 78-94 139-66 245 28 82 22 145 107 185 43 18 76 21 112 11 59-17 99-47 120-90 39-81 45-255 14-406-19-63-9-122 20-180 40-101 22-123 57-152-94-148-123-175-137-353z m35 507c-31 57-27 125-11 186 24 124 39 286-19 401-24 34-79 62-125 62-108-3-110-84-136-166-19-43-21-97-1-140 39-75 118-109 179-160-37-6-72 11-106 23l4-110c115-53 124-157 81-264 39-29 74-83 74-161 21 60 71 108 92 168 14 60-4 110-32 161z m-267-481c-42-11-83-15-74-7 2 2 31 16 63 30 154 48 237 242 46 280-92 1-198-95-285-42 54-11 101 12 149 35 60 30 90 38 143 39 71 4 70 82 56 136-76 135-220 67-323 17-57-29-85-37-166-47-94-6-132-45-134-143-2-62 97-72 98-126-2-43-14-85-18-128 0-40 24-70 80-101 43-23 48-32 52-93 2-25 5-48 7-52 69-48 110-60 165-133 84-31 263 27 245 141-76-7-144-12-201 32 24 6 48 5 71 4 203-53 272 243 26 158z" horiz-adv-x="1727" />
+
+<glyph glyph-name="flash-outline" unicode="&#xe82c;" d="M495 767z m0 0l-391-369 261-151-130-313 390 370-260 150z m0 105q43 0 73-31t31-74q0-22-10-44l-93-224 182-105q43-25 50-77t-32-89l-390-370q-31-29-72-29-56 0-86 47t-9 98l95 228-181 105q-44 25-52 76t32 90l390 370q31 29 72 29z" horiz-adv-x="729" />
+
+<glyph glyph-name="error" unicode="&#xe82d;" d="M0 350q0 207 147 354t353 146 354-146 146-354-146-354-354-146-353 146-147 354z m137 0q0-150 106-257t257-106 257 106 106 257-106 257-257 106-257-106-106-257z m97-98l0 196 532 0 0-196-532 0z" horiz-adv-x="1000" />
+</font>
+</defs>
+</svg> \ No newline at end of file
diff --git a/http/www/font/epgd.ttf b/http/www/font/epgd.ttf
new file mode 100644
index 0000000..afcefa7
--- /dev/null
+++ b/http/www/font/epgd.ttf
Binary files differ
diff --git a/http/www/font/epgd.woff b/http/www/font/epgd.woff
new file mode 100644
index 0000000..bab45aa
--- /dev/null
+++ b/http/www/font/epgd.woff
Binary files differ
diff --git a/http/www/font/epgd.woff2 b/http/www/font/epgd.woff2
new file mode 100644
index 0000000..d3394b0
--- /dev/null
+++ b/http/www/font/epgd.woff2
Binary files differ
diff --git a/http/www/images/169.png b/http/www/images/169.png
new file mode 100644
index 0000000..6aace26
--- /dev/null
+++ b/http/www/images/169.png
Binary files differ
diff --git a/http/www/images/2kanal.png b/http/www/images/2kanal.png
new file mode 100644
index 0000000..72ff5c2
--- /dev/null
+++ b/http/www/images/2kanal.png
Binary files differ
diff --git a/http/www/images/43.png b/http/www/images/43.png
new file mode 100644
index 0000000..bfb5be5
--- /dev/null
+++ b/http/www/images/43.png
Binary files differ
diff --git a/http/www/images/TagesTipp_32.png b/http/www/images/TagesTipp_32.png
new file mode 100644
index 0000000..78d6fba
--- /dev/null
+++ b/http/www/images/TagesTipp_32.png
Binary files differ
diff --git a/http/www/images/Tipp_32.png b/http/www/images/Tipp_32.png
new file mode 100644
index 0000000..4e20246
--- /dev/null
+++ b/http/www/images/Tipp_32.png
Binary files differ
diff --git a/http/www/images/TopTipp_32.png b/http/www/images/TopTipp_32.png
new file mode 100644
index 0000000..bef63f4
--- /dev/null
+++ b/http/www/images/TopTipp_32.png
Binary files differ
diff --git a/http/www/images/animated-overlay.gif b/http/www/images/animated-overlay.gif
new file mode 100644
index 0000000..d441f75
--- /dev/null
+++ b/http/www/images/animated-overlay.gif
Binary files differ
diff --git a/http/www/images/audio_description.png b/http/www/images/audio_description.png
new file mode 100644
index 0000000..37e2019
--- /dev/null
+++ b/http/www/images/audio_description.png
Binary files differ
diff --git a/http/www/images/dd.png b/http/www/images/dd.png
new file mode 100644
index 0000000..ecbb2d9
--- /dev/null
+++ b/http/www/images/dd.png
Binary files differ
diff --git a/http/www/images/epg_icons_24x24_orange.png b/http/www/images/epg_icons_24x24_orange.png
new file mode 100644
index 0000000..a74293e
--- /dev/null
+++ b/http/www/images/epg_icons_24x24_orange.png
Binary files differ
diff --git a/http/www/images/epgd-4x.png b/http/www/images/epgd-4x.png
new file mode 100644
index 0000000..0b5ffce
--- /dev/null
+++ b/http/www/images/epgd-4x.png
Binary files differ
diff --git a/http/www/images/hd.png b/http/www/images/hd.png
new file mode 100644
index 0000000..20c6281
--- /dev/null
+++ b/http/www/images/hd.png
Binary files differ
diff --git a/http/www/images/loader.png b/http/www/images/loader.png
new file mode 100644
index 0000000..82f3524
--- /dev/null
+++ b/http/www/images/loader.png
Binary files differ
diff --git a/http/www/images/stereo.png b/http/www/images/stereo.png
new file mode 100644
index 0000000..17d0bae
--- /dev/null
+++ b/http/www/images/stereo.png
Binary files differ
diff --git a/http/www/images/sw.png b/http/www/images/sw.png
new file mode 100644
index 0000000..70f186d
--- /dev/null
+++ b/http/www/images/sw.png
Binary files differ
diff --git a/http/www/images/thumb-rate1.svg b/http/www/images/thumb-rate1.svg
new file mode 100644
index 0000000..b7b917c
--- /dev/null
+++ b/http/www/images/thumb-rate1.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="220" height="380" viewBox="82 -80 220 380" xmlns="http://www.w3.org/2000/svg" xmlns:bx="http://www.boxy-svg.com/bx">
+ <path d="M 25.137 101.931 C 21.461 183.777 84.814 174.653 134.739 183.754 C 144.762 193.668 157.812 205.808 177.089 207.086 C 198.243 203.103 213.639 200.116 240.299 191.33 C 336.725 205.51 361.442 190.36 354.739 148.01 C 348.489 133.3 297.209 105.99 266.059 138.8 L 233.229 139.3 C 232.022 118.7 228.594 105.22 210.674 72.39 C 208.224 46.19 200.024 15.69 177.664 14.54 C 162.444 13.5 155.214 24.11 146.634 33.05 C 133.194 33.36 120.154 33.47 106.954 32.21 C 92.645 37.101 84.685 62.821 59.985 63.031 C 47.145 71.107 36.735 88.891 25.135 101.921 Z" style="fill: rgb(237, 231, 204); fill-rule: evenodd;" transform="matrix(0, 1, -1, 0, 301.744508, -81.158487)" bx:origin="0.5 0.5"/>
+ <path d="M -13.698 99.966 C -2.754 112.476 8.189 108.476 19.132 98.199 C 31.715 116.847 47.742 126.267 63.832 103.502 C 92.572 112.544 109.906 101.329 123.936 82.289 C 148.496 87.291 164.276 77.254 174.696 58.046 C 192.916 84.538 185.016 106.584 171.926 127.746 C 177.006 140.729 185.916 143.59 192.636 146.434 C 224.576 137.434 260.856 162.586 309.816 119.16 C 314.666 147.763 295.226 154.105 276.486 161.08 C 245.246 165.572 214.866 161.403 184.566 156.535 L 131.526 172.185 L 76.976 143.395 C 35.906 143.235 -11.474 138.025 -13.684 99.955 Z" style="opacity: 0.64; fill: rgb(177, 142, 108); fill-rule: evenodd;" transform="matrix(0, 1, -1, 0, 265.599493, -35.368505)" bx:origin="0.5 0.5"/>
+ <path d="M 100.545 182.18 C 82.711 181.02 72.46 179.077 64.405 175.33 C 51.985 169.55 32.649 152.58 26.548 142.104 C 22.718 135.524 18.832 119.474 18.674 109.584 C 18.514 100.004 19.614 97.734 26.714 92.924 C 35.114 87.224 40.694 80.704 45.414 71.074 C 51.754 58.164 55.754 55.234 67.174 55.134 C 76.384 55.054 80.944 52.504 87.344 43.844 C 95.674 32.594 103.324 26.574 111.584 24.794 C 122.454 23.334 133.784 32.134 144.444 28.474 C 150.094 21.914 154.214 16.194 161.024 10.674 C 175.254 3.454 195.964 8.584 204.264 21.414 C 207.944 28.964 210.714 40.724 211.954 54.044 C 213.224 67.667 215.204 73.504 222.714 85.727 C 231.004 101.067 235.904 110.197 236.094 130.927 L 263.36 132.161 C 280.444 114.371 293.95 111.468 317.376 117.661 C 335.332 123.771 349.146 122.451 357.972 141.108 C 361.945 150.658 362.672 157.978 360.412 165.758 C 356.585 178.908 350.124 187.518 340.582 192.168 C 322.772 200.848 284.445 202.178 251.167 195.258 C 237.303 191.128 224.507 193.418 211.757 199.602 C 189.541 208.517 184.642 204.607 178.149 212.216 C 145.629 191.489 139.651 185.296 100.515 182.156 Z M 212.071 189.83 C 224.717 183.06 239.578 183.956 253.031 187.36 C 280.371 192.655 316.013 195.984 341.263 183.192 C 348.81 178.007 354.905 165.752 354.905 155.762 C 354.263 132.017 336.471 131.427 318.405 125.886 C 308.798 121.606 297.105 121.226 287.493 125.646 C 271.127 134.136 263.533 151.446 252.343 165.016 C 251.059 156.736 254.746 149.076 257.518 141.526 L 233.282 142.506 C 221.504 167.886 198.66 169.716 175.142 160.266 C 168.747 168.896 156.804 176.636 139.662 176.536 C 152.906 181.206 163.527 192.166 176.638 196.936 C 189.804 199.866 200.858 195.946 212.071 189.846 Z M 106.407 131.062 C 103.937 121.844 103.049 112.919 104.787 114.792 C 105.272 115.314 108.277 121.592 111.465 128.742 C 121.817 162.562 164.577 180.742 172.905 138.677 C 173.17 118.541 152.018 95.287 163.629 76.063 C 161.376 87.92 166.425 98.243 171.439 108.741 C 178.042 122.036 179.835 128.745 179.885 140.343 C 180.845 156.023 198.085 155.661 209.845 152.648 C 239.515 135.985 224.665 104.303 213.585 81.623 C 207.342 69.14 205.583 62.809 203.402 44.97 C 202.072 24.384 193.332 15.975 171.809 15.53 C 158.167 15.025 155.934 36.855 144.084 37.24 C 134.584 36.785 125.364 33.997 115.904 33.262 C 107.224 33.228 100.544 38.518 93.854 50.712 C 88.624 60.23 86.634 61.348 73.384 62.196 C 67.874 62.556 62.694 63.246 61.884 63.746 C 51.294 78.886 48.764 87.986 32.584 100.016 C 25.864 118.466 38.444 157.916 63.734 153.846 C 62.034 137.316 61.064 122.256 70.714 109.786 C 71.974 114.926 71.854 120.186 71.554 125.426 C 59.854 170.116 125.044 185.166 106.384 131.076 Z" transform="matrix(0, 1, -1, 0, 298.428, -82.757979)" bx:origin="0.5 0.5"/>
+</svg> \ No newline at end of file
diff --git a/http/www/images/thumb-rate2.svg b/http/www/images/thumb-rate2.svg
new file mode 100644
index 0000000..f73ab2b
--- /dev/null
+++ b/http/www/images/thumb-rate2.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="380" height="220" xmlns="http://www.w3.org/2000/svg">
+ <path d="M26.552 98.8c-3.676 81.846 59.677 72.722 109.602 81.823 10.023 9.914 23.073 22.054 42.35 23.332 21.154-3.983 36.55-6.97 63.21-15.756 96.426 14.18 121.143-.97 114.44-43.32-6.25-14.71-57.53-42.02-88.68-9.21l-32.83.5c-1.207-20.6-4.635-34.08-22.555-66.91-2.45-26.2-10.65-56.7-33.01-57.85-15.22-1.04-22.45 9.57-31.03 18.51-13.44.31-26.48.42-39.68-.84C94.06 33.97 86.1 59.69 61.4 59.9c-12.84 8.076-23.25 25.86-34.85 38.89z" style="fill: rgb(241, 198, 198); fill-rule: evenodd;"/>
+ <path d="M33.507 132.98c10.944 12.51 21.887 8.51 32.83-1.767 12.583 18.648 28.61 28.068 44.7 5.303 28.74 9.042 46.074-2.173 60.104-21.213 24.56 5.002 40.34-5.035 50.76-24.243 18.22 26.492 10.32 48.538-2.77 69.7 5.08 12.983 13.99 15.844 20.71 18.688 31.94-9 68.22 16.152 117.18-27.274 4.85 28.603-14.59 34.945-33.33 41.92-31.24 4.492-61.62.323-91.92-4.545l-53.04 15.65-54.55-28.79c-41.07-.16-88.45-5.37-90.66-43.44z" style="opacity: 0.64; fill: rgb(177, 142, 108); fill-rule: evenodd;"/>
+ <path d="M100.36 182.365c-17.834-1.16-28.085-3.103-36.14-6.85-12.42-5.78-31.756-22.75-37.857-33.226-3.83-6.58-7.716-22.63-7.874-32.52-.16-9.58.94-11.85 8.04-16.66 8.4-5.7 13.98-12.22 18.7-21.85 6.34-12.91 10.34-15.84 21.76-15.94 9.21-.08 13.77-2.63 20.17-11.29 8.33-11.25 15.98-17.27 24.24-19.05 10.87-1.46 22.2 7.34 32.86 3.68 5.65-6.56 9.77-12.28 16.58-17.8 14.23-7.22 34.94-2.09 43.24 10.74 3.68 7.55 6.45 19.31 7.69 32.63 1.27 13.623 3.25 19.46 10.76 31.683 8.29 15.34 13.19 24.47 13.38 45.2l27.266 1.234c17.084-17.79 30.59-20.693 54.016-14.5 17.956 6.11 31.77 4.79 40.596 23.447 3.973 9.55 4.7 16.87 2.44 24.65-3.827 13.15-10.288 21.76-19.83 26.41-17.81 8.68-56.137 10.01-89.415 3.09-13.864-4.13-26.66-1.84-39.41 4.344-22.216 8.915-27.115 5.005-33.608 12.614-32.52-20.727-38.498-26.92-77.634-30.06zm111.526 7.65c12.646-6.77 27.507-5.874 40.96-2.47 27.34 5.295 62.982 8.624 88.232-4.168 7.547-5.185 13.642-17.44 13.642-27.43-.642-23.745-18.434-24.335-36.5-29.876-9.607-4.28-21.3-4.66-30.912-.24-16.366 8.49-23.96 25.8-35.15 39.37-1.284-8.28 2.403-15.94 5.175-23.49l-24.236.98c-11.778 25.38-34.622 27.21-58.14 17.76-6.395 8.63-18.338 16.37-35.48 16.27 13.244 4.67 23.865 15.63 36.976 20.4 13.166 2.93 24.22-.99 35.433-7.09zm-105.664-58.768c-2.47-9.218-3.358-18.143-1.62-16.27.485.522 3.49 6.8 6.678 13.95 10.352 33.82 53.112 52 61.44 9.935.265-20.136-20.887-43.39-9.276-62.614-2.253 11.857 2.796 22.18 7.81 32.678 6.603 13.295 8.396 20.004 8.446 31.602.96 15.68 18.2 15.318 29.96 12.305 29.67-16.663 14.82-48.345 3.74-71.025-6.243-12.483-8.002-18.814-10.183-36.653-1.33-20.586-10.07-28.995-31.593-29.44-13.642-.505-15.875 21.325-27.725 21.71-9.5-.455-18.72-3.243-28.18-3.978-8.68-.034-15.36 5.256-22.05 17.45-5.23 9.518-7.22 10.636-20.47 11.484-5.51.36-10.69 1.05-11.5 1.55-10.59 15.14-13.12 24.24-29.3 36.27-6.72 18.45 5.86 57.9 31.15 53.83-1.7-16.53-2.67-31.59 6.98-44.06 1.26 5.14 1.14 10.4.84 15.64-11.7 44.69 53.49 59.74 34.83 5.65z"/>
+</svg> \ No newline at end of file
diff --git a/http/www/images/thumb-rate3.svg b/http/www/images/thumb-rate3.svg
new file mode 100644
index 0000000..464b3f6
--- /dev/null
+++ b/http/www/images/thumb-rate3.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="220" height="380" viewBox="82 -80 220 380" xmlns="http://www.w3.org/2000/svg" xmlns:bx="http://www.boxy-svg.com/bx">
+ <path d="M 23.42 97.384 C 19.744 179.23 83.097 170.106 133.022 179.207 C 143.045 189.121 156.095 201.261 175.372 202.539 C 196.526 198.556 211.922 195.569 238.582 186.783 C 335.008 200.963 359.725 185.813 353.022 143.463 C 346.772 128.753 295.492 101.443 264.342 134.253 L 231.512 134.753 C 230.305 114.153 226.877 100.673 208.957 67.843 C 206.507 41.643 198.307 11.143 175.947 9.993 C 160.727 8.953 153.497 19.563 144.917 28.503 C 131.477 28.813 118.437 28.923 105.237 27.663 C 90.928 32.554 82.968 58.274 58.268 58.484 C 45.428 66.56 35.018 84.344 23.418 97.374 Z" style="fill: rgb(225, 0, 255); fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 83.988542, 295.480555)" bx:origin="0.5 0.5"/>
+ <path d="M 66.52 85.774 C 77.464 98.284 88.407 94.284 99.35 84.007 C 111.933 102.655 127.96 112.075 144.05 89.31 C 172.79 98.352 190.124 87.137 204.154 68.097 C 228.714 73.099 244.494 63.062 254.914 43.854 C 273.134 70.346 265.234 92.392 252.144 113.554 C 257.224 126.537 266.134 129.398 272.854 132.242 C 304.794 123.242 341.074 148.394 390.034 104.968 C 394.884 133.571 375.444 139.913 356.704 146.888 C 325.464 151.38 295.084 147.211 264.784 142.343 L 211.744 157.993 L 157.194 129.203 C 116.124 129.043 68.744 123.833 66.534 85.763 Z" style="opacity: 0.64; fill: rgb(177, 142, 108); fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 129.7786, 331.625624)" bx:origin="0.5 0.5"/>
+ <path d="M 100.545 182.55 C 82.711 181.39 72.46 179.447 64.405 175.7 C 51.985 169.92 32.649 152.95 26.548 142.474 C 22.718 135.894 18.832 119.844 18.674 109.954 C 18.514 100.374 19.614 98.104 26.714 93.294 C 35.114 87.594 40.694 81.074 45.414 71.444 C 51.754 58.534 55.754 55.604 67.174 55.504 C 76.384 55.424 80.944 52.874 87.344 44.214 C 95.674 32.964 103.324 26.944 111.584 25.164 C 122.454 23.704 133.784 32.504 144.444 28.844 C 150.094 22.284 154.214 16.564 161.024 11.044 C 175.254 3.824 195.964 8.954 204.264 21.784 C 207.944 29.334 210.714 41.094 211.954 54.414 C 213.224 68.037 215.204 73.874 222.714 86.097 C 231.004 101.437 235.904 110.567 236.094 131.297 L 263.36 132.531 C 280.444 114.741 293.95 111.838 317.376 118.031 C 335.332 124.141 349.146 122.821 357.972 141.478 C 361.945 151.028 362.672 158.348 360.412 166.128 C 356.585 179.278 350.124 187.888 340.582 192.538 C 322.772 201.218 284.445 202.548 251.167 195.628 C 237.303 191.498 224.507 193.788 211.757 199.972 C 189.541 208.887 184.642 204.977 178.149 212.586 C 145.629 191.859 139.651 185.666 100.515 182.526 Z M 212.071 190.2 C 224.717 183.43 239.578 184.326 253.031 187.73 C 280.371 193.025 316.013 196.354 341.263 183.562 C 348.81 178.377 354.905 166.122 354.905 156.132 C 354.263 132.387 336.471 131.797 318.405 126.256 C 308.798 121.976 297.105 121.596 287.493 126.016 C 271.127 134.506 263.533 151.816 252.343 165.386 C 251.059 157.106 254.746 149.446 257.518 141.896 L 233.282 142.876 C 221.504 168.256 198.66 170.086 175.142 160.636 C 168.747 169.266 156.804 177.006 139.662 176.906 C 152.906 181.576 163.527 192.536 176.638 197.306 C 189.804 200.236 200.858 196.316 212.071 190.216 Z M 106.407 131.432 C 103.937 122.214 103.049 113.289 104.787 115.162 C 105.272 115.684 108.277 121.962 111.465 129.112 C 121.817 162.932 164.577 181.112 172.905 139.047 C 173.17 118.911 152.018 95.657 163.629 76.433 C 161.376 88.29 166.425 98.613 171.439 109.111 C 178.042 122.406 179.835 129.115 179.885 140.713 C 180.845 156.393 198.085 156.031 209.845 153.018 C 239.515 136.355 224.665 104.673 213.585 81.993 C 207.342 69.51 205.583 63.179 203.402 45.34 C 202.072 24.754 193.332 16.345 171.809 15.9 C 158.167 15.395 155.934 37.225 144.084 37.61 C 134.584 37.155 125.364 34.367 115.904 33.632 C 107.224 33.598 100.544 38.888 93.854 51.082 C 88.624 60.6 86.634 61.718 73.384 62.566 C 67.874 62.926 62.694 63.616 61.884 64.116 C 51.294 79.256 48.764 88.356 32.584 100.386 C 25.864 118.836 38.444 158.286 63.734 154.216 C 62.034 137.686 61.064 122.626 70.714 110.156 C 71.974 115.296 71.854 120.556 71.554 125.796 C 59.854 170.486 125.044 185.536 106.384 131.446 Z" transform="matrix(0, -1, 1, 0, 82.387865, 298.797917)" bx:origin="0.5 0.5"/>
+</svg> \ No newline at end of file
diff --git a/http/www/images/thumb-rate4.svg b/http/www/images/thumb-rate4.svg
new file mode 100644
index 0000000..1afb8b7
--- /dev/null
+++ b/http/www/images/thumb-rate4.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="220" height="380" viewBox="82 -80 220 380" xmlns="http://www.w3.org/2000/svg" xmlns:bx="http://www.boxy-svg.com/bx">
+ <path d="M 23.42 97.384 C 19.744 179.23 83.097 170.106 133.022 179.207 C 143.045 189.121 156.095 201.261 175.372 202.539 C 196.526 198.556 211.922 195.569 238.582 186.783 C 335.008 200.963 359.725 185.813 353.022 143.463 C 346.772 128.753 295.492 101.443 264.342 134.253 L 231.512 134.753 C 230.305 114.153 226.877 100.673 208.957 67.843 C 206.507 41.643 198.307 11.143 175.947 9.993 C 160.727 8.953 153.497 19.563 144.917 28.503 C 131.477 28.813 118.437 28.923 105.237 27.663 C 90.928 32.554 82.968 58.274 58.268 58.484 C 45.428 66.56 35.018 84.344 23.418 97.374 Z" style="fill: red; fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 83.988542, 295.480555)" bx:origin="0.5 0.5"/>
+ <path d="M 66.52 85.774 C 77.464 98.284 88.407 94.284 99.35 84.007 C 111.933 102.655 127.96 112.075 144.05 89.31 C 172.79 98.352 190.124 87.137 204.154 68.097 C 228.714 73.099 244.494 63.062 254.914 43.854 C 273.134 70.346 265.234 92.392 252.144 113.554 C 257.224 126.537 266.134 129.398 272.854 132.242 C 304.794 123.242 341.074 148.394 390.034 104.968 C 394.884 133.571 375.444 139.913 356.704 146.888 C 325.464 151.38 295.084 147.211 264.784 142.343 L 211.744 157.993 L 157.194 129.203 C 116.124 129.043 68.744 123.833 66.534 85.763 Z" style="opacity: 0.64; fill: rgb(177, 142, 108); fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 129.7786, 331.625624)" bx:origin="0.5 0.5"/>
+ <path d="M 100.545 182.55 C 82.711 181.39 72.46 179.447 64.405 175.7 C 51.985 169.92 32.649 152.95 26.548 142.474 C 22.718 135.894 18.832 119.844 18.674 109.954 C 18.514 100.374 19.614 98.104 26.714 93.294 C 35.114 87.594 40.694 81.074 45.414 71.444 C 51.754 58.534 55.754 55.604 67.174 55.504 C 76.384 55.424 80.944 52.874 87.344 44.214 C 95.674 32.964 103.324 26.944 111.584 25.164 C 122.454 23.704 133.784 32.504 144.444 28.844 C 150.094 22.284 154.214 16.564 161.024 11.044 C 175.254 3.824 195.964 8.954 204.264 21.784 C 207.944 29.334 210.714 41.094 211.954 54.414 C 213.224 68.037 215.204 73.874 222.714 86.097 C 231.004 101.437 235.904 110.567 236.094 131.297 L 263.36 132.531 C 280.444 114.741 293.95 111.838 317.376 118.031 C 335.332 124.141 349.146 122.821 357.972 141.478 C 361.945 151.028 362.672 158.348 360.412 166.128 C 356.585 179.278 350.124 187.888 340.582 192.538 C 322.772 201.218 284.445 202.548 251.167 195.628 C 237.303 191.498 224.507 193.788 211.757 199.972 C 189.541 208.887 184.642 204.977 178.149 212.586 C 145.629 191.859 139.651 185.666 100.515 182.526 Z M 212.071 190.2 C 224.717 183.43 239.578 184.326 253.031 187.73 C 280.371 193.025 316.013 196.354 341.263 183.562 C 348.81 178.377 354.905 166.122 354.905 156.132 C 354.263 132.387 336.471 131.797 318.405 126.256 C 308.798 121.976 297.105 121.596 287.493 126.016 C 271.127 134.506 263.533 151.816 252.343 165.386 C 251.059 157.106 254.746 149.446 257.518 141.896 L 233.282 142.876 C 221.504 168.256 198.66 170.086 175.142 160.636 C 168.747 169.266 156.804 177.006 139.662 176.906 C 152.906 181.576 163.527 192.536 176.638 197.306 C 189.804 200.236 200.858 196.316 212.071 190.216 Z M 106.407 131.432 C 103.937 122.214 103.049 113.289 104.787 115.162 C 105.272 115.684 108.277 121.962 111.465 129.112 C 121.817 162.932 164.577 181.112 172.905 139.047 C 173.17 118.911 152.018 95.657 163.629 76.433 C 161.376 88.29 166.425 98.613 171.439 109.111 C 178.042 122.406 179.835 129.115 179.885 140.713 C 180.845 156.393 198.085 156.031 209.845 153.018 C 239.515 136.355 224.665 104.673 213.585 81.993 C 207.342 69.51 205.583 63.179 203.402 45.34 C 202.072 24.754 193.332 16.345 171.809 15.9 C 158.167 15.395 155.934 37.225 144.084 37.61 C 134.584 37.155 125.364 34.367 115.904 33.632 C 107.224 33.598 100.544 38.888 93.854 51.082 C 88.624 60.6 86.634 61.718 73.384 62.566 C 67.874 62.926 62.694 63.616 61.884 64.116 C 51.294 79.256 48.764 88.356 32.584 100.386 C 25.864 118.836 38.444 158.286 63.734 154.216 C 62.034 137.686 61.064 122.626 70.714 110.156 C 71.974 115.296 71.854 120.556 71.554 125.796 C 59.854 170.486 125.044 185.536 106.384 131.446 Z" transform="matrix(0, -1, 1, 0, 82.387865, 298.797917)" bx:origin="0.5 0.5"/>
+</svg> \ No newline at end of file
diff --git a/http/www/images/thumb-rate5.svg b/http/www/images/thumb-rate5.svg
new file mode 100644
index 0000000..63d6a50
--- /dev/null
+++ b/http/www/images/thumb-rate5.svg
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="220" height="380" viewBox="82 -80 220 380" xmlns="http://www.w3.org/2000/svg" xmlns:bx="http://www.boxy-svg.com/bx">
+ <path d="M 23.42 97.384 C 19.744 179.23 83.097 170.106 133.022 179.207 C 143.045 189.121 156.095 201.261 175.372 202.539 C 196.526 198.556 211.922 195.569 238.582 186.783 C 335.008 200.963 359.725 185.813 353.022 143.463 C 346.772 128.753 295.492 101.443 264.342 134.253 L 231.512 134.753 C 230.305 114.153 226.877 100.673 208.957 67.843 C 206.507 41.643 198.307 11.143 175.947 9.993 C 160.727 8.953 153.497 19.563 144.917 28.503 C 131.477 28.813 118.437 28.923 105.237 27.663 C 90.928 32.554 82.968 58.274 58.268 58.484 C 45.428 66.56 35.018 84.344 23.418 97.374 Z" style="fill: rgb(255, 208, 0); fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 83.988542, 295.480555)" bx:origin="0.5 0.5"/>
+ <path d="M 66.52 85.774 C 77.464 98.284 88.407 94.284 99.35 84.007 C 111.933 102.655 127.96 112.075 144.05 89.31 C 172.79 98.352 190.124 87.137 204.154 68.097 C 228.714 73.099 244.494 63.062 254.914 43.854 C 273.134 70.346 265.234 92.392 252.144 113.554 C 257.224 126.537 266.134 129.398 272.854 132.242 C 304.794 123.242 341.074 148.394 390.034 104.968 C 394.884 133.571 375.444 139.913 356.704 146.888 C 325.464 151.38 295.084 147.211 264.784 142.343 L 211.744 157.993 L 157.194 129.203 C 116.124 129.043 68.744 123.833 66.534 85.763 Z" style="opacity: 0.64; fill: rgb(177, 142, 108); fill-rule: evenodd;" transform="matrix(0, -1, 1, 0, 129.7786, 331.625624)" bx:origin="0.5 0.5"/>
+ <path d="M 100.545 182.55 C 82.711 181.39 72.46 179.447 64.405 175.7 C 51.985 169.92 32.649 152.95 26.548 142.474 C 22.718 135.894 18.832 119.844 18.674 109.954 C 18.514 100.374 19.614 98.104 26.714 93.294 C 35.114 87.594 40.694 81.074 45.414 71.444 C 51.754 58.534 55.754 55.604 67.174 55.504 C 76.384 55.424 80.944 52.874 87.344 44.214 C 95.674 32.964 103.324 26.944 111.584 25.164 C 122.454 23.704 133.784 32.504 144.444 28.844 C 150.094 22.284 154.214 16.564 161.024 11.044 C 175.254 3.824 195.964 8.954 204.264 21.784 C 207.944 29.334 210.714 41.094 211.954 54.414 C 213.224 68.037 215.204 73.874 222.714 86.097 C 231.004 101.437 235.904 110.567 236.094 131.297 L 263.36 132.531 C 280.444 114.741 293.95 111.838 317.376 118.031 C 335.332 124.141 349.146 122.821 357.972 141.478 C 361.945 151.028 362.672 158.348 360.412 166.128 C 356.585 179.278 350.124 187.888 340.582 192.538 C 322.772 201.218 284.445 202.548 251.167 195.628 C 237.303 191.498 224.507 193.788 211.757 199.972 C 189.541 208.887 184.642 204.977 178.149 212.586 C 145.629 191.859 139.651 185.666 100.515 182.526 Z M 212.071 190.2 C 224.717 183.43 239.578 184.326 253.031 187.73 C 280.371 193.025 316.013 196.354 341.263 183.562 C 348.81 178.377 354.905 166.122 354.905 156.132 C 354.263 132.387 336.471 131.797 318.405 126.256 C 308.798 121.976 297.105 121.596 287.493 126.016 C 271.127 134.506 263.533 151.816 252.343 165.386 C 251.059 157.106 254.746 149.446 257.518 141.896 L 233.282 142.876 C 221.504 168.256 198.66 170.086 175.142 160.636 C 168.747 169.266 156.804 177.006 139.662 176.906 C 152.906 181.576 163.527 192.536 176.638 197.306 C 189.804 200.236 200.858 196.316 212.071 190.216 Z M 106.407 131.432 C 103.937 122.214 103.049 113.289 104.787 115.162 C 105.272 115.684 108.277 121.962 111.465 129.112 C 121.817 162.932 164.577 181.112 172.905 139.047 C 173.17 118.911 152.018 95.657 163.629 76.433 C 161.376 88.29 166.425 98.613 171.439 109.111 C 178.042 122.406 179.835 129.115 179.885 140.713 C 180.845 156.393 198.085 156.031 209.845 153.018 C 239.515 136.355 224.665 104.673 213.585 81.993 C 207.342 69.51 205.583 63.179 203.402 45.34 C 202.072 24.754 193.332 16.345 171.809 15.9 C 158.167 15.395 155.934 37.225 144.084 37.61 C 134.584 37.155 125.364 34.367 115.904 33.632 C 107.224 33.598 100.544 38.888 93.854 51.082 C 88.624 60.6 86.634 61.718 73.384 62.566 C 67.874 62.926 62.694 63.616 61.884 64.116 C 51.294 79.256 48.764 88.356 32.584 100.386 C 25.864 118.836 38.444 158.286 63.734 154.216 C 62.034 137.686 61.064 122.626 70.714 110.156 C 71.974 115.296 71.854 120.556 71.554 125.796 C 59.854 170.486 125.044 185.536 106.384 131.446 Z" transform="matrix(0, -1, 1, 0, 82.387865, 298.797917)" bx:origin="0.5 0.5"/>
+</svg> \ No newline at end of file
diff --git a/http/www/images/ui-bg_flat_75_aaaaaa_40x100.png b/http/www/images/ui-bg_flat_75_aaaaaa_40x100.png
new file mode 100644
index 0000000..90cd498
--- /dev/null
+++ b/http/www/images/ui-bg_flat_75_aaaaaa_40x100.png
Binary files differ
diff --git a/http/www/images/ui-bg_glass_100_f5f0e5_1x400.png b/http/www/images/ui-bg_glass_100_f5f0e5_1x400.png
new file mode 100644
index 0000000..16f399f
--- /dev/null
+++ b/http/www/images/ui-bg_glass_100_f5f0e5_1x400.png
Binary files differ
diff --git a/http/www/images/ui-bg_glass_25_cb842e_1x400.png b/http/www/images/ui-bg_glass_25_cb842e_1x400.png
new file mode 100644
index 0000000..2e653b9
--- /dev/null
+++ b/http/www/images/ui-bg_glass_25_cb842e_1x400.png
Binary files differ
diff --git a/http/www/images/ui-bg_glass_70_ede4d4_1x400.png b/http/www/images/ui-bg_glass_70_ede4d4_1x400.png
new file mode 100644
index 0000000..e349d8c
--- /dev/null
+++ b/http/www/images/ui-bg_glass_70_ede4d4_1x400.png
Binary files differ
diff --git a/http/www/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png b/http/www/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
new file mode 100644
index 0000000..04ac995
--- /dev/null
+++ b/http/www/images/ui-bg_highlight-hard_100_f4f0ec_1x100.png
Binary files differ
diff --git a/http/www/images/ui-bg_highlight-hard_65_fee4bd_1x100.png b/http/www/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
new file mode 100644
index 0000000..c4b297d
--- /dev/null
+++ b/http/www/images/ui-bg_highlight-hard_65_fee4bd_1x100.png
Binary files differ
diff --git a/http/www/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png b/http/www/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
new file mode 100644
index 0000000..197c190
--- /dev/null
+++ b/http/www/images/ui-bg_highlight-hard_75_f5f5b5_1x100.png
Binary files differ
diff --git a/http/www/images/ui-bg_inset-soft_100_f4f0ec_1x100.png b/http/www/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
new file mode 100644
index 0000000..e774b34
--- /dev/null
+++ b/http/www/images/ui-bg_inset-soft_100_f4f0ec_1x100.png
Binary files differ
diff --git a/http/www/images/ui-icons_c47a23_256x240.png b/http/www/images/ui-icons_c47a23_256x240.png
new file mode 100644
index 0000000..1a14db8
--- /dev/null
+++ b/http/www/images/ui-icons_c47a23_256x240.png
Binary files differ
diff --git a/http/www/images/ui-icons_cb672b_256x240.png b/http/www/images/ui-icons_cb672b_256x240.png
new file mode 100644
index 0000000..0a5230a
--- /dev/null
+++ b/http/www/images/ui-icons_cb672b_256x240.png
Binary files differ
diff --git a/http/www/images/ui-icons_f08000_256x240.png b/http/www/images/ui-icons_f08000_256x240.png
new file mode 100644
index 0000000..c2b00b9
--- /dev/null
+++ b/http/www/images/ui-icons_f08000_256x240.png
Binary files differ
diff --git a/http/www/images/ui-icons_f35f07_256x240.png b/http/www/images/ui-icons_f35f07_256x240.png
new file mode 100644
index 0000000..175e33a
--- /dev/null
+++ b/http/www/images/ui-icons_f35f07_256x240.png
Binary files differ
diff --git a/http/www/images/ui-icons_ff7519_256x240.png b/http/www/images/ui-icons_ff7519_256x240.png
new file mode 100644
index 0000000..3fb2eb9
--- /dev/null
+++ b/http/www/images/ui-icons_ff7519_256x240.png
Binary files differ
diff --git a/http/www/images/ui-icons_ffffff_256x240.png b/http/www/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 0000000..343ae61
--- /dev/null
+++ b/http/www/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/http/www/images/untertitel.png b/http/www/images/untertitel.png
new file mode 100644
index 0000000..d684d59
--- /dev/null
+++ b/http/www/images/untertitel.png
Binary files differ
diff --git a/http/www/index.html b/http/www/index.html
new file mode 100644
index 0000000..cd65abd
--- /dev/null
+++ b/http/www/index.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html class="no-js">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>EPGd - VDR epg daemon</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no, maximum-scale=1, minimum-scale=1">
+ <link rel="stylesheet" href="epgd.css?%VERSION%">
+ <script src="common.js?%VERSION%"></script>
+ <script src="epgd.js?%VERSION%"></script>
+ <meta name="mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+ <link rel="icon" sizes="192x192" href="/images/epgd-4x.png">
+ <link rel="apple-touch-icon" href="/images/epgd-4x.png">
+ </head>
+ <body>
+ <!--[if lt IE 10]>
+ <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
+ <![endif]-->
+ <script type="text/javascript">
+ $(document).ready(function () {
+ epgd.utils.loader.process(epgd.init);
+ });
+ </script>
+ </body>
+</html>
diff --git a/http/www/lang/de.js b/http/www/lang/de.js
new file mode 100644
index 0000000..2ecb9b0
--- /dev/null
+++ b/http/www/lang/de.js
@@ -0,0 +1,299 @@
+epgd.tr = {
+ oClock: "Uhr",
+ minutes: "min",
+ save: "speichern",
+ copy: "kopieren",
+ apply: "übernehmen",
+ close: "schließen",
+ clear: "löschen",
+ yes: "ja",
+ no: "nein",
+ //open: 'öffnen',
+ edit: "bearbeiten",
+ cancel: "abbrechen",
+ del: "löschen",
+ test: "testen",
+ reload: "neu laden",
+ advanced: "erweitert",
+ markAll: "alle markieren",
+ markNone: "keinen markieren",
+ markToggle: "Markierung umdrehen",
+ confirmDelete: "Willst du wirklich löschen?",
+ dataSaved: "Daten wurden gespeichert",
+ dataDeleted: "Daten wurden gelöscht",
+ dataSend: "Daten wurden gesendet",
+ channel: "Kanal",
+ date: "Datum",
+ entries: " Einträge",
+ error: {
+ error: "Fehler",
+ common: "Es ist ein allgemeiner Fehler aufgetreten",
+ serverNotResponse: "Der Server konnte nicht erreicht werden!",
+ notImplemented: "Dieses Feature ist zur Zeit noch nicht implementiert",
+ forbidden: "Zugriff verweigert!",
+ noData: "Für diese Anfrage konnten keine Daten ermittelt werden!",
+ emptyField: "Bitte fülle das Feld $field$ aus!",
+ invalid: "Der eingegebene Wert ist ungültig!"
+ },
+ menu: {
+ now: "Programm",
+ magazine: "Magazin",
+ timer: "Timer",
+ records: "Aufnahmen",
+ search: "Suche",
+ options: "Einstellungen",
+ help: "Hilfe"
+ },
+ pages: {
+ now: {
+ at:'am'
+ },
+ timer: {
+ timerList: "Timer",
+ searchTimerList: "Suchtimer",
+ timersDone: "kürzliche Aufträge",
+ timerListDone: "Auftragshistorie",
+ timerJobList: "asynchrone Aufträge",
+ messageList: "Systemmeldungen"
+ },
+ timerList: {
+ empty: "Keine Timer vorhanden!",
+ startTime: "Anfang",
+ endTime: "Ende",
+ folder: "Verzeichnis",
+ file: "Dateiname",
+ recordTime: "Aufnahmezeit",
+ lifetime: "Lebenszeit",
+ prio: "Priorität",
+ inactive: "Inaktiv",
+ newTimer: "Neuen Timer anlegen",
+ namingMode: "Ermittlung des Dateinamens",
+ namingModes: ["VDR", "Auto", "Constable", "Serie", "Kategorisiert", "Usermode", "Template"],
+ template: 'Template',
+ templateFields: {
+ "%title%": ": Titel (EPG)",
+ "%shorttext%": ": Untertitel (EPG)",
+ "%starttime%": ": Startzeit (EPG)",
+ "%year%": ": Jahr (EPG)",
+ "%category%": ": Kategorie (EPG)",
+ "%episodname%": ": Titel der Serie (constabel)",
+ "%shortname%": ": Kurz-Titel der Serie (constabel, optional)",
+ "%partname%": ": Name der Folge (constabel)",
+ "%season%": ": Staffel (constabel)",
+ "%part%": ": Teil der Staffel (constabel)",
+ "%number%": ": Nummer über alle Staffeln (constabel)",
+ "%extracol1%": ": Zusätzliche Angaben z.B. bei Tatort die Ermittler (constabel, optional)",
+ "%extracol2%": ": ... z.B. bei Tatort der Ort (constabel, optional)",
+ "%extracol3%": ": ... z.B. bei Tatort der Sender (constabel, optional)"
+ },
+ episode: "Serientitel",
+ noEpgMatch: 'Ignoriere fehlende EPG Info',
+ noRepeat: "Wiederholungen vermeiden",
+ searchTimerReload: "Suchtimer updaten",
+ chInclude: "Auf Kanäle einschränken",
+ chExclude: "Kanäle ausschließen",
+ nextDays: "innerhalb der nächsten $field$ Tage",
+ confirmSaveBigResult: "Die Suche ergibt $cnt$ Treffer, trotzdem speichern?",
+ timerStates: {
+ 'D': 'gelöscht',
+ 'E': 'Fehler',
+ 'F': 'Aufnahme erfolgreich',
+ 'P': 'wartet auf Aufnahmebeginn',
+ 'R': 'nimmt gerade auf...',
+ 'U': 'unbekannt'
+ },
+ timerActions: {
+ // 'A': 'VDR und EPGD sind synchron',
+ 'C': 'Timer wurde erstellt und muss noch von einem VDR übernommen werden',
+ 'D': 'Timer wurde gelöscht und muss noch im VDR gelöscht werden',
+ 'F': 'Zuweisung Timer an VDR fehlgeschlagen',
+ 'M': 'Timer wurde verändert und muss noch vom VDR verarbeitet werden'
+ },
+ doneStates: {
+ 'f': 'Timer konnte nicht erstellt werden',
+ 'C': 'Timer bereits erstellt',
+ 'D': 'Timer gelöscht',
+ 'F': 'Aufnahme fehlgeschlagen',
+ 'Q': 'Timer in Vorbereitung',
+ 'R': 'Aufnahme fertig'
+ },
+ messageStates: {
+ 'N': 'Neu',
+ 'R': 'gelesen'
+ },
+ messageTypes: {
+ 'I': 'Information',
+ 'W': 'Warnung',
+ 'E': 'Fehler',
+ 'F': 'Fataler Fehler'
+ }, chFormat: "bevorzugtes Sendeformat"
+ //channelModes: ["SD", "HD", "3D", "HD,SD", "SD,HD", "3D,HD,SD", "SD,HD,3D"]
+ },
+ eventDetail: {
+ record: "Aufnehmen",
+ repeat: "Wiederholungen",
+ ch_switch: "umschalten",
+ eventNext: "nachfolgend",
+ eventPrev: "vorher",
+ parentalrating: 'ab ',
+ mergeSrc: 'Quelle ',
+ genre: 'Genre',
+ category: 'Kategorie',
+ country: 'Land',
+ year: 'Jahr',
+ season: 'Staffel',
+ part: 'Folge',
+ number: 'Folge Insgesamt',
+ extentedInfo: 'weitere Informationen',
+ scrapperMovieInfo: 'Filminformation',
+ scrapperSerieInfo: 'Serieninformation',
+ constabelInfo: 'Constabel Episodenliste',
+ addConstableLink: 'Link erzeugen',
+ loginConstable: 'Login',
+ title: 'Titel',
+ original_title: 'Originaltitel',
+ runtime: 'Laufzeit',
+ lang: 'Sprache',
+ release_date: 'Erscheinungsdatum',
+ actors: 'Schauspieler',
+ network: 'Netzwerk',
+ seriesstatus: 'Status',
+ gueststars: 'Gäste',
+ homepage: 'Webseite',
+ popularity: 'Beliebtheit',
+ vote_average: '&oslash; Bewertung',
+ extInfo: {
+ director: "Regie",
+ camera: "Kamera",
+ screenplay: "Drehbuch",
+ producer: "Produktion",
+ music: "Musik",
+ moderator: "Moderator",
+ commentator: "Kommentator",
+ guest: "Gäste",
+ info: "Info",
+ other: "Sonstige"
+ }
+ },
+ options:{
+ profile: "allgemein",
+ editChannels: "Kanäle bearbeiten",
+ editUser: "Benutzer bearbeiten"
+ },
+ editChannels: {
+ menu: {
+ channelList: "Kanalliste",
+ referenceList: "Referenzliste",
+ insertAsText: "als Text einfügen",
+ extentEmptyChannelNames: "leere Kanalnamen ergänzen",
+ applyAllChannelNames: "Alle Kanalnamen übernehmen",
+ applyChannelSort: "Kanalsortierung übernehmen"
+ },
+ headline: "Sortierung der Kanäle durch drag und drop, Blockmarkierung durch zus. gedrückter shift-Taste", // und der Merge-prioritäten
+ checkWeb: "Kanal in Webansicht anzeigen",
+ checkVDR: "Kanal zum VDR übertragen",
+ desc_insertList: "Kopiere den Inhalt einer channels.conf in das Textfeld unten. Eine vollständige Liste gibt es beispielsweise hier:"
+ },
+ editUser: {
+ user: "Benutzer",
+ sel: "auswählen",
+ add: "neu anlegen",
+ active: "Aktiv",
+ inActive: "Inaktiv",
+ rights: {
+ label: "Rechte",
+ umConfig: "Konfiguration lesen",
+ umConfigEdit: "Konfiguration ändern",
+ umConfigUsers: "Benutzer konfigurieren",
+ umTimer: "Timer lesen",
+ umTimerEdit: "Timer bearbeiten",
+ umSearchTimer: "Suchtimer lesen",
+ umSearchTimerEdit: "Suchtimer bearbeiten",
+ umFsk: "FSK",
+ umRecordings: "Aufnahmen lesen",
+ umRecordingsEdit: "Aufnahmen editieren"
+ }
+ },
+ help: {
+ url: "lang/hilfe.html",
+ noHelp: "Hierzu konnte kein Hilfstext gefunden werden"
+ },
+ search: {
+ search: 'suchen',
+ searchName: 'Name',
+ searchExpression: "Suchausdruck",
+ caseSensitive: "Klein-/Großschreibung",
+ searchModes: ["exakte Übereinstimmung", "regulärer Ausdruck", "Muster", "enthalten in"],
+ searchFields: ["Titel", "Kurztext", "Beschreibung"],
+ empty: "Leider nichts gefunden.",
+ matchdensity: "Treffergenauigkeit"
+ },
+ login: {
+ label: 'Login',
+ userName: 'Benutzername',
+ password: 'Passwort',
+ loggedAlwaysIn: 'angemeldet bleiben',
+ logout: 'Abmelden',
+ error: 'Fehler beim Anmelden!',
+ logoutMessage: 'Du wurdest abgemeldet!',
+ needLogin: 'Login erforderlich'
+ },
+ records: {
+ ddLabel: "Drag und Drop",
+ refreshMessage: "Aufnahmelisten werden neu geladen, Seite lädt in $sec$ Sekunden neu",
+ moveMessage: "Aufnahme verschieben von \n$src$\nnach",
+ notFoundMessage: "Aufnahme nicht gefunden, ggf einmal aktualisieren",
+ deleteMessage: "Soll die Aufnahme $src$ wirklich gelöscht werden?",
+ available: "Verfügbar",
+ commonRecFolder: "gemeinsame Aufnahmen",
+ similarTimer: "ähnliche Sendung aufnehmen"
+ },
+ profile: {
+ mailReceiver: "eMail",
+ sendTCC: "sende Mail bei Timerkonflikten",
+ sendMessages: "sende Mail bei Systemmeldungen",
+ magazinePan: 'Scrollgeschwindigkeit in Minuten<br />(0 = aus)',
+ magazinePanDelay: 'Auslöseverzögerung',
+ maxListEntries: 'maximal Anzahl Einträge, die auf einmal vom Server geladen werden sollen, z.B. bei Suchen, Suchtimern usw.',
+ system: {
+ label: "epgd Backend"
+ },
+ vdr: {
+ startWithSched:'EPG Menü startet mit Schedule'
+ },
+ record: {
+ subFolderSort: 'Sortierung der Unterordner'
+ }
+ }
+ },
+ dateTimePicker: {
+ monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
+ 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
+ monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+ dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
+ dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ weekHeader: 'KW',
+ timeOnlyTitle: 'Zeit wählen',
+ timeText: 'Sendungsbeginn',
+ timeTextBetween: 'zwischen',
+ prevText: '&#x3C;Zurück',
+ nextText: 'Vor&#x3E;',
+ currentText: 'Jetzt',
+ closeText: 'Fertig',
+ hourText: 'Stunde',
+ minuteText: 'Minute',
+ secondText: 'Sekunde',
+ millisecText: 'Millisekunde',
+ microsecText: 'Mikrosekunde',
+ timezoneText: 'Zeitzone',
+ timeFormat: 'HH:mm',
+ dateFormat: 'D, dd.mm.yy',
+ amNames: ['vorm.', 'AM', 'A'],
+ pmNames: ['nachm.', 'PM', 'P'],
+ isRTL: false,
+ showMonthAfterYear: false,
+ yearSuffix: ''
+ }
+};
diff --git a/http/www/lang/hilfe.html b/http/www/lang/hilfe.html
new file mode 100644
index 0000000..ac2d394
--- /dev/null
+++ b/http/www/lang/hilfe.html
@@ -0,0 +1,303 @@
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js">
+ <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>EPGd Hilfe</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1, minimum-scale=1">
+ <link rel="stylesheet" href="../epgd.css">
+ <script src="../common.js"></script>
+ <script src="../epgd.js"></script>
+</head>
+<body>
+ <div id="help">
+ <ul>
+ <li><a href="#h_intro">Allgemein</a></li>
+ <li><a href="#h_now">Aktuell</a></li>
+ <li><a href="#h_magazine">Magazin</a></li>
+ <li><a href="#h_eventDetail">Detailansicht</a></li>
+ <li><a href="#h_records">Aufnahmen</a></li>
+ <li><a href="#h_timer">Timer</a></li>
+ <li><a href="#h_search">Suche</a></li>
+ <li><a href="#h_options">Einstellungen</a></li>
+ <li><a href="#h_about">Über</a></li>
+ </ul>
+ <div id="h_intro">
+ <h3>Electronic Program Guide daemon</h3>
+ <p>
+ Verwaltung von <b>V</b>ideo <b>D</b>isc <b>R</b>ecorder
+ <ul>
+ <li>Anzeige vom aktuellen TV Programm</li>
+ <li>Verwalten deinen Aufnahmn</li>
+ <li>Erzeugen von Timern und Suchtimern</li>
+ </ul></p>
+ <div id="h_datepicker">
+ <h4>Auswahl von Datum und Zeit</h4>
+ Auf der linken Seite werden alle Tage angezeigt, wo Daten vorhanden sind. Auf der rechten Seite kann dann die Uhrzeit eingestellt werden.
+ Das kann dann auf verschiedene Arten passieren. Die obigen Zeiten sind sogenannte Quicklinks, die unter den <a href="#menu_help,h_options">Einstellungen</a> je Nutzer definiert werden können.
+ <br />Wenn das Datum/die Zeit dann eingestellt wurden, muss noch der Knopf "fertig" gedrückt werden oder auch einfach neben dem Datepicker in das Dokument geklickt werden, damit sich die Ansicht aktualisiert.
+ </div>
+ </div>
+ <div id="h_now">
+ <p>In der "Aktuell" Ansicht wird jeweils die aktuelle Sendung von allen für die Web-Oberfläche definierten Kanäle angezeigt.</p>
+ <p>
+ Neben dem Menüpunkt wird dabei <a class="help" id="bh_datepicker"><input type="text" readonly="readonly" value="Datum/Zeit" /></a> angezeigt, auf das sich die aktuelle Anzeige bezieht. Diese kann dort auch durch Anklicken verändert werden.
+ <br />Zusätzlich existiert noch der Knopf <span class="iAsButton i-check-empty">nachfolgend</span>, der jeweils immer die nachfolgende Sendung pro Kanal anzeigt.
+ </p>
+ </div>
+ <div id="h_magazine">
+ <p>In der Magazin-Ansicht wird für die Web-Oberfläche definierten Kanäle das Programm in einer Spaltenansicht angezeigt, je Spalte ein Kanal. Die Anzahl der Spalten/Kanäle richtet sich dabei nach der Bildschirmgröße. Ausgehend von der in der Menüleiste angezeigten <a class="help" id="bh_datepicker"><input type="text" readonly="readonly" value="Datum/Zeit" /></a> wird dann je nach Bildschirmgröße das Programm angezeigt.</p>
+ <p>Das aktuelle Sichtfeld kann dann durch Scrollen nach oben/unten bzw. links/rechts verschoben werden.
+ Auf Desktop-Systemen dazu einfach die Maus in den Randbereich bewegen. Die Empfindlichkeit für dieses Scrollen kann in den Einstellungen angepasst werden.
+ Durch die Buttons oben links/rechts kann dann noch kanalweise oder seitenweise (Anzahl Spalten/Bildschirm) geblättert werden.</p>
+ <p><h5>Warum sind die Programme nicht immer auf gleicher Höhe?</h5>
+ Die Höhe des Kastens für eine Sendung steht in Relation zur Sendedauer. Ist die Sendung kürzer als 10 Minuten, wird sie aber so trotzdem 20 px hoch gezeichnet, als wäre sie 10 Minuten lang, damit zumindest der Titel der vernünftig lesbar ist.
+ Das delta wird dann mit an die nächste Sendung gegeben und diese wird dann in der Höhe um dieses Delta verringert, damit es danach wieder passt. Ggf. wird das aber auch über mehrere Sendung so mitgeschleppt.
+ </p>
+ </div>
+ <div id="h_eventDetail">
+ <p>Hier werden sämtlich Informationen über ein Event/Sendung angezeigt. Dazu werden ggf. spezielle Serieninformtionen oder Filminformationen in einem eigenen Bereich angezeigt. Die Inhalte beschafft das Scraper Plugin.</p>
+ <h3>Constabel Episodenliste</h3>
+ <p>Hier werden alle Episoden aufgelistet, wenn sie bei constabel gepflegt wurden.</p>
+ <div id="h_constabel">
+ <h4>Editieren/ Link hinzufügen</h4>
+ <p>
+ Die Informationen können direkt auf der constabel Seite gepflegt werden. Dazu muss man dort aber bereits eingeloggt sein. Leider kann an dieser Stelle nicht ermittelt werden, ob man bereits eingeloggt ist oder nicht.
+ <br />Den benötigten Account kann man auf dieser Seite auch direkt anfordern.
+ </p>
+ </div>
+ </div>
+ <div id="h_records">
+ <p>
+ Hier werden die Aufnahmen von sämtlichen registrierten VDRs angezeigt.
+ <div id="h_recDD">
+ Die Aufnahmen können hier per Drag and Drop in andere Ordner verschoben oder auch gelöscht werden, indem sie auf die Mülltonne oben links in der Ecke gezogen werden.
+ <br />Für Touchgeräte wird es am Anfang erstmal ausgeschaltet, damit keine versehenliche Aktion ausgelöst wird.
+ </div>
+ Markierte Aufnahmen können auch über einen Klick auf die Mülltonne gelöscht werden.
+ </p>
+ <p>
+ Der Knopf <button class="iAsButton i-refresh">neu laden</button>
+ <span id="h_recRefresh">fordert alle VDRs auf, ihre Aufnahmeverzeichnisse neu einzulesen.
+ <br /> Nach 5 Sekunden wird die Liste neu geladen, da es keine direkte Rückmeldung gibt, wann die mit Einlesen fertig sind.
+ </span>
+ </p>
+ <p>
+ <button class="iAsButton">&nbsp;∗</button><input type="text" /><button class="iAsButton">∗&nbsp;</button><span><button class="iAsButton i-rewind"></button><span id="rSCnt">5</span><button class="iAsButton i-forward"></button></span>
+ <div id="h_recSearch">
+ Hier können Aufnahmen gesucht werden. Die Fundstellen werden dabei markiert.
+ <br />Mit den Sternknöpfen links und rechts kann man das Wort am Anfang und/oder am Ende suchen.
+ <br />Die einzelnen Treffer können mit den Pfeiltasten angesprungen werden.
+ </div>
+ </p>
+ </div>
+ <div id="h_timer" class="accordion">
+ <h3>allgemein</h3>
+ <div>
+ <p>Wenn man im WEB einen Timer für ein Event anlegt und dabei keine Zeiten angibt, wird eine Row in Timers
+ für dieses Event anhand der Event ID erstellt, dabei werden keine Zeiten eingetragen.
+ Übernimmt nun ein VDR bzw. das epg2vdr Plugin den Timer, wird zu dem Event über die Event ID ein Timer angelegt,
+ hierzu werden Funktionen des VDR verwendet, somit kommt alles wie die Zeiten und Titel etc. vom VDR selbst
+ - ohne Einfluss des epgd oder des Plugin.
+ <br />Im Anschluss werden die von VDR gesetzten Daten des angelegten Timers in die Liste übernommen.</p>
+ </div>
+ <h3>Timer</h3>
+ <div>
+ <p>Hier werden alle aktuellen Timer angezeigt, die noch auf Ausführung warten oder die gerade ausgeführt (aufgenommen) werden.</p>
+ </div>
+ <h3>Suchtimer</h3>
+ <div id="h_sTimer">
+ <p>
+ In der Liste sieht man alle gespeicherten Suchtimer. Diese werden unterschieden nach
+ <div class="i-record">Aufnahme-Timer</div>
+ <div class="i-tv">Umschalt-Timer</div>
+ Erzeugt werde diese alle über einen Dialog. Dazu können diverse Parameter eingestellt werden, mit
+ denen regelmäßig das aktuelle Programm durchsucht wird. Aus allen Treffern wird dann automatisch ein Timer erstellt.
+ <div class="i-search">gespeicherte Suche</div>
+ Hier können diverse Parameter in einer Suche gespeichert werden. Diese können dann in der Suche aufgerufen werden oder auch den Quicklinks hinzugefügt werden. Dadurch kann man sich Favoritensuchen erstellen, wie Primetime mit Spielfilmen.
+ </p>
+ Der Dialog beinhaltet folgende Bereiche:
+ <div><h4>Suchausdruck</h4> analog der <a class="help i-help iAsButton" id="bh_sExpr">Suche</a></div>
+ <div id="h_sTRepeat">
+ <h4>Wiederholungen vermeiden</h4>Jeder Treffer wird mit allen bisher aufgenommenen Aufnahmen
+ (siehe auch vorhandene Aufnahmen), bzw. bereits geplanten Aufnahmen anhand der Einstellung Titel, Kurztext und Beschreibung verglichen.
+ Kommt es zu Doppelungen, wird der Treffer verworfen.
+ </div>
+ <div id="h_sTChFormat">
+ <h4>bevorzugtes Sendeformat</h4>Wird eine Sendung sowohl auf einem SD, wie auch auf einem HD Sender gefunden, kann hier eine Priorität vergeben werden, welche Aufnahme genommen werden soll.
+ In dem sich öffnenden Dialog kann per Drag and Drop die Reihenfolge definiert werden
+ </div>
+ <div id="h_sTNameMode">
+ <h4>Ermittlung des Dateinamens</h4>
+ Der Dateinamen wird, mit Ausnahme des Mode 'VDR', über das Python Skript (/etc/epgd/recording.py) ermittelt, er kann bereits Pfadangaben erhalten.
+ <ul>
+ <li>0 VDR: Keine Ermittlung des Dateinamens, die Bezeichnung der Aufnahme wird dem VDR überlassen lediglich das unten angegebene Verzeichnis wird vorangestellt.</li>
+ <li>1 Auto: Automatische Auswahl des Mode Constable, Serie oder Kategorisiert</li>
+ <li>2 Constable: Dateinamen basierend auf Daten von Constabel (Titel/Staffel/xTeil-Nummer/Untertitel) sofern verfügbar</li>
+ <li>3 Serie: Serienaufnahme ohne Verwendung der Constabel Daten (Titel/Untertitel)</li>
+ <li>4 Kategorisiert: Einorden der Aufnahmen entsprechend der Film-Kategorie (Kategorie/Titel)</li>
+ <li>5 User: Hier kann man sich selbst im Python Skript verewigen</li>
+ <li>6 Template: Der Dateiname wird in Eingabefeld unten definiert, hierbei können Platzhalter (%...%) verwendet werden. Bei Eingabe von % erscheint die Auswahl der Platzhalter</li>
+ </ul>
+ <h4>Verzeichnis</h4>Das Verzeichnis wird dem ermittelten Dateinamen (welcher bereits Verzeichnissangaben enthalten kann) vorangestellt. Hier kann entweder aus einem vorhandenen Verzeichnis ausgewählt werden oder es kann ein neuer Verzeichnisname eingegeben werden.
+ </div>
+ <h4>VDR</h4>Es kann direkt ein teilnehmender VDR ausgewählt werden, der aufnehmen soll. Bei auto wird versucht, den VDR aufnehmen zu lassen, der gerade nicht beschäftigt ist.
+ Jörg: wenn aus irgendeinem Grund die Aufnhame nicht stattfindet, wird dann automatisch ein anderer beauftragt?
+ <hr />
+ <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-state-hover" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-transferthick-e-w"></span><span class="ui-button-text">Timer</span></button>
+ Hier kann man aus einem Suchtimer einen normalen (einmaligen) Timer machen. Soweit möglich werden alle Daten übernommen, die restlichen Daten verfallen.
+ <br /><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" role="button"><span class="ui-button-text">testen</span></button>
+ ES wird direkt eine Live-Suche durchgeführt und das Ergebnis im Dialog angezeigt
+ </div>
+ <h3>kürzliche Aufnahmen</h3>
+ <div><p>Alle Aufnahmen, die kürzlich ausgeführt wurden. Dabei werden auch gelöschte oder fehlgeschlagene Timer angezeigt</p></div>
+ <h3>Auftragshistorie</h3>
+ <div><p>Alle Timer, die mal aufgenommen wurden, sind hier zu finden. Wenn neue Sendungen anhand eines Suchtimers gefunden wurden, werden die hiermit abgeglichen und dann ggf. verworfen, wenn sie bereits aufgenommen wurden, also in der Tabelle bereits existieren.</p></div>
+ <h3>asynchrone Aufträge</h3>
+ <div><p>Wenn über das WebIf oder durch Suchtimer durch den epgd neue Timer erzeugt werden oder vorhandene gelöscht werden, stehen diese Aufgaben solange in dieser Liste, bis der entsprechende VDR diese abgeholt hat.</p></div>
+ </div>
+ <div id="h_search">
+ <p>Gezielte Suche nach einer Sendung</p>
+ <div id="h_sExpr">
+ <h4>Suchausdruck</h4>
+ <p>
+ Der in dem Eingabefeld eingegebene Begriff wird je nach Einstellung im Titel, Kurztext oder in der Beschreibung gesucht.
+ Weiter kann eingestellt werden, wie genau der Begriff gefunden werden soll:
+ <ul>
+ <li>exakte Übereinstimmung</li>
+ <li>regulärer Ausdruck<br />Hier kann mittels regulärem Ausdruck gesucht werden, <a href="http://Jörg, kennst du nen passenden InternetLink?" target="_blank">siehe</a></li>
+ <li>Muster<br />Jörg todo</li>
+ <li>enthalten in<br />der Suchbegriff muss nur zum Teil gefunden werden</li>
+ </ul>
+ </p>
+ </div>
+ <div id="h_sTAdv">
+ <h4>erweitert</h4>
+ <h5>Serientitel</h5>
+ Was dort steht, wird mit dem Namen der Folge oder, wenn das Event keine Seriendaten hat, mit dem Kurztext verglichen
+ <h5>Staffel, Folge und Jahr</h5>
+ hier kann nummerisch eine Zahl oder Bereich eingetragen werden, z.B.
+ <br />Folge <b>5</b> für genau Folge 5
+ <br />Staffel <b>2-</b> für alles ab der 2. Staffel
+ <br />Jahr <b>-2012</b> für alle Folgen bis einschließlich 2012
+ <br />Folge<b>5-10</b> für die Folgen 5 bis 10
+ <h5>Kategorie und Genre</h5>
+ Hier werden alle Kategorien und Genres aufgelistet, die aktuell in den Events gefunden wurden
+ <h5>Tipp, TagesTipp und TopTipp</h5>
+ Jörg: werden die hier verodert?
+ <h5>Ignoriere fehlende EPG Info</h5>
+ Jörg todo
+ </div>
+ <div id="h_sTChannels">
+ <h4>Kanäle</h4>
+ <h5>Kanäle einschränken oder auschließen</h5>Hier können ein oder mehrere Kanäle definiert werden, die entweder aus der Suche ausgeschlossen werden oder auf denen die Suche eingeschränkt wird.
+ </div>
+ <div id="h_sTime">
+ <h4>Sendungsbeginn</h4>
+ Zeitspanne, in der die Sendung beginnen kann bzw. muss.
+ Zusätzlich kann man noch auf Wochentage einschränken.
+ Für die Favoriten-Suchen kann man dann das Ergebnis z.B. nur auf heute begrenzen, in dem man nur <i>innerhalb der nächsten</i> <b>1</b> Tage sucht.
+ </div>
+ <div id="h_sName">
+ <h4>Name des Timers</h4>
+ Hier kann ein aussagekräftiger Name vergeben werden, der auch in den Listen immer angezeigt wird.
+ </div>
+ </div>
+ <div id="h_options">
+ <h3>allgemein</h3>
+ <div id="h_opt_wif">
+ <p>Hier können diverse Einstellungen gemacht werden. Diese könne sowohl das WebIf als auch das Backend betreffen.</p>
+ </div>
+ <h3>Kanäle bearbeiten</h3>
+ <div><p>Zur Zeit können hier nur die Kanalinformationen für die Weboberfläche bearbeitet werden, zum einen die Reihenfolge und ob sie überhaupt im Web angezeigt werden soll.
+ <br />Dazu kann man sich Referenzlisten von channelpedia laden oder per Textfeld eine beliebig andere einfügen. Daraus können dann leere oder generell auch alle Kanalnamen übernommen werden.
+ Zusätzlich kann auch die Sortierung übernommen werden.</p></div>
+ <h3>Benutzer bearbeiten</h3>
+ <div><p>Hier können die Benutzer für die Weboberfläche verwaltet werden.</p></div>
+ </div>
+ <div id="h_about" class="accordion">
+ <h3>Programmierung</h3>
+ <div id="h_develop">
+ Backend (epg daemon, http daemon): Jörg Wendel
+ <br />SQL/Procedures: Christian Kaiser
+ <br />Frontend (Web): Dirk Hermes
+ <br />VDR Plugin <a href="https://projects.vdr-developer.org/git/vdr-epg-daemon.git/">epg2vdr</a>: Jörg Wendel
+ <br />VDR Plugin <a href="https://projects.vdr-developer.org/projects/plg-scraper2vdr/wiki">scraper2vdr</a>: Stefan Braun
+ </div>
+ <h3>Historie</h3>
+ <div id="h_history"><pre></pre></div>
+ <h3>ToDo's</h3>
+ <div id="h_todo"><pre></pre></div>
+ <h3>Fonts</h3>
+ <div id="h_fonts"><h4>Die Fonts wurden von <a href="http://fontello.com/">Fontello.com</a> eingebunden:</h4><pre></pre></div>
+ </div>
+ <script type="text/javascript">
+
+ </script>
+ </div>
+<script type="text/javascript" id="help_js">
+ epgd.pages.help.init = function () {
+ this.$con.tabs({
+ heightStyle: "content",
+ activate: function (event, ui) {
+ var panel = ui.newPanel[0],
+ hash = panel.id;
+ ui.newPanel.parents('.ui-widget-content').each(function () { hash = this.id + ',' + hash });
+ location.hash = '#menu_' + hash;
+ }
+ });
+ this.initButtons(epgd.pages.help.$con);
+ $('.accordion').accordion({
+ heightStyle: "content",
+ collapsible: true,
+ activate: function (event, ui) {
+ var panel = ui.newPanel[0],
+ hash = panel.id;
+ if (!panel.hasLoaded) {
+ panel.hasLoaded = true;
+ switch (hash) {
+ case "h_fonts":
+ $("pre", panel).load('/font/LICENSE.txt', function () { $('#help').tabs('refresh'); });
+ break;
+ case "h_history":
+ epgd.ajax({ url: '/HISTORY.h', dataType: "html", contentType: "text/plain; charset=utf-8", cache: false }, function (data) {
+ if (data.indexOf('Error:') == -1) {
+ $(panel).html('<pre>' + data.replace(/^#.*\n/gm, '') + '</pre>');
+ }
+ });
+ break;
+ case "h_todo":
+ epgd.ajax({ url: '/TODO', dataType: "html", contentType: "text/plain; charset=utf-8", cache: false }, function (data) {
+ if (data.indexOf('Error:') == -1) {
+ $(panel).html('<pre>' + data.replace(/^#.*\n/gm, '') + '</pre>');
+ }
+ });
+ break;
+ }
+ }
+ ui.newPanel.parents('.ui-widget-content').each(function () { hash = this.id + ',' + hash });
+ location.hash = '#menu_' + hash;
+ }
+ });
+ }
+</script>
+<script type="text/javascript">
+ epgd.pages.help.$con = $('#help');
+ epgd.pages.help.init();
+ try {
+ location.hash && location.hash.length > 10 && $(location.hash.slice(10).replace(/,/g, '],[aria-controls=').slice(2) + ']').each(function () {
+ if (this.className.indexOf('accordion-header') >= 0)
+ $(this).click();
+ else
+ $(this).find('a:first').click();
+ });
+ } catch (e) { }
+</script>
+</body>
+</html>